From: Stefan Beller Date: Wed, 09 Aug 2017 17:55:10 GMT Subject: Re: [PATCH 2/5] interpret-trailers: add an option to show only the trailers Message-ID: In-Reply-To: On Wed, Aug 9, 2017 at 10:52 AM, Stefan Beller wrote: > On Wed, Aug 9, 2017 at 5:24 AM, Jeff King wrote: >> In theory it's easy for any reader who wants to parse >> trailers to do so. But there are a lot of subtle corner >> cases around what counts as a trailer, when the trailer >> block begins and ends, etc. Since interpret-trailers already >> has our parsing logic, let's let callers ask it to just >> output the trailers. >> >> They still have to parse the "key: value" lines, but at >> least they can ignore all of the other corner cases. >> >> Signed-off-by: Jeff King >> --- > ... >> +test_expect_success 'only-trailers omits non-trailer in middle of block' ' >> + cat >expected <<-\EOF && >> + Signed-off-by: nobody >> + Signed-off-by: somebody >> + sign: A U Thor >> + EOF >> + git interpret-trailers --only-trailers >actual <<-\EOF && >> + subject >> + >> + it is important that the trailers below are signed-off-by >> + so that they meet the "25% trailers Git knows about" heuristic >> + >> + Signed-off-by: nobody >> + this is not a trailer > > Please see 60ef86a162 (trailer: support values folded to multiple lines, > 2016-10-21), maybe we also want to test for > > VeryLongTrailerKey: long text with spaces and breaking > the line. > > For those parsing the trailer do we unbreak the line? > Such that one line equals one trailer? or is the user of the parsed > output expected to take care of this themselves?\ Nevermind, 4/5 solves that problem.