From: Junio C Hamano <gitster@pobox.com>
To: Oren Levi <orenl@exon-media.com>
Cc: git@vger.kernel.org
Subject: Re: bug: `git commit --verbose` not removing text below scissor-line
Date: Thu, 10 Jul 2025 08:45:37 -0700 [thread overview]
Message-ID: <xmqqecuo82xq.fsf@gitster.g> (raw)
In-Reply-To: <CACpw4KCYrgjCPO6z-czSa=rW+5z5m4Xpy_RSgxEkUGdeMEvULA@mail.gmail.com> (Oren Levi's message of "Thu, 10 Jul 2025 12:07:21 +0300")
Oren Levi <orenl@exon-media.com> writes:
> What did you do before the bug happened? (Steps to reproduce your issue)
> 1. Run `git ci -a`
> 2. Edit COMMIT_EDITMSG (using vscode)
> 3. Save&Close
As you have commit.verbose set, and your "ci" is merely a short-hand
for "commit", this is "git commit -a -v". It should give us a patch
text after a scissors line, that looks like
#
# ------------------------ >8 ------------------------
# Do not modify or remove the line above.
# Everything below it will be ignored.
diff --git c/builtin/fetch.c i/builtin/fetch.c
index d48262bdc7..3267617a54 100644
--- c/builtin/fetch.c
+++ i/builtin/fetch.c
@@ -640,9 +640,6 @@ static struct ref *get_ref_map(struct remote *remote,
return ref_map;
}
Here is what I did as a quick sanity check
$ git checkout --detach HEAD
$ git reset --soft HEAD~23
$ git commit -a -v
and
(1) I do see the "# ---- >8 ----" followed by "# Do not modify or
remove the line above."
(2) after making edit near the top of the file, without touching
anything around the "---- >8 ----" line, saving the file made a
commit.
(3) "git show" does show the patch after the log message, but "git
show -s" or "git cat-file commit HEAD" do not, i.e. "Everything
below is ignored." the message says was true.
so, in short, does not reproduce for me with the info provided.
Since I do not use vscode, my reproduction attempt used an editor
different from it. It is possible that your editor may be mangling
the line that it is not supposed to touch, but that is not something
I can tell.
> Anything else you want to add:
> related config:
> core.editor = code --wait
> commit.verbose = true
> alias.ci = commit
next prev parent reply other threads:[~2025-07-10 15:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-10 9:07 bug: `git commit --verbose` not removing text below scissor-line Oren Levi
2025-07-10 15:45 ` Junio C Hamano [this message]
2025-07-10 17:46 ` Eric Sunshine
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqecuo82xq.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=orenl@exon-media.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).