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

Re: [PATCH] revision: allow pseudo options after --end-of-options

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 12, 2021, 20:09 UTC
Message-ID
<xmqq4kcz47mq.fsf@gitster.g>
In-Reply-To
<YOycOlyqwwWZJ6rH@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 30 quoted lines
> On Mon, Jul 12, 2021 at 11:47:23AM -0700, Junio C Hamano wrote:
>
>> Jeff King <peff@peff.net> writes:
>> 
>> > I don't think fully-qualifying refs is a complete solution, though. The
>> > common use case for --end-of-options is that you're passing along names
>> > from somewhere else, and you don't know how to qualify them. E.g., in:
>> >
>> >   git rev-list --end-of-options "$rev" --
>> >
>> > you need to behave differently if you got "1234abcd" versus "foo" versus
>> > "refs/heads/foo".
>> 
>> I suspect that you can prefix "^^" unconditionally, just like --not
>> can be emulated away by unconditionally prefixing "^".
>
> That would be clever, but I think we only parse a single "^":
>
>   $ git rev-list ^HEAD
>   [no output]
>   $ git rev-list ^^HEAD
>   fatal: bad revision '^^HEAD'
>
>   $ git rev-parse ^HEAD
>   ^d486ca60a51c9cb1fe068803c3f540724e95e83a
>   $ git rev-parse ^^HEAD
>   ^^HEAD
>   fatal: ambiguous argument '^^HEAD': unknown revision or path not in the working tree.
>
> -Peff
;-)  Surprised.
Previous: Jeff KingNext: Jiang Xin
Message 8 of 11 in “revision: allow pseudo options after --end-of-options”
  1. revision: allow pseudo options after --end-of-optionsJiang Xin, Jul 8, 2021
  2. brian m. carlsonJul 8, 2021
  3. Jiang XinJul 9, 2021
  4. brian m. carlsonJul 10, 2021
  5. Jeff KingJul 12, 2021
  6. Junio C HamanoJul 12, 2021
  7. Jeff KingJul 12, 2021
  8. Junio C HamanoJul 12, 2021
  9. Jiang XinJul 13, 2021
  10. Jeff KingJul 13, 2021
  11. Patrick SteinhardtJul 27, 2021

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.