git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] bisect: squelch "fatal: ref HEAD not a symref" misleading message
@ 2008-04-16  2:09 Christian Couder
  0 siblings, 0 replies; only message in thread
From: Christian Couder @ 2008-04-16  2:09 UTC (permalink / raw)
  To: Junio Hamano, Ingo Molnar; +Cc: git

To get the current HEAD when we start bisecting using for example
"git bisect start", we first try "git symbolic-ref HEAD" to get a
nice name, and if it fails, we fall back to "git rev-parse
--verify HEAD".

The problem is that when "git symbolic-ref HEAD" fails, it
displays "fatal: ref HEAD not a symref", so it looks like "git
bisect start" failed and does not accept detached HEAD, even if
in fact it worked fine.

This patch adds "-q" option to the "git symbolic-ref" call to
get rid of the misleading error message.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
 git-bisect.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

	Junio C Hamano wrote:
	> Ingo Molnar <mingo@elte.hu> writes:
	> >  dione:~/linux-tmp4> git-bisect start
	> >  fatal: ref HEAD is not a symbolic ref
	> >  won't bisect on seeked tree
	> >
	> >  #
	> >  # Hm. It's not a symbolic ref, and git-bisect just wont do it.
	>
	> Enough people were unhappy with this historical wart and we stopped
	> refusing to "bisect on seeked tree" since b577bb9 (Eliminate confusing
	> "won't bisect on seeked tree" failure, 2008-02-23); you should find it as
	> part of the 1.5.5 release.
	>
	> The disturbing "fatal: ref HEAD not a symref" is still there even though
	> it should be harmless.  The message should be squelched.

	Here is a patch to do that.

diff --git a/git-bisect.sh b/git-bisect.sh
index 408775a..a36778d 100755
--- a/git-bisect.sh
+++ b/git-bisect.sh
@@ -66,7 +66,7 @@ bisect_start() {
 	# Verify HEAD. If we were bisecting before this, reset to the
 	# top-of-line master first!
 	#
-	head=$(GIT_DIR="$GIT_DIR" git symbolic-ref HEAD) ||
+	head=$(GIT_DIR="$GIT_DIR" git symbolic-ref -q HEAD) ||
 	head=$(GIT_DIR="$GIT_DIR" git rev-parse --verify HEAD) ||
 	die "Bad HEAD - I need a HEAD"
 	case "$head" in
-- 
1.5.5.52.g4aa8

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2008-04-16  2:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-16  2:09 [PATCH] bisect: squelch "fatal: ref HEAD not a symref" misleading message Christian Couder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).