git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Feature Request: Passing a number as an option to git tags for displaying latest tags

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Jul 23, 2015, 09:39 UTC
Message-ID
<55B0B667.6000103@drmicha.warpmail.net>
In-Reply-To
<xmqq7fpsroc1.fsf@gitster.dls.corp.google.com>
Junio C Hamano venit, vidit, dixit 22.07.2015 21:20:
Show 35 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
> 
>> The former, sort by "time", is interesting, but you need to define
>> what to do with various corner cases.  For example, some people may
>> have one or more of the following desires:
>>
>>  * My project did not use tags for a long time, and started using it
>>    recently starting from v1.1.0.  The first release only said
>>    "Frotz version 1.0.0" in its commit log message.  I retroactively
>>    did "git tag -s -m 'Frotz 1.1.0' v1.1.0" on that commit.
> 
> Obviously, I meant "git tag -s -m 'Frotz 1.0.0' v1.0.0" here.
> 
>>    In such a case, it is likely that I would want the sorting done
>>    based on the committer date on the underlying commit, not the
>>    tag's tagger date.
>>
>>  * When a bug is found, it is customary in my project to add a
>>    "break-<something>" tag to the commit that introduces the bug
>>    (and "fix-<something>" tag to the commit that fixes it).
>>
>>    When I want to find recently discovered breakages, I want the
>>    tags whose names match "break-*" sorted by tagger dates, not the
>>    underlying commit's committer dates.
> 
> Another use case may be one in which older tags are interesting.  In
> other words, you need to be able to sort in reverse, too.
> 
>> The necessary ordering machinery to do the above already exists in
>> "for-each-ref".  There is a GSoC project that works to unify various
>> features spread across "for-each-ref", "branch -l" and "tag -l" and
>> make them available to all of the three.
> 
> And the above is still true even with reverse-order use case.
> 
While not quite being intended for that purpose,
git log --oneline --decorate --simplify-by-decoration [-n] --tags

(or with a custom format instead of "--oneline --decorate") may come close to what you want.[*]

Michael
[*] As Linus once described it (iirc): oooh, evil. I like it.
Previous: Junio C HamanoNext: Jacob Keller
Message 6 of 10 in “Feature Request: Passing a number as an option to git tags for displaying latest tags”
  1. Halil ÖztürkJul 22, 2015
  2. Jacob KellerJul 22, 2015
  3. Andreas SchwabJul 22, 2015
  4. Junio C HamanoJul 22, 2015
  5. Junio C HamanoJul 22, 2015
  6. Michael J GruberJul 23, 2015
  7. Jacob KellerJul 23, 2015
  8. Junio C HamanoJul 23, 2015
  9. Jacob KellerJul 23, 2015
  10. Junio C HamanoJul 23, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.