Re: Should Git Tag trailer formatting work?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep 05, 2024 at 10:05:24AM -0600, Brooke Kuhlmann wrote:

> With the recent release of Git 2.46.0, the ability to add trailers to tags was added which is great! However, when attempting to list and format trailer information, I don't see the trailer information display using the following Bash code:
> 
> ``` 
> git tag --list \
>         --color \
>         --format="%(color:yellow)%(refname:short)%(color:reset)|%(taggerdate:short)|%(color:blue)%(color:bold)%(taggername)%(color:reset)|%(subject)|%(trailers:key=Insertions)" \
>         | column -s"|" -t
> ```

This seems to work fine for me. If I do:

  {
	echo "Version 0.0.0"
	echo
	echo "An example."
	echo
	echo "Insertions: 10"
  } >input
  git tag -F input foo

then your example above produces:

  foo  2024-09-06  Jeff King  Version 0.0.0  Insertions: 10

I wonder if the contents of the tag are not exactly as you expect, and
that is fooling the trailer parser (which relies on some heuristics to
find the right spot). Can you show us the output of "git cat-file tag
<some-tag>"? Mine looks like:

  $ git cat-file tag foo
  object af1c73c21ab34cfbdc86da838acacc6e45ccd264
  type commit
  tag foo
  tagger Jeff King <peff@xxxxxxxx> 1725595316 -0400
  
  Version 0.0.0
  
  An example.
  
  Insertions: 10

-Peff




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux