Web lists-archives.com

Re: [PATCH 0/5] make interpret-trailers useful for parsing

On Wed, Aug 9, 2017 at 10:19 AM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
> Jeff King <peff@xxxxxxxx> writes:
>> Parsing trailers out of a commit message is _mostly_ easy, but there
>> area a lot of funny corner cases (e.g., heuristics for how many
>> non-trailers must be present before a final paragraph isn't a trailer
>> block anymore).  The code in trailer.c already knows about these corner
>> cases, but there's no way to access it from the command line.
>> This series teaches interpret-trailers to parse and output just the
>> trailers. So now you can do:
>>   $ git log --format=%B -1 8d44797cc91231cd44955279040dc4a1ee0a797f |
>>     git interpret-trailers --parse
>>   Signed-off-by: Hartmut Henkel <henkel@xxxxxxx>
>>   Helped-by: Stefan Beller <sbeller@xxxxxxxxxx>
>>   Signed-off-by: Ralf Thielow <ralf.thielow@xxxxxxxxx>
>>   Acked-by: Matthias Rüster <matthias.ruester@xxxxxxxxx>
> Thank-you, thank-you, thank-you.
> The above example made me wonder if we also want a format specifier
> to do the above without piping, but it turns out that we already
> have "log --format=%(trailers)", so we are good ;-)

I was going to say, I thought we had a way to get trailers for a
commit via the pretty format, since that is what i used in the past.