summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 670f5fe)
raw | patch | inline | side by side (parent: 670f5fe)
author | Junio C Hamano <junkio@cox.net> | |
Tue, 30 Aug 2005 19:45:41 +0000 (12:45 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 30 Aug 2005 19:45:41 +0000 (12:45 -0700) |
Linus says:
I'm testing bisection to find a bug that causes my G5 to no longer boot,
and during the process have found this command line very nice:
gitk bisect/bad --not $(cd .git/refs ; ls bisect/good-*)
it basically shows the state of bisection with the known bad commit as the
top, and cutting off all the good commits - so what you see are the
potential buggy commits.
Signed-off-by: Junio C Hamano <junkio@cox.net>
I'm testing bisection to find a bug that causes my G5 to no longer boot,
and during the process have found this command line very nice:
gitk bisect/bad --not $(cd .git/refs ; ls bisect/good-*)
it basically shows the state of bisection with the known bad commit as the
top, and cutting off all the good commits - so what you see are the
potential buggy commits.
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-bisect-script | patch | blob | history |
diff --git a/git-bisect-script b/git-bisect-script
index 649b7026eb8b69045144da4bec6cdb4879f23c7a..e5a4670158d49375dd17d9767d12f8ada951fbfb 100755 (executable)
--- a/git-bisect-script
+++ b/git-bisect-script
. git-sh-setup-script || dir "Not a git archive"
usage() {
- echo >&2 'usage: git bisect [start | bad | good | next | reset]
+ echo >&2 'usage: git bisect [start|bad|good|next|reset|visualize]
git bisect start reset bisect state and start bisection.
git bisect bad [<rev>] mark <rev> a known-bad revision.
git bisect good [<rev>...] mark <rev>... known-good revisions.
git bisect next find next bisection to test and check it out.
-git bisect reset [<branch>] finish bisection search and go back to branch.'
+git bisect reset [<branch>] finish bisection search and go back to branch.
+git bisect visualize show bisect status in gitk.'
exit 1
}
bisect_bad() {
bisect_autostart
- case "$#" in 0 | 1) ;; *) usage ;; esac
- rev=$(git-rev-parse --verify --default HEAD "$@") || exit
+ case "$#" in
+ 0)
+ rev=$(git-rev-parse --verify HEAD) ;;
+ 1)
+ rev=$(git-rev-parse --verify "$1") ;;
+ *)
+ usage ;;
+ esac || exit
echo "$rev" > "$GIT_DIR/refs/bisect/bad"
bisect_auto_next
}
bisect_autostart
case "$#" in
0) revs=$(git-rev-parse --verify HEAD) || exit ;;
- *) revs=$(git-rev-parse --revs-only --no-flags "$@") || exit ;;
+ *) revs=$(git-rev-parse --revs-only --no-flags "$@") &&
+ test '' != "$revs" || die "Bad rev input: $@" ;;
esac
for rev in $revs
do
- echo "$rev" >"$GIT_DIR/refs/bisect/good-$rev"
+ rev=$(git-rev-parse --verify "$rev") || exit
+ echo "$rev" >"$GIT_DIR/refs/bisect/good-$rev"
done
bisect_auto_next
}
ln -sf refs/heads/bisect "$GIT_DIR/HEAD"
}
+bisect_visualize() {
+ bisect_next_check fail
+ gitk bisect/bad --not `cd "$GIT_DIR/refs" && echo bisect/good-*`
+}
+
bisect_reset() {
case "$#" in
0) branch=master ;;
next)
# Not sure we want "next" at the UI level anymore.
bisect_next "$@" ;;
+ visualize)
+ bisect_visualize "$@" ;;
reset)
bisect_reset "$@" ;;
*)