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

Re: [PATCH] rev-parse: fix --resolve-git-dir argument handling

From
John Keeping <john@keeping.me.uk>
Date
Feb 19, 2014, 09:09 UTC
Message-ID
<20140219090948.GD1048@serenity.lan>
In-Reply-To
<xmqqzjlo9ce6.fsf@gitster.dls.corp.google.com>
On Tue, Feb 18, 2014 at 04:25:37PM -0800, Junio C Hamano wrote:
Show 20 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
> 
> > John Keeping <john@keeping.me.uk> writes:
> >
> >> There are two problems here:
> >>
> >> 1) If no argument is provided, then the command segfaults
> >> 2) The argument is not consumed, so there will be excess output
> >>
> >> Fix both of these in one go by restructuring the handler for this
> >> option.
> >>
> >> Reported-by: Daniel Hahler <genml+git-2014@thequod.de>
> >> Signed-off-by: John Keeping <john@keeping.me.uk>
> >> ---
> >
> > Looks sensible; thanks.
> 
> Ehh, I spoke too fast. Don't we already have this queued as a43219f2
> (rev-parse: check i before using argv[i] against argc, 2014-01-28)?

Yes, and it catches more cases than mine. I only checked against master and had missed that when it went past on the list.

Previous: Junio C Hamano
Message 5 of 5 in “Output from "rev-parse --resolve-git-dir" changed: two lines (prints original argument)”
  1. Daniel HahlerFeb 17, 2014
  2. rev-parse: fix --resolve-git-dir argument handlingJohn Keeping, Feb 17, 2014
  3. Junio C HamanoFeb 18, 2014
  4. Junio C HamanoFeb 19, 2014
  5. John KeepingFeb 19, 2014

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.