git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] rev-parse: fix --verify to error out when passed junk after a good rev

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 27, 2008, 06:21 UTC
Message-ID
<7v63u3izrt.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<20080426151929.819ced3e.chriscool@tuxfamily.org>
Christian Couder <chriscool@tuxfamily.org> writes:
Show 20 quoted lines
> 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.

Previous: Christian Couder
Message 2 of 2 in “rev-parse: fix --verify to error out when passed junk after a good rev”
  1. rev-parse: fix --verify to error out when passed junk after a good revChristian Couder, Apr 26, 2008
  2. Junio C HamanoApr 27, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.