Merge branch 'cc/bisect-filter'

* cc/bisect-filter: (21 commits)
  rev-list: add "int bisect_show_flags" in "struct rev_list_info"
  rev-list: remove last static vars used in "show_commit"
  list-objects: add "void *data" parameter to show functions
  bisect--helper: string output variables together with "&&"
  rev-list: pass "int flags" as last argument of "show_bisect_vars"
  t6030: test bisecting with paths
  bisect: use "bisect--helper" and remove "filter_skipped" function
  bisect: implement "read_bisect_paths" to read paths in "$GIT_DIR/BISECT_NAMES"
  bisect--helper: implement "git bisect--helper"
  bisect: use the new generic "sha1_pos" function to lookup sha1
  rev-list: call new "filter_skip" function
  patch-ids: use the new generic "sha1_pos" function to lookup sha1
  sha1-lookup: add new "sha1_pos" function to efficiently lookup sha1
  rev-list: pass "revs" to "show_bisect_vars"
  rev-list: make "show_bisect_vars" non static
  rev-list: move code to show bisect vars into its own function
  rev-list: move bisect related code into its own file
  rev-list: make "bisect_list" variable local to "cmd_rev_list"
  refs: add "for_each_ref_in" function to refactor "for_each_*_ref" functions
  quote: add "sq_dequote_to_argv" to put unwrapped args in an argv array
  ...
This commit is contained in:
Junio C Hamano
2009-04-12 16:46:40 -07:00
20 changed files with 985 additions and 665 deletions

View File

@ -506,6 +506,66 @@ test_expect_success 'optimized merge base checks' '
unset GIT_TRACE
'
# This creates another side branch called "parallel" with some files
# in some directories, to test bisecting with paths.
#
# We should have the following:
#
# P1-P2-P3-P4-P5-P6-P7
# / / /
# H1-H2-H3-H4-H5-H6-H7
# \ \ \
# S5-A \
# \ \
# S6-S7----B
#
test_expect_success '"parallel" side branch creation' '
git bisect reset &&
git checkout -b parallel $HASH1 &&
mkdir dir1 dir2 &&
add_line_into_file "1(para): line 1 on parallel branch" dir1/file1 &&
PARA_HASH1=$(git rev-parse --verify HEAD) &&
add_line_into_file "2(para): line 2 on parallel branch" dir2/file2 &&
PARA_HASH2=$(git rev-parse --verify HEAD) &&
add_line_into_file "3(para): line 3 on parallel branch" dir2/file3 &&
PARA_HASH3=$(git rev-parse --verify HEAD)
git merge -m "merge HASH4 and PARA_HASH3" "$HASH4" &&
PARA_HASH4=$(git rev-parse --verify HEAD)
add_line_into_file "5(para): add line on parallel branch" dir1/file1 &&
PARA_HASH5=$(git rev-parse --verify HEAD)
add_line_into_file "6(para): add line on parallel branch" dir2/file2 &&
PARA_HASH6=$(git rev-parse --verify HEAD)
git merge -m "merge HASH7 and PARA_HASH6" "$HASH7" &&
PARA_HASH7=$(git rev-parse --verify HEAD)
'
test_expect_success 'restricting bisection on one dir' '
git bisect reset &&
git bisect start HEAD $HASH1 -- dir1 &&
para1=$(git rev-parse --verify HEAD) &&
test "$para1" = "$PARA_HASH1" &&
git bisect bad > my_bisect_log.txt &&
grep "$PARA_HASH1 is first bad commit" my_bisect_log.txt
'
test_expect_success 'restricting bisection on one dir and a file' '
git bisect reset &&
git bisect start HEAD $HASH1 -- dir1 hello &&
para4=$(git rev-parse --verify HEAD) &&
test "$para4" = "$PARA_HASH4" &&
git bisect bad &&
hash3=$(git rev-parse --verify HEAD) &&
test "$hash3" = "$HASH3" &&
git bisect good &&
hash4=$(git rev-parse --verify HEAD) &&
test "$hash4" = "$HASH4" &&
git bisect good &&
para1=$(git rev-parse --verify HEAD) &&
test "$para1" = "$PARA_HASH1" &&
git bisect good > my_bisect_log.txt &&
grep "$PARA_HASH4 is first bad commit" my_bisect_log.txt
'
#
#
test_done