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

Re: [Bug] commit-tree shouldn't append an extra newline to commit messages

From
Ross Kabus <rkabus@aerotech.com>
Date
Sep 5, 2017, 20:59 UTC
Message-ID
<CAEVs+zafc_=_xV3pAmFq+wCCc_Ex4HhTOLJBqyDnodVQ+pczBQ@mail.gmail.com>
In-Reply-To
<CAEVs+zZRw3kW0C56NcJNXieCSTOa=uMxg6tDPjU2u+WDzhTLfw@mail.gmail.com>

Gmail mangled that patch of course... Ross Kabus Software Engineer www.aerotech.com | 412-968-2833

On Tue, Sep 5, 2017 at 4:57 PM, Ross Kabus <rkabus@aerotech.com> wrote:
Show 36 quoted lines
> From: Ross Kabus <rkabus@aerotech.com>
> Date: Tue, 5 Sep 2017 13:54:52 -0400
> Subject: [PATCH] commit-tree: don't append a newline with -F
>
> This change makes it such that commit-tree -F never appends a newline
> character to the supplied commit message (either from file or stdin).
>
> Previously, commit-tree -F would always append a newline character to
> the text brought in from file or stdin. This has caused confusion in a
> number of ways:
>   - This is a plumbing command and it is generally expected not to do
>     text cleanup or other niceties.
>   - stdin piping with "-F -" appends a newline but stdin piping without
>     -F does not append a newline (inconsistent).
>   - git-commit has the --cleanup=verbatim option that prevents appending
>     a newline with its -F argument. There is no verbatim counterpart to
>     commit-tree -F (inconsistent).
> ---
>  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: Ross KabusNext: Jeff King
Message 8 of 10 in “[Bug] commit-tree shouldn't append an extra newline to commit messages”
  1. Ross KabusSep 1, 2017
  2. Jeff KingSep 2, 2017
  3. Ross KabusSep 5, 2017
  4. Jeff KingSep 5, 2017
  5. Ross KabusSep 5, 2017
  6. Jeff KingSep 5, 2017
  7. Ross KabusSep 5, 2017
  8. Ross KabusSep 5, 2017
  9. Jeff KingSep 7, 2017
  10. Junio C HamanoSep 5, 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.