{"thread":{"id":"13131","subject":"[PATCH] bisect: squelch \"fatal: ref HEAD not a symref\" misleading message","startedAt":"2008-04-16T02:09:49Z","lastAt":"2008-04-16T02:09:49Z","messageCount":1,"participants":["Christian Couder"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"74514","messageId":"20080416040949.26623e13.chriscool@tuxfamily.org","threadId":"13131","inReplyTo":null,"subject":"[PATCH] bisect: squelch \"fatal: ref HEAD not a symref\" misleading message","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2008-04-16T02:09:49Z","receivedAt":"2008-04-16T02:09:49Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"To get the current HEAD when we start bisecting using for example\n\"git bisect start\", we first try \"git symbolic-ref HEAD\" to get a\nnice name, and if it fails, we fall back to \"git rev-parse\n--verify HEAD\".\n\nThe problem is that when \"git symbolic-ref HEAD\" fails, it\ndisplays \"fatal: ref HEAD not a symref\", so it looks like \"git\nbisect start\" failed and does not accept detached HEAD, even if\nin fact it worked fine.\n\nThis patch adds \"-q\" option to the \"git symbolic-ref\" call to\nget rid of the misleading error message.\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n git-bisect.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\n\tJunio C Hamano wrote:\n\t> Ingo Molnar <mingo@elte.hu> writes:\n\t> >  dione:~/linux-tmp4> git-bisect start\n\t> >  fatal: ref HEAD is not a symbolic ref\n\t> >  won't bisect on seeked tree\n\t> >\n\t> >  #\n\t> >  # Hm. It's not a symbolic ref, and git-bisect just wont do it.\n\t>\n\t> Enough people were unhappy with this historical wart and we stopped\n\t> refusing to \"bisect on seeked tree\" since b577bb9 (Eliminate confusing\n\t> \"won't bisect on seeked tree\" failure, 2008-02-23); you should find it as\n\t> part of the 1.5.5 release.\n\t>\n\t> The disturbing \"fatal: ref HEAD not a symref\" is still there even though\n\t> it should be harmless.  The message should be squelched.\n\n\tHere is a patch to do that.\n\ndiff --git a/git-bisect.sh b/git-bisect.sh\nindex 408775a..a36778d 100755\n--- a/git-bisect.sh\n+++ b/git-bisect.sh\n@@ -66,7 +66,7 @@ bisect_start() {\n \t# Verify HEAD. If we were bisecting before this, reset to the\n \t# top-of-line master first!\n \t#\n-\thead=$(GIT_DIR=\"$GIT_DIR\" git symbolic-ref HEAD) ||\n+\thead=$(GIT_DIR=\"$GIT_DIR\" git symbolic-ref -q HEAD) ||\n \thead=$(GIT_DIR=\"$GIT_DIR\" git rev-parse --verify HEAD) ||\n \tdie \"Bad HEAD - I need a HEAD\"\n \tcase \"$head\" in\n-- \n1.5.5.52.g4aa8\n"}]}