{"thread":{"id":"63777","subject":"bug: `git commit --verbose` not removing text below scissor-line","startedAt":"2025-07-10T09:07:34Z","lastAt":"2025-07-10T17:46:51Z","messageCount":3,"participants":["Oren Levi","Junio C Hamano","Eric Sunshine"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"521745","messageId":"CACpw4KCYrgjCPO6z-czSa=rW+5z5m4Xpy_RSgxEkUGdeMEvULA@mail.gmail.com","threadId":"63777","inReplyTo":null,"subject":"bug: `git commit --verbose` not removing text below scissor-line","fromName":"Oren Levi","fromEmail":"orenl@exon-media.com","sentAt":"2025-07-10T09:07:21Z","receivedAt":"2025-07-10T09:07:34Z","isPatch":false,"sender":{"key":"orenl@exon-media.com","avatar":null},"body":"Thank you for filling out a Git bug report!\nPlease answer the following questions to help us understand your issue.\n\nWhat did you do before the bug happened? (Steps to reproduce your issue)\n1. Run `git ci -a`\n2. Edit COMMIT_EDITMSG (using vscode)\n3. Save&Close\n\nWhat did you expect to happen? (Expected behavior)\ngenerated git commit message does not include text below the scissor-line.\n\nWhat happened instead? (Actual behavior)\ngenerated git commit message has the entire text below the\nscissor-line included.\n\nWhat's different between what you expected and what actually happened?\ntext below the scissor-line included in the generated commit message.\n\nAnything else you want to add:\nrelated config:\ncore.editor = code --wait\ncommit.verbose = true\nalias.ci = commit\n\nPlease review the rest of the bug report below.\nYou can delete any lines you don't wish to share.\n\n\n[System Info]\ngit version:\ngit version 2.50.1\ncpu: arm64\nno commit associated with this build\nsizeof-long: 8\nsizeof-size_t: 8\nshell-path: /bin/sh\nfeature: fsmonitor--daemon\nlibcurl: 8.7.1\nzlib: 1.2.12\nSHA-1: SHA1_DC\nSHA-256: SHA256_BLK\nuname: Darwin 24.5.0 Darwin Kernel Version 24.5.0: Tue Apr 22 19:54:25\nPDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T6020 arm64\ncompiler info: clang: 17.0.0 (clang-1700.0.13.3)\nlibc info: no libc information available\n$SHELL (typically, interactive shell): /bin/zsh\n\n\n[Enabled Hooks]\n\n\n-- \n\n________________________________\n\nOren Levi\n"},{"id":"521759","messageId":"xmqqecuo82xq.fsf@gitster.g","threadId":"63777","inReplyTo":"CACpw4KCYrgjCPO6z-czSa=rW+5z5m4Xpy_RSgxEkUGdeMEvULA@mail.gmail.com","subject":"Re: bug: `git commit --verbose` not removing text below scissor-line","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-07-10T15:45:37Z","receivedAt":"2025-07-10T15:45:40Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Oren Levi <orenl@exon-media.com> writes:\n\n> What did you do before the bug happened? (Steps to reproduce your issue)\n> 1. Run `git ci -a`\n> 2. Edit COMMIT_EDITMSG (using vscode)\n> 3. Save&Close\n\nAs you have commit.verbose set, and your \"ci\" is merely a short-hand\nfor \"commit\", this is \"git commit -a -v\".  It should give us a patch\ntext after a scissors line, that looks like\n\n    #\n    # ------------------------ >8 ------------------------\n    # Do not modify or remove the line above.\n    # Everything below it will be ignored.\n    diff --git c/builtin/fetch.c i/builtin/fetch.c\n    index d48262bdc7..3267617a54 100644\n    --- c/builtin/fetch.c\n    +++ i/builtin/fetch.c\n    @@ -640,9 +640,6 @@ static struct ref *get_ref_map(struct remote *remote,\n            return ref_map;\n     }\n\nHere is what I did as a quick sanity check\n\n    $ git checkout --detach HEAD\n    $ git reset --soft HEAD~23\n    $ git commit -a -v\n\nand\n\n (1) I do see the \"# ---- >8 ----\" followed by \"# Do not modify or\n     remove the line above.\"\n\n (2) after making edit near the top of the file, without touching\n     anything around the \"---- >8 ----\" line, saving the file made a\n     commit.\n\n (3) \"git show\" does show the patch after the log message, but \"git\n     show -s\" or \"git cat-file commit HEAD\" do not, i.e. \"Everything\n     below is ignored.\" the message says was true.\n\nso, in short, does not reproduce for me with the info provided.\n\nSince I do not use vscode, my reproduction attempt used an editor\ndifferent from it.  It is possible that your editor may be mangling\nthe line that it is not supposed to touch, but that is not something\nI can tell.\n\n> Anything else you want to add:\n> related config:\n> core.editor = code --wait\n> commit.verbose = true\n> alias.ci = commit\n"},{"id":"521765","messageId":"CAPig+cT_5LhE7caRhviRXZ_U3UUcfxo-d74yOYtep33dYJQ2Uw@mail.gmail.com","threadId":"63777","inReplyTo":"xmqqecuo82xq.fsf@gitster.g","subject":"Re: bug: `git commit --verbose` not removing text below scissor-line","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2025-07-10T17:46:38Z","receivedAt":"2025-07-10T17:46:51Z","isPatch":false,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Thu, Jul 10, 2025 at 11:50 AM Junio C Hamano <gitster@pobox.com> wrote:\n> Oren Levi <orenl@exon-media.com> writes:\n> > What did you do before the bug happened? (Steps to reproduce your issue)\n> > 1. Run `git ci -a`\n> > 2. Edit COMMIT_EDITMSG (using vscode)\n> > 3. Save&Close\n>\n> Here is what I did as a quick sanity check\n>\n>     $ git checkout --detach HEAD\n>     $ git reset --soft HEAD~23\n>     $ git commit -a -v\n>\n> Since I do not use vscode, my reproduction attempt used an editor\n> different from it.  It is possible that your editor may be mangling\n> the line that it is not supposed to touch, but that is not something\n> I can tell.\n\nI don't use vscode either, but I did install it (in a Linux VM) to\ntest this. Like you, I was unable to reproduce the problem using the\nprovided recipe. My attempt was using the factory settings for VScode,\nwhich may be different from the settings used by the OP.\n"}]}