From: Vladimir Panteleev <thecybershadow@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] show-ref: Allow --head to work with --verify
Date: Fri, 20 Jan 2017 20:51:03 +0000 [thread overview]
Message-ID: <cf40c3e4-406d-f39f-ab72-812a88115100@gmail.com> (raw)
In-Reply-To: <1bf9a446-0b00-f27a-4625-0bc8c25356fe@gmail.com>
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
next prev parent reply other threads:[~2017-01-20 20:52 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-20 15:50 [PATCH] show-ref: Allow --head to work with --verify Vladimir Panteleev
2017-01-20 19:03 ` Junio C Hamano
2017-01-20 20:26 ` Vladimir Panteleev
2017-01-20 20:51 ` Vladimir Panteleev [this message]
2017-01-20 22:22 ` Junio C Hamano
2017-01-20 22:31 ` Junio C Hamano
2017-01-20 23:15 ` Junio C Hamano
2017-01-20 22:55 ` Vladimir Panteleev
2017-01-20 23:20 ` Junio C Hamano
2017-01-20 23:29 ` Junio C Hamano
2017-01-21 0:25 ` Vladimir Panteleev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cf40c3e4-406d-f39f-ab72-812a88115100@gmail.com \
--to=thecybershadow@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).