git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* bug: `git commit --verbose` not removing text below scissor-line
@ 2025-07-10  9:07 Oren Levi
  2025-07-10 15:45 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Oren Levi @ 2025-07-10  9:07 UTC (permalink / raw)
  To: git

Thank you for filling out a Git bug report!
Please answer the following questions to help us understand your issue.

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

What did you expect to happen? (Expected behavior)
generated git commit message does not include text below the scissor-line.

What happened instead? (Actual behavior)
generated git commit message has the entire text below the
scissor-line included.

What's different between what you expected and what actually happened?
text below the scissor-line included in the generated commit message.

Anything else you want to add:
related config:
core.editor = code --wait
commit.verbose = true
alias.ci = commit

Please review the rest of the bug report below.
You can delete any lines you don't wish to share.


[System Info]
git version:
git version 2.50.1
cpu: arm64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon
libcurl: 8.7.1
zlib: 1.2.12
SHA-1: SHA1_DC
SHA-256: SHA256_BLK
uname: Darwin 24.5.0 Darwin Kernel Version 24.5.0: Tue Apr 22 19:54:25
PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T6020 arm64
compiler info: clang: 17.0.0 (clang-1700.0.13.3)
libc info: no libc information available
$SHELL (typically, interactive shell): /bin/zsh


[Enabled Hooks]


-- 

________________________________

Oren Levi

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: bug: `git commit --verbose` not removing text below scissor-line
  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
  2025-07-10 17:46   ` Eric Sunshine
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2025-07-10 15:45 UTC (permalink / raw)
  To: Oren Levi; +Cc: git

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: bug: `git commit --verbose` not removing text below scissor-line
  2025-07-10 15:45 ` Junio C Hamano
@ 2025-07-10 17:46   ` Eric Sunshine
  0 siblings, 0 replies; 3+ messages in thread
From: Eric Sunshine @ 2025-07-10 17:46 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Oren Levi, git

On Thu, Jul 10, 2025 at 11:50 AM Junio C Hamano <gitster@pobox.com> wrote:
> 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
>
> Here is what I did as a quick sanity check
>
>     $ git checkout --detach HEAD
>     $ git reset --soft HEAD~23
>     $ git commit -a -v
>
> 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.

I don't use vscode either, but I did install it (in a Linux VM) to
test this. Like you, I was unable to reproduce the problem using the
provided recipe. My attempt was using the factory settings for VScode,
which may be different from the settings used by the OP.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-07-10 17:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2025-07-10 17:46   ` Eric Sunshine

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).