Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH] Force new line at end of commit message

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:44:01

しらいしななこ  [off-list ref] writes:
quoted
Heh, I can see that you do not care---the original did not even
add a newline when necessary (and that is why we have this
thread).  Instead you were adding a newline regardless to the
end of the first commit, but not doing so for the other ones.
Aren't you being too harsh on Johannes these days?
Not on purpose, but perhaps I might have been.
Everybody knows that you are capable of rewriting that part in Perl or Python yourself to fix the issue.
I actually have been trying to avoid Perl (let alone Python nor
Ruby) as "rebase -i" is primarily Johannes's bailiwick, and I
had an impression that he avoided them for Windows portability.

Unfortunately, sed does not handle incomplete lines well, at
least portably.  POSIX says very little about it, except that
its input shall be "text files" (i.e. no NUL is allowed, each
line separated with <newline> and with less than {LINE_MAX}
bytes in length), and its default operation shall read each line
less its terminating <newline> and after manipulation spit it
out and immediately follow it with a <newline>.  But a popular
implementation (e.g. GNU) actually does not follow the output
with a <newline> if the input was incomplete line [*1*]

[Footnote]

*1* Otherwise, this would have been a way to add a
missing newline to a file that could end with an incomplete
line:

    $ sed -e '' <$file_that_may_end_with_an_incomplete_line
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help