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

(no subject)

From
TPTECOB270_Ganesh Pawar <pawarg256@gmail.com>
Date
Aug 21, 2021, 14:40 UTC
Message-ID
<CAAOR--EV5iixus=wY4ukO2VpE6Ktr=XtKB58FDCyUZ0OvqLuAQ@mail.gmail.com>
I'm not sure if this is a bug.
To reproduce:
1. Set the contents of .git/hooks/prepare-commit-msg to this:
```
#!/bin/sh
COMMIT_MSG_FILE=$1

echo "Initial Commit." > "$COMMIT_MSG_FILE" echo "" >> "$COMMIT_MSG_FILE" echo "# Some random comment." >> "$COMMIT_MSG_FILE" ``` Notice the comment being added to the file.

2. Append a commit with the --no-edit flag.
`git commit --amend --no-edit`

The comment ("Some random comment" in this case) is included in the final commit message, but it shouldn't right?

If I don't pass the flag and just save the commit without changing anything, the comment isn't included. Shouldn't this be the case with the --no-edit flag too?

Next: Jeff King
Message 1 of 2 in “”
  1. TECOB270_Ganesh PawarAug 21, 2021
  2. Jeff KingAug 21, 2021

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.