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

[BUG/RFC] cherry-pick adds newline to last line of file

From
Max Kirillov <max@max630.net>
Date
Jun 26, 2014, 09:30 UTC
Message-ID
<CAF7_NFQopk_1xh1OJyOARuXYYcM7MYdqV=tB5nQoZjSJoZZU=Q@mail.gmail.com>
Hi.

If a file does not contain newline in the last line, and the file has changed somewhere in other branch, and the newline has not been not added in that change, when I cherry-pick the commit, the commit does contain the newline in the last line. This sometimes leads to conflict and in general looks unexpected.

Such files are not uncommon nowadays and however bad it is, I think merging and cherry-picking should try to keep is as long as the newline is not added in some of the changes. Are there any option to preserve the absence of the closing newline? Or maybe the commands should preserve it unconditionally?

-- 
Max
Message 1 of 1 in “[BUG/RFC] cherry-pick adds newline to last line of file”
  1. Max KirillovJun 26, 2014

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.