All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Igor Djordjevic <igor.d.djordjevic@gmail.com>
Cc: anatoly techtonik <techtonik@gmail.com>, git@vger.kernel.org
Subject: Re: Unify annotated and non-annotated tags
Date: Sat, 11 Nov 2017 11:06:30 +0900	[thread overview]
Message-ID: <xmqqh8u1efh5.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <ec4be1c2-a0cc-cec8-a566-06c11c8abe06@gmail.com> (Igor Djordjevic's message of "Sat, 11 Nov 2017 02:46:39 +0100")

Igor Djordjevic <igor.d.djordjevic@gmail.com> writes:

> If you would like to mimic output of "git show-ref", repeating 
> commits for each tag pointing to it and showing full tag name as 
> well, you could do something like this, for example:
>
> 	for tag in $(git for-each-ref --format="%(refname)" refs/tags)
> 	do
> 		printf '%s %s\n' "$(git rev-parse $tag^0)" "$tag"
> 	done
>
>
> Hope that helps a bit.

If you use for-each-ref's --format option, you could do something
like (pardon a long line):

git for-each-ref --format='%(if)%(*objectname)%(then)%(*objectname)%(else)%(objectname)%(end) %(refname)' refs/tags

without any loop, I would think.



  reply	other threads:[~2017-11-11  2:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=xmqqh8u1efh5.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=igor.d.djordjevic@gmail.com \
    --cc=techtonik@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.