From: Christian Couder <chriscool@tuxfamily.org>
To: Junio Hamano <junkio@cox.net>, Ingo Molnar <mingo@elte.hu>
Cc: git@vger.kernel.org
Subject: [PATCH] bisect: squelch "fatal: ref HEAD not a symref" misleading message
Date: Wed, 16 Apr 2008 04:09:49 +0200 [thread overview]
Message-ID: <20080416040949.26623e13.chriscool@tuxfamily.org> (raw)
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
reply other threads:[~2008-04-16 2:05 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080416040949.26623e13.chriscool@tuxfamily.org \
--to=chriscool@tuxfamily.org \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
--cc=mingo@elte.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).