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

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

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 30, 2007, 12:21 UTC
Message-ID
<7v8x3c8jay.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<200712301158.lBUBwT3r004608@mi1.bluebottle.com>
しらいしななこ  <nanako3@bluebottle.com> writes:
Show 6 quoted lines
>> 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
Previous: しらいしななこNext: Junio C Hamano
Message 25 of 28 in “git rebase -i / git-gui bug”
  1. Bernt HansenDec 20, 2007
  2. Bernt HansenDec 20, 2007
  3. Reallow git-rebase --interactive --continue if commit is unnecessaryShawn O. Pearce, Dec 20, 2007
  4. Junio C HamanoDec 20, 2007
  5. Shawn O. PearceDec 20, 2007
  6. Junio C HamanoDec 20, 2007
  7. Junio C HamanoDec 26, 2007
  8. Johannes SchindelinDec 29, 2007
  9. Matthieu MoyDec 20, 2007
  10. Force new line at end of commit messageBernt Hansen, Dec 24, 2007
  11. Johannes SchindelinDec 24, 2007
  12. Shawn O. PearceDec 25, 2007
  13. Junio C HamanoDec 25, 2007
  14. Bernt HansenDec 26, 2007
  15. Shawn O. PearceDec 27, 2007
  16. git-gui: Make commit log messages end with a newlineBernt Hansen, Dec 28, 2007
  17. Junio C HamanoDec 26, 2007
  18. Johannes SchindelinDec 29, 2007
  19. Junio C HamanoDec 30, 2007
  20. Johannes SchindelinDec 30, 2007
  21. Junio C HamanoDec 30, 2007
  22. Johannes SchindelinDec 30, 2007
  23. Junio C HamanoDec 30, 2007
  24. しらいしななこDec 30, 2007
  25. Junio C HamanoDec 30, 2007
  26. Junio C HamanoDec 30, 2007
  27. Johannes SchindelinDec 30, 2007
  28. Shawn O. PearceDec 25, 2007

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.