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

Re: [PATCH 2/2] commit: fix ending newline for template files

From
Junio C Hamano <gitster@pobox.com>
Date
May 30, 2015, 16:59 UTC
Message-ID
<xmqqfv6eatmt.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CAPig+cTrW9f1TGvpr4KH+EcOsy=FWvGRj6ZQM6nsFyXc15c4qg@mail.gmail.com>
Eric Sunshine <sunshine@sunshineco.com> writes:
Show 20 quoted lines
> On Fri, May 29, 2015 at 4:17 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> By default, we should run clean-up after the editor we spawned gives
>> us the edited result.  Not adding one more LF after the template
>> when it already ends with LF would not hurt, but an extra blank
>> after the template material does not hurt, either, so I am honestly
>> indifferent.
>
> I had a similar reaction. The one salient bit I picked up was that
> Patryk finds it aesthetically offensive[1] when the template ends with
> a comment line, and that comment line does not flow directly into the
> comment lines provided by --status. That is:
>
>     Template line 1
>     # Template line 2
>
>     # Please enter the commit message...
>     # with '#' will be ignored...
>
> [1]: Quoting from the commit message of patch 1/2: "...which is very
> annoying when template ends with line starting with '#'"

As I said in the message you are responding to, I do not think it would hurt if we stopped adding an LF after a template that already ends with LF. I think I am OK with a patch that does so without doing anything else, like changing when clean-up happens, etc.

Previous: Eric SunshineNext: Patryk Obara
Message 13 of 14 in “commit -t appends newline after template file”
  1. 0/2 commit -t appends newline after template filePatryk Obara, May 26, 2015
  2. 1/2 t750*: make tests for commit messages more pedanticPatryk Obara, May 26, 2015
  3. Eric SunshineMay 28, 2015
  4. Junio C HamanoMay 28, 2015
  5. 2/2 commit: fix ending newline for template filesPatryk Obara, May 26, 2015
  6. Eric SunshineMay 28, 2015
  7. Junio C HamanoMay 28, 2015
  8. Eric SunshineMay 28, 2015
  9. Junio C HamanoMay 29, 2015
  10. Eric SunshineMay 29, 2015
  11. Patryk ObaraMay 30, 2015
  12. Eric SunshineMay 31, 2015
  13. Junio C HamanoMay 30, 2015
  14. Patryk ObaraMay 28, 2015

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.