git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Christian Couder <chriscool@tuxfamily.org>
Cc: git@vger.kernel.org, malc@pulsesoft.com
Subject: Re: [PATCH] bisect: improve error message when branch checkout fails
Date: Sun, 05 Apr 2009 02:46:51 -0700	[thread overview]
Message-ID: <7vskknv3ec.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: 20090404220226.58a3ac99.chriscool@tuxfamily.org

Christian Couder <chriscool@tuxfamily.org> writes:

> In "git-bisect.sh" the "git checkout" command is only used to
> change the current branch, but it is used like this:
>
> git checkout "$branch"
>
> which will output the following misleading error message when
> it fails:
>
> error: pathspec 'foo' did not match any file(s) known to git.
>
> This patch change the way we use "git checkout" like this:
>
> git checkout "$branch" --
>
> so that we will get the following error message:
>
> fatal: invalid reference: foo
>
> which is better.

Thanks; will apply.

But I think "git checkout" should either say "unknown branch" (assuming
that most people switch branches, not detach HEAD), or "no such commit"
(which could be a bit confusing for people who have not even heard of
detached HEAD, but may be more technically correct).

"Invalid reference" does not help anybody and is not technically correct,
either.  A git newbie would say "Huh?  what is a ref?" and a git savvy
would say "I admit I made a typo, but you, the git checkout command, are
supposed to take an arbitrary commit object, not necessarily a ref".

      reply	other threads:[~2009-04-05  9:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-04 20:02 [PATCH] bisect: improve error message when branch checkout fails Christian Couder
2009-04-05  9:46 ` Junio C Hamano [this message]

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=7vskknv3ec.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=chriscool@tuxfamily.org \
    --cc=git@vger.kernel.org \
    --cc=malc@pulsesoft.com \
    /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).