From c4e4644e17e0fad4a6ffedba22b739cf1b1ac3fc Mon Sep 17 00:00:00 2001 From: Jeff King Date: Mon, 21 Mar 2011 09:14:22 -0400 Subject: bisect: visualize with git-log if gitk is unavailable If gitk is not available in the PATH, bisect ends up exiting with the shell's 127 error code, confusing the git wrapper into thinking that bisect is not a git command. We already fallback to git-log if there doesn't seem to be a graphical display available. We should do the same if gitk is not available in our PATH at all. This not only fixes the ugly error message, but is a much more sensible default than failing to show the user anything. Reported by Maxin John. Tested-by: Maxin B. John Signed-off-by: Jeff King Signed-off-by: Junio C Hamano diff --git a/git-bisect.sh b/git-bisect.sh index c21e33c..415a8d0 100755 --- a/git-bisect.sh +++ b/git-bisect.sh @@ -288,10 +288,12 @@ bisect_visualize() { if test $# = 0 then - case "${DISPLAY+set}${SESSIONNAME+set}${MSYSTEM+set}${SECURITYSESSIONID+set}" in - '') set git log ;; - set*) set gitk ;; - esac + if test -n "${DISPLAY+set}${SESSIONNAME+set}${MSYSTEM+set}${SECURITYSESSIONID+set}" && + type gitk >/dev/null 2>&1; then + set gitk + else + set git log + fi else case "$1" in git*|tig) ;; -- cgit v0.10.2-6-g49f6 From b5f306fbe1bf1a75341f85b84358d25870b010f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?SZEDER=20G=C3=A1bor?= Date: Tue, 22 Mar 2011 19:42:25 +0100 Subject: git-am.txt: advertise 'git am --abort' instead of 'rm .git/rebase-apply' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 'git am --abort' is around for quite a long time now, and users should normally not poke around inside the .git directory, yet the documentation of 'git am' still recommends the following: ... if you decide to start over from scratch, run `rm -f -r .git/rebase-apply` ... Suggest 'git am --abort' instead. It's not quite the same as the original, because 'git am --abort' will restore the original branch, while simply removing '.git/rebase-apply' won't, but that's rather a thinko in the original wording, because that won't actually "start over _from scratch_". Signed-off-by: SZEDER Gábor Signed-off-by: Junio C Hamano diff --git a/Documentation/git-am.txt b/Documentation/git-am.txt index 51297d0..4d37de6 100644 --- a/Documentation/git-am.txt +++ b/Documentation/git-am.txt @@ -173,9 +173,9 @@ aborts in the middle. You can recover from this in one of two ways: the index file to bring it into a state that the patch should have produced. Then run the command with the '--resolved' option. -The command refuses to process new mailboxes while the `.git/rebase-apply` -directory exists, so if you decide to start over from scratch, -run `rm -f -r .git/rebase-apply` before running the command with mailbox +The command refuses to process new mailboxes until the current +operation is finished, so if you decide to start over from scratch, +run `git am --abort` before running the command with mailbox names. Before any patches are applied, ORIG_HEAD is set to the tip of the -- cgit v0.10.2-6-g49f6