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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jul 12, 2021 at 11:47:23AM -0700, Junio C Hamano wrote:

> Jeff King <peff@xxxxxxxx> 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



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux