git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Unify annotated and non-annotated tags
@ 2017-11-10 10:58 anatoly techtonik
  2017-11-11  1:46 ` Igor Djordjevic
  0 siblings, 1 reply; 8+ messages in thread
From: anatoly techtonik @ 2017-11-10 10:58 UTC (permalink / raw)
  To: git

Hi,

It is hard to work with Git tags, because on low level hash
of non-annotated tag is pointing to commit, but hash for
annotated tag is pointing to tag metadata.

On low level that means that there is no way to get commit
hash from tag in a single step. If tag is annotated, you need
to find and parse ^{} string of show-ref, if not, then look for
string without ^{}.

So, why not just make all tags work the same so that every
tag has its own hash and you need to dereference it in the
same way to get commit hash?

This way I could get all commit hashes with just:

    git show-ref --tags -d | grep "\^{}"

or abandon ^{} completely and show commit hashes on -d:

    git show-ref --tags --dereference

-- 
anatoly t.

^ permalink raw reply	[flat|nested] 8+ messages in thread
[parent not found: <201711231458.vANEwUMK048049@elephants.elehost.com>]

end of thread, other threads:[~2017-12-23 13:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-10 10:58 Unify annotated and non-annotated tags anatoly techtonik
2017-11-11  1:46 ` Igor Djordjevic
2017-11-11  2:06   ` Junio C Hamano
2017-11-11  2:50     ` Igor Djordjevic
2017-11-23  7:31     ` anatoly techtonik
2017-12-23 13:33     ` anatoly techtonik
     [not found] <201711231458.vANEwUMK048049@elephants.elehost.com>
2017-11-23 15:08 ` Randall S. Becker
2017-11-23 21:24   ` Thomas Braun
2017-11-24  9:52   ` anatoly techtonik
2017-11-24 10:24     ` Ævar Arnfjörð Bjarmason
2017-12-02 21:26       ` anatoly techtonik
2017-12-03  5:54         ` Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).