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

[PATCH v2] commit-tree: do not complete line in -F input

From
Ross Kabus <rkabus@aerotech.com>
Date
Sep 14, 2017, 17:05 UTC
Message-ID
<20170914170521.8076-1-rkabus@aerotech.com>
In-Reply-To
<xmqqa8260y7g.fsf@gitster.mtv.corp.google.com>

"git commit-tree -F <file>", unlike "cat <file> | git commit-tree" (i.e. feeding the same contents from the standard input), added a missing final newline when the input ended in an incomplete line.

Correct this inconsistency by leaving the incomplete line as-is, as erring on the side of not touching the input is preferable and expected for a plumbing command like "commit-tree".

Signed-off-by: Ross Kabus <rkabus@aerotech.com>
---
Fixed up commit message with feedback from Junio.
 builtin/commit-tree.c | 1 -
 1 file changed, 1 deletion(-)
diff --git a/builtin/commit-tree.c b/builtin/commit-tree.c
index 19e898fa4..2177251e2 100644
--- a/builtin/commit-tree.c
+++ b/builtin/commit-tree.c
@@ -102,7 +102,6 @@ int cmd_commit_tree(int argc, const char **argv, const char *prefix)
 			if (fd && close(fd))
 				die_errno("git commit-tree: failed to close '%s'",
 					  argv[i]);
-			strbuf_complete_line(&buffer);
 			continue;
 		}
 
-- 
2.13.1.windows.2
Previous: Junio C Hamano
Message 5 of 5 in “commit-tree: don't append a newline with -F”
  1. commit-tree: don't append a newline with -FRoss Kabus, Sep 7, 2017
  2. Junio C HamanoSep 8, 2017
  3. Ross KabusSep 8, 2017
  4. Junio C HamanoSep 9, 2017
  5. commit-tree: do not complete line in -F inputRoss Kabus, Sep 14, 2017

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.