Git development
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Peter van der Does <peter@ourvirtualhome.com>
Cc: git@vger.kernel.org
Subject: Re: git tag listing order
Date: Tue, 24 Nov 2009 14:00:23 -0500	[thread overview]
Message-ID: <20091124185947.GA24409@coredump.intra.peff.net> (raw)
In-Reply-To: <20091124105609.0980e796@montecarlo.grandprix.int>

On Tue, Nov 24, 2009 at 10:56:09AM -0500, Peter van der Does wrote:

> I'm using git 1.6.5.3 on Ubuntu and was wondering if there is a way to
> list tags in order of when they were added to the tree, instead of
> alphabetical?

You can use for-each-ref with its sort option:

  git for-each-ref --sort=taggerdate --format='%(refname:short)' refs/tags

Though note that unannotated tags will have no taggerdate, and will all
sort to the front of the list. To exclude them, I think you'd have to
use a special format to grep and sort yourself. Something like:

  git for-each-ref \
    --format='%(taggerdate:iso8601) %(refname:short)' refs/tags |
    grep -v '^ ' |
    sort |
    cut -d' ' -f4-

-Peff

  reply	other threads:[~2009-11-24 19:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-24 15:56 git tag listing order Peter van der Does
2009-11-24 19:00 ` Jeff King [this message]
2009-11-24 19:24   ` Peter van der Does

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=20091124185947.GA24409@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=peter@ourvirtualhome.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