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
Subject: Re: [PATCH] rev-parse: fix --verify to error out when passed junk after a good rev
Date: Sat, 26 Apr 2008 23:21:26 -0700	[thread overview]
Message-ID: <7v63u3izrt.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <20080426151929.819ced3e.chriscool@tuxfamily.org> (Christian Couder's message of "Sat, 26 Apr 2008 15:19:29 +0200")

Christian Couder <chriscool@tuxfamily.org> writes:

> Before this patch something like:
>
> $ git rev-parse --verify <good-rev> <junk>
>
> worked whatever junk was as long as <good-rev> could be parsed
> correctly.
>
> This patch makes "git rev-parse --verify" error out when passed
> any junk after a good rev.
>
> Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
> ---
>  builtin-rev-parse.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> 	With this patch something like:
>
> 	$ git rev-parse --verify <good1> <good2>
>
> 	will still fail.

I think this should fail.

I've long thought that ideally giving anything but a single good rev to
"rev-parse --verify" should fail before spitting anything out.  This, like
other reponses to errorneous inputs, were what we considered of lower
priority in early days of git (think "before the end of 2005"), because we
had many other "better and more urgent" things to worry about.  I think we
have long passed that stage.

      reply	other threads:[~2008-04-27  6:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-26 13:19 [PATCH] rev-parse: fix --verify to error out when passed junk after a good rev Christian Couder
2008-04-27  6:21 ` 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=7v63u3izrt.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=chriscool@tuxfamily.org \
    --cc=git@vger.kernel.org \
    /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).