Given the following example git commit message:
My commit message summary
Some more body in this message...
Signed-off-by: My name <[email protected]>
Issue: MYPROJ-123
I can now parse these 'trailers' (key/value parameters in the footer) with recent Git versions (2.14+) using git interpret-trailers --parse
.
This appears integrated into git-log formatting options as well, e.g.:
git log --format="%h %s %(trailers)"
However, it shows me all trailers, including the line breaks.
Would it be possible to limit this to the value(s) of a single trailer token? Ideally, what I'd like to accomplish is something like this as a git-log line, showing the value of the Issue
token only:
0123abcd My commit message summary MYPROJ-123
git log --format="%h %s %(trailers:key=Issue,valueonly,separator=%x2C )"
– Cherise