Re: check_refname_format allows refs with components that begin with -, even though `git tag` does not

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

 



On Tue, Nov 10, 2020 at 12:09:55PM -0800, Junio C Hamano wrote:

> > The best idea I had for a fix is to print names beginning with `-`
> > using the fully-qualified form, such as "refs/tags/-a".  Also, `--`
> > is used as a delimiter in many commands, and can’t be escaped,
> > so disallowing it might be a good idea.
> 
> I do not think there is anything to fix.
> 
> Command line parsers of some commands may have to learn how to
> disambiguate such a strangely named tags and branches, though.  Some
> commands do not know --end-of-options convention, for example.

I think there is at least one thing to fix: rev-parse never learned
about --end-of-options. It also seems to have some weirdness around
"--".

Here's a series which fixes it.

  [1/3]: rev-parse: don't accept options after dashdash
  [2/3]: rev-parse: put all options under the "-" check
  [3/3]: rev-parse: handle --end-of-options

 Documentation/git-rev-parse.txt |   8 ++-
 builtin/rev-parse.c             | 100 ++++++++++++++++++--------------
 t/t1503-rev-parse-verify.sh     |  13 +++++
 t/t1506-rev-parse-diagnosis.sh  |  25 ++++++++
 4 files changed, 99 insertions(+), 47 deletions(-)

-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