Merge branch 'ak/bisect-reset-to-switch'

* ak/bisect-reset-to-switch:
  bisect reset: Allow resetting to any commit, not just a branch
This commit is contained in:
Junio C Hamano 2009-10-30 20:07:00 -07:00
commit 4b3c180061
2 changed files with 21 additions and 10 deletions

View File

@ -20,7 +20,7 @@ on the subcommand:
git bisect bad [<rev>] git bisect bad [<rev>]
git bisect good [<rev>...] git bisect good [<rev>...]
git bisect skip [(<rev>|<range>)...] git bisect skip [(<rev>|<range>)...]
git bisect reset [<branch>] git bisect reset [<commit>]
git bisect visualize git bisect visualize
git bisect replay <logfile> git bisect replay <logfile>
git bisect log git bisect log
@ -81,16 +81,27 @@ will have been left with the first bad kernel revision in "refs/bisect/bad".
Bisect reset Bisect reset
~~~~~~~~~~~~ ~~~~~~~~~~~~
To return to the original head after a bisect session, issue the After a bisect session, to clean up the bisection state and return to
following command: the original HEAD, issue the following command:
------------------------------------------------ ------------------------------------------------
$ git bisect reset $ git bisect reset
------------------------------------------------ ------------------------------------------------
This resets the tree to the original branch instead of being on the By default, this will return your tree to the commit that was checked
bisection commit ("git bisect start" will also do that, as it resets out before `git bisect start`. (A new `git bisect start` will also do
the bisection state). that, as it cleans up the old bisection state.)
With an optional argument, you can return to a different commit
instead:
------------------------------------------------
$ git bisect reset <commit>
------------------------------------------------
For example, `git bisect reset HEAD` will leave you on the current
bisection commit and avoid switching commits at all, while `git bisect
reset bisect/bad` will check out the first bad revision.
Bisect visualize Bisect visualize
~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~

View File

@ -13,8 +13,8 @@ git bisect skip [(<rev>|<range>)...]
mark <rev>... untestable revisions. mark <rev>... untestable revisions.
git bisect next git bisect next
find next bisection to test and check it out. find next bisection to test and check it out.
git bisect reset [<branch>] git bisect reset [<commit>]
finish bisection search and go back to branch. finish bisection search and go back to commit.
git bisect visualize git bisect visualize
show bisect status in gitk. show bisect status in gitk.
git bisect replay <logfile> git bisect replay <logfile>
@ -311,8 +311,8 @@ bisect_reset() {
} }
case "$#" in case "$#" in
0) branch=$(cat "$GIT_DIR/BISECT_START") ;; 0) branch=$(cat "$GIT_DIR/BISECT_START") ;;
1) git show-ref --verify --quiet -- "refs/heads/$1" || 1) git rev-parse --quiet --verify "$1^{commit}" > /dev/null ||
die "$1 does not seem to be a valid branch" die "'$1' is not a valid commit"
branch="$1" ;; branch="$1" ;;
*) *)
usage ;; usage ;;