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

Re: [PATCH 9/9] trailer: add tests for "git interpret-trailers"

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 30, 2013, 20:46 UTC
Message-ID
<xmqqk3emqd7a.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20131230202042.GJ27213@leaf>
Josh Triplett <josh@joshtriplett.org> writes:
Show 29 quoted lines
> On Mon, Dec 30, 2013 at 09:19:55AM -0800, Junio C Hamano wrote:
>> Christian Couder <chriscool@tuxfamily.org> writes:
>> 
>> > +# Do not remove trailing spaces below!
>> > +cat >complex_message_trailers <<'EOF'
>> > +Fixes: 
>> > +Acked-by: 
>> > +Reviewed-by: 
>> > +Signed-off-by: 
>> > +EOF
>> 
>> Just a hint.  I think it is far safer and robust over time to do
>> something like this:
>> 
>> 	sed -e 's/ Z$/ /' <<-\EOF
>>         Fixes: Z
>>         Acked-by: Z
>>         EOF
>> 
>> instead of a comment, which can warn human developers but does not
>> do anything to prevent their editors' auto-fix features from kicking
>> in.
>
> This, but for simplicity, since every line needs the trailing space, why
> not just use 's/$/ /' and drop the ' Z' on every line?
>
> </bikeshed>
>
> - Josh Triplett
A few reasons:
 - The "everybody will have a single SP at the end" may or may not
   last forever;
 - With your scheme, if you already had _one_ trailing SPs in the
   input, it would be hard to spot in the source;
 - It makes it visually very clear that we expect a SP after these
   colons.  This is especially true if you replace 'Z' with
   something more readable (e.g. '|').
Previous: Josh TriplettNext: Josh Triplett
Message 14 of 17 in “Add interpret-trailers builtin”
  1. 0/9 Add interpret-trailers builtinChristian Couder, Dec 24, 2013
  2. 1/9 Add data structures and basic functions for commit trailersChristian Couder, Dec 24, 2013
  3. 2/9 trailer: process trailers from file and argumentsChristian Couder, Dec 24, 2013
  4. 3/9 trailer: read and process config informationChristian Couder, Dec 24, 2013
  5. Christian CouderDec 24, 2013
  6. 4/9 trailer: process command line trailer argumentsChristian Couder, Dec 24, 2013
  7. 5/9 strbuf: add strbuf_isspace()Christian Couder, Dec 24, 2013
  8. 6/9 trailer: parse trailers from input fileChristian Couder, Dec 24, 2013
  9. 7/9 trailer: put all the processing together and printChristian Couder, Dec 24, 2013
  10. 8/9 trailer: add interpret-trailers commandChristian Couder, Dec 24, 2013
  11. 9/9 trailer: add tests for "git interpret-trailers"Christian Couder, Dec 24, 2013
  12. Junio C HamanoDec 30, 2013
  13. Josh TriplettDec 30, 2013
  14. Junio C HamanoDec 30, 2013
  15. Josh TriplettDec 30, 2013
  16. Junio C HamanoDec 30, 2013
  17. Josh TriplettDec 30, 2013

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.