Re: [PATCH] show-ref: Allow --head to work with --verify

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

 



And to clarify:

On 2017-01-20 20:26, Vladimir Panteleev wrote:
On 2017-01-20 19:03, Junio C Hamano wrote:
Having said all that, using --verify on HEAD does not make much
sense, because if HEAD is missing in .git/, I do not think Git
considers that directory as a Git repository to begin with.

The behavior of --verify I am interested in is not to check that the ref exists, but to get its SHA1 while avoiding the pattern search. This avoids accidentally matching refs via substring (e.g. "git show-ref --head HEAD" will print HEAD, but also e.g. refs/remotes/origin/HEAD), and for performance reasons (looking up a ref by exact name can be MUCH faster than matching all refs by pattern search, e.g. in one of my projects where I use git as an object store, --verify makes a difference of 21 milliseconds vs. over 5 minutes).

--
Best regards,
 Vladimir



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