* git tag listing order
@ 2009-11-24 15:56 Peter van der Does
2009-11-24 19:00 ` Jeff King
0 siblings, 1 reply; 3+ messages in thread
From: Peter van der Does @ 2009-11-24 15:56 UTC (permalink / raw)
To: git
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?
--
Peter van der Does
GPG key: E77E8E98
Twitter: @petervanderdoes
git Ubuntu Packages:
http://blog.avirtualhome.com/git-packages-for-ubuntu/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: git tag listing order
2009-11-24 15:56 git tag listing order Peter van der Does
@ 2009-11-24 19:00 ` Jeff King
2009-11-24 19:24 ` Peter van der Does
0 siblings, 1 reply; 3+ messages in thread
From: Jeff King @ 2009-11-24 19:00 UTC (permalink / raw)
To: Peter van der Does; +Cc: git
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
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: git tag listing order
2009-11-24 19:00 ` Jeff King
@ 2009-11-24 19:24 ` Peter van der Does
0 siblings, 0 replies; 3+ messages in thread
From: Peter van der Does @ 2009-11-24 19:24 UTC (permalink / raw)
To: git
On Tue, 24 Nov 2009 14:00:23 -0500
Jeff King <peff@peff.net> wrote:
> 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
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
Thanks for the info, just what I was looking for.
--
Peter van der Does
GPG key: E77E8E98
Twitter: @petervanderdoes
git Ubuntu Packages:
http://blog.avirtualhome.com/git-packages-for-ubuntu/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-11-24 19:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-24 15:56 git tag listing order Peter van der Does
2009-11-24 19:00 ` Jeff King
2009-11-24 19:24 ` Peter van der Does
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox