git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: Patryk Obara <patryk.obara@gmail.com>, Git List <git@vger.kernel.org>
Subject: Re: [PATCH 2/2] commit: fix ending newline for template files
Date: Fri, 29 May 2015 13:17:40 -0700	[thread overview]
Message-ID: <xmqqwpzrb0kb.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <CAPig+cR=Mrgb+-ZZcM6m7AcL25gXYtmEVpO3c23k_UKXPgyQnA@mail.gmail.com> (Eric Sunshine's message of "Thu, 28 May 2015 14:35:22 -0400")

Eric Sunshine <sunshine@sunshineco.com> writes:

> On Thu, May 28, 2015 at 2:22 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> Eric Sunshine <sunshine@sunshineco.com> writes:
>>
>>> Moreover, it lacks justification and explanation of why you consider
>>> the cleanup unnecessary. History [1] indicates that its application to
>>> -F but not -t was intentional.
>>>
>>> [1]: bc92377 (commit: fix ending newline for template files, 2015-05-26)
>>
>> Sorry, but the date of that commit seems to be too new to be
>> considered "history"; I do not seem to have it, either.
>
> Indeed, I somehow botched that. I meant: 8b1ae67 (Do not strip empty
> lines / trailing spaces from a commit message template, 2011-05-08)

Yeah, that was what I had in mind when I read your response.  And
that one is pretty strong in its own opinion on the "issue" that was
brought up by [PATCH 1/2] being discussed, which was:

    git-commit with -t or -F -e uses content of user-supplied file as
    initial value for commit msg in editor. There is no guarantee, that this
    file ends with newline ...

The log message of 8b1ae67 argues:

    Templates should be just that: A form that the user fills out, and forms
    have blanks. If people are attached to not having extra whitespace in the
    editor, they can simply clean up their templates.

in other words, "if your template ends with an incomplete line and
it causes you trouble, then do not do that!".

As a general principle I am OK with that.

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.  If the user specified with the --cleanup option not to
clean-up the result coming back from the editor, then the commented
material needs to be removed in the editor by the user *anyway*, so
one more LF would not make that much of a difference in that case,
either.

So...

  reply	other threads:[~2015-05-29 20:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-26  6:15 [PATCH 0/2] commit -t appends newline after template file Patryk Obara
2015-05-26  6:15 ` [PATCH 1/2] t750*: make tests for commit messages more pedantic Patryk Obara
2015-05-28 13:34   ` Eric Sunshine
2015-05-28 18:55     ` Junio C Hamano
2015-05-26  6:15 ` [PATCH 2/2] commit: fix ending newline for template files Patryk Obara
2015-05-28 14:29   ` Eric Sunshine
2015-05-28 18:22     ` Junio C Hamano
2015-05-28 18:35       ` Eric Sunshine
2015-05-29 20:17         ` Junio C Hamano [this message]
2015-05-29 22:25           ` Eric Sunshine
2015-05-30 11:29             ` Patryk Obara
2015-05-31  2:21               ` Eric Sunshine
2015-05-30 16:59             ` Junio C Hamano
2015-05-28 10:06 ` [PATCH 0/2] commit -t appends newline after template file Patryk Obara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqwpzrb0kb.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=patryk.obara@gmail.com \
    --cc=sunshine@sunshineco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).