Re: Buggy handling of non-canonical ref names

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

 



Michael Haggerty <mhagger@xxxxxxxxxxxx> writes:

> What is the policy about reference names and their canonicalization?

The overall policy has been that we care about well-formed input, and
everything else is "undefined", even though as you found out some of them
try to work sensibly.

>     $ git check-ref-format /foo/bar ; echo $?
>     0
>
>     $ git check-ref-format --print /foo/bar
>     /foo/bar

I think these are bogus. Patches welcome.

> However, creating a reference with such a name is equivalent to creating
> a reference without the leading slash:
>
>     $ git update-ref /foo/bar HEAD
>     $ cat .git/foo/bar
>     ef6cf90ba11dd6205f8b974692d795ea0b1c0bdd
>     $ git branch /bar/baz
>     $ git for-each-ref | grep baz
>     ef6cf90ba11dd6205f8b974692d795ea0b1c0bdd commit refs/heads/bar/baz

These are just examples of "undefined being nice to the user as a bonus".
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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]