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
Jacob Keller <jacob.keller@gmail.com>
Date
Jul 23, 2015, 18:12 UTC
Message-ID
<CA+P7+xpy86GMmdtcag4kaxDrB4TrdeQYraabNS0pASdBG+P+OQ@mail.gmail.com>
In-Reply-To
<xmqqd1zipxc3.fsf@gitster.dls.corp.google.com>
On Thu, Jul 23, 2015 at 11:01 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 31 quoted lines
> Jacob Keller <jacob.keller@gmail.com> writes:
>
>> Yep, that's pretty much how a build system I've had to use does it.
>> Sadly, this is quite slow, and I'm not sure if doing it built into the
>> tag via for-each-ref would be faster?
>
> Is the description in "git for-each-ref --help" somehow unreadable?
>
>        An example directly producing formatted text. Show the most
>        recent 3 tagged commits:
>
>            #!/bin/sh
>
>            git for-each-ref --count=3 --sort='-*authordate' \
>            --format='From: %(*authorname) %(*authoremail)
>            Subject: %(*subject)
>            Date: %(*authordate)
>            Ref: %(*refname)
>
>            %(*body)
>            ' 'refs/tags'
>
> If you only need the name of the ref, you can use a lot simpler
> format string, e.g.
>
>     git for-each-ref --count=3 --sort='-*authordate' \
>       --format='%(refname:short)' refs/tags
>
>     git for-each-ref --count=3 --sort='-taggerdate' \
>       --format='%(refname:short)' refs/tags
>

That's significantly better than what this system does, but sadly the team that owns it doesn't exactly understand git. Pretty sure they tend to just use whatever scriptlet they got working, which happens to be based on log... I've tried to help them, but generally hasn't been a successful relationship there.

Regards, Jake

Previous: Junio C HamanoNext: Junio C Hamano
Message 9 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.