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

Re: [PATCH 2/2] pretty: add merge and exclude options to %(describe)

From
Jeff King <peff@peff.net>
Date
Feb 17, 2021, 18:31 UTC
Message-ID
<YC1hHYeCmC6+heWZ@coredump.intra.peff.net>
In-Reply-To
<b7bd37c4-ab13-0297-da46-716e26de10d6@web.de>
On Sun, Feb 14, 2021 at 11:10:57AM +0100, René Scharfe. wrote:
Show 6 quoted lines
> Allow restricting the tags used by the placeholder %(describe) with the
> options match and exclude.  E.g. the following command describes the
> current commit using official version tags, without those for release
> candidates:
> 
>    $ git log -1 --format='%(describe:match=v[0-9]*,exclude=*rc*)'

An interesting side effect of this series is that it allows remote users asking for archives to fill in this data, too (by using export-subst placeholders). That includes servers allowing "git archive --remote", but also services like GitHub that will run git-archive on behalf of clients.

I wonder what avenues for mischief this provides. Certainly using extra CPU to run git-describe. But I guess also probing at otherwise hidden refs using the match/exclude system (though since it's limited to refs/tags/, that's pretty unlikely).

I present this mostly as an observation, not an objection. Certainly we already have %D which can look at hidden refs. And I strongly suspect that the server-side git-upload-archive does not respect hidden refs when resolving object names in the first place.

Kind of an interesting thought as we extend the formatting language, though. I generally think of them as something that is always under control of caller, but export-subst's $Format$ will come from the repo contents.

-Peff
Previous: René Scharfe.Next: René Scharfe.
Message 10 of 27 in “gitattributes export-subst and software versioning”
  1. Eli SchwartzJan 25, 2021
  2. René ScharfeFeb 8, 2021
  3. Junio C HamanoFeb 8, 2021
  4. Eli SchwartzFeb 9, 2021
  5. Junio C HamanoFeb 9, 2021
  6. René ScharfeFeb 14, 2021
  7. René ScharfeFeb 14, 2021
  8. 1/2 pretty: add %(describe)René Scharfe, Feb 14, 2021
  9. 2/2 pretty: add merge and exclude options to %(describe)René Scharfe., Feb 14, 2021
  10. Jeff KingFeb 17, 2021
  11. René Scharfe.Feb 28, 2021
  12. Ævar Arnfjörð BjarmasonFeb 28, 2021
  13. René Scharfe.Mar 2, 2021
  14. René Scharfe.Mar 6, 2021
  15. Eli SchwartzFeb 16, 2021
  16. Ævar Arnfjörð BjarmasonFeb 16, 2021
  17. René Scharfe.Feb 16, 2021
  18. Junio C HamanoFeb 16, 2021
  19. Ævar Arnfjörð BjarmasonFeb 17, 2021
  20. René Scharfe.Feb 28, 2021
  21. Ævar Arnfjörð BjarmasonFeb 17, 2021
  22. Junio C HamanoFeb 17, 2021
  23. René Scharfe.Feb 28, 2021
  24. René Scharfe.Feb 28, 2021
  25. René Scharfe.Mar 2, 2021
  26. René Scharfe.Mar 2, 2021
  27. René Scharfe.Mar 2, 2021

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.