Git tag output order is incorrect (IMHO)

8 messages, 4 authors, 2016-06-15 · open the first message on its own page

Git tag output order is incorrect (IMHO)

From: Rahul Bansal <hidden>
Date: 2016-06-15 22:58:12

I am posting here first time, so please excuse me if this is not right place to send something like this.

Please check - http://stackoverflow.com/questions/6091306/can-i-make-git-print-x-y-z-style-tag-names-in-a-sensible-order

And also - https://github.com/gitlabhq/gitlabhq/issues/4565

IMHO "git tag" is expected to show tag-list ordered by versions. 

It may be case, that people do not follow same version numbering convention. Most people after x.9.x increment major version (that is why they may not be affected because of this)

Another option like "git tag --date-asc" can be added which will print tags by creation date. (As long as people do not create backdated tag, this will work).

Thanks,
-Rahul

Re: Git tag output order is incorrect (IMHO)

From: Duy Nguyen <hidden>
Date: 2016-06-15 22:58:12

On Thu, Jul 18, 2013 at 10:27 PM, Rahul Bansal [off-list ref] wrote:
I am posting here first time, so please excuse me if this is not right place to send something like this.

Please check - http://stackoverflow.com/questions/6091306/can-i-make-git-print-x-y-z-style-tag-names-in-a-sensible-order

And also - https://github.com/gitlabhq/gitlabhq/issues/4565

IMHO "git tag" is expected to show tag-list ordered by versions.

It may be case, that people do not follow same version numbering convention. Most people after x.9.x increment major version (that is why they may not be affected because of this)

Another option like "git tag --date-asc" can be added which will print tags by creation date. (As long as people do not create backdated tag, this will work).
Try

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

Re: Git tag output order is incorrect (IMHO)

From: Duy Nguyen <hidden>
Date: 2016-06-15 22:58:12

On Thu, Jul 18, 2013 at 10:51 PM, Duy Nguyen [off-list ref] wrote:
Try

git for-each-ref --sort=committerdate --format='%(refname:short)' refs/tags
And I wondered why it did not seem right. Use this one instead

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

make it --sort=-taggerdate to reverse sort order.
--
Duy

Re: Git tag output order is incorrect (IMHO)

From: Rahul Bansal <hidden>
Date: 2016-06-15 22:58:12

Hi Day,

I am aware of that command as well.

I think `git tag` current default order is string-based sorting. I
felt version-number based sorting and/or create-date based sorting
will be more appropriate.

--
Rahul Bansal | Founder & CEO | rtCamp Solutions Pvt. Ltd.
Skype: rahul286 | Twitter: @rahul286 | Web: http://rtcamp.com/


On Thu, Jul 18, 2013 at 9:21 PM, Duy Nguyen [off-list ref] wrote:
On Thu, Jul 18, 2013 at 10:27 PM, Rahul Bansal [off-list ref]
wrote:
quoted
I am posting here first time, so please excuse me if this is not right
place to send something like this.

Please check -
http://stackoverflow.com/questions/6091306/can-i-make-git-print-x-y-z-style-tag-names-in-a-sensible-order

And also - https://github.com/gitlabhq/gitlabhq/issues/4565

IMHO "git tag" is expected to show tag-list ordered by versions.

It may be case, that people do not follow same version numbering
convention. Most people after x.9.x increment major version (that is why
they may not be affected because of this)

Another option like "git tag --date-asc" can be added which will print
tags by creation date. (As long as people do not create backdated tag, this
will work).
Try

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

Re: Git tag output order is incorrect (IMHO)

From: Rahul Bansal <hidden>
Date: 2016-06-15 22:58:12

Thanks again Duy. :-)

Sorry for misspelling your name in earlier email.
--
Rahul Bansal | Founder & CEO | rtCamp Solutions Pvt. Ltd.
Skype: rahul286 | Twitter: @rahul286 | Web: http://rtcamp.com/


On Thu, Jul 18, 2013 at 9:26 PM, Duy Nguyen [off-list ref] wrote:
On Thu, Jul 18, 2013 at 10:51 PM, Duy Nguyen [off-list ref] wrote:
quoted
Try

git for-each-ref --sort=committerdate --format='%(refname:short)' refs/tags
And I wondered why it did not seem right. Use this one instead

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

make it --sort=-taggerdate to reverse sort order.
--
Duy

Re: Git tag output order is incorrect (IMHO)

From: Duy Nguyen <hidden>
Date: 2016-06-15 22:58:12

On Thu, Jul 18, 2013 at 10:57 PM, Rahul Bansal [off-list ref] wrote:
Hi Day,

I am aware of that command as well.

I think `git tag` current default order is string-based sorting. I
felt version-number based sorting and/or create-date based sorting
will be more appropriate.
ok you mean the _default_ order? What about other non-version tags
(even temporary ones just to mark something then removed)?
--
Duy

Re: Git tag output order is incorrect (IMHO)

From: Felipe Contreras <hidden>
Date: 2016-06-15 22:58:41

On Thu, Jul 18, 2013 at 10:27 AM, Rahul Bansal [off-list ref] wrote:
I am posting here first time, so please excuse me if this is not right place to send something like this.

Please check - http://stackoverflow.com/questions/6091306/can-i-make-git-print-x-y-z-style-tag-names-in-a-sensible-order

And also - https://github.com/gitlabhq/gitlabhq/issues/4565

IMHO "git tag" is expected to show tag-list ordered by versions.

It may be case, that people do not follow same version numbering convention. Most people after x.9.x increment major version (that is why they may not be affected because of this)

Another option like "git tag --date-asc" can be added which will print tags by creation date. (As long as people do not create backdated tag, this will work).
I completely agree, and there was a proposal to an option like this a
long time ago:

http://article.gmane.org/gmane.comp.version-control.git/111032

-- 
Felipe Contreras

Re: Git tag output order is incorrect (IMHO)

From: Phil Hord <hidden>
Date: 2016-06-15 22:58:43

Someone at $work asked me this week how to find the current and
previous tags on his branch so he could generate release notes.  I
just need "last two tags on head in topo-order". I was surprised by
how complicated this turned out to be. I ended up with this:

  git log --decorate=full --pretty=format:'%d' HEAD |
    sed -n -e 's-^.* refs/tags/\(.*\)[ )].*$-\1-p' |
    head -2

Surely there's a cleaner way, right?

Phil



On Sun, Sep 8, 2013 at 6:49 PM, Felipe Contreras
[off-list ref] wrote:
On Thu, Jul 18, 2013 at 10:27 AM, Rahul Bansal [off-list ref] wrote:
quoted
I am posting here first time, so please excuse me if this is not right place to send something like this.

Please check - http://stackoverflow.com/questions/6091306/can-i-make-git-print-x-y-z-style-tag-names-in-a-sensible-order

And also - https://github.com/gitlabhq/gitlabhq/issues/4565

IMHO "git tag" is expected to show tag-list ordered by versions.

It may be case, that people do not follow same version numbering convention. Most people after x.9.x increment major version (that is why they may not be affected because of this)

Another option like "git tag --date-asc" can be added which will print tags by creation date. (As long as people do not create backdated tag, this will work).
I completely agree, and there was a proposal to an option like this a
long time ago:

http://article.gmane.org/gmane.comp.version-control.git/111032

--
Felipe Contreras
--
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help