]> git.ipfire.org Git - thirdparty/git.git/commit
commit: avoid redundant scissor line with --cleanup=scissors -v
authorJosh Triplett <josh@joshtriplett.org>
Tue, 27 Feb 2024 09:16:09 +0000 (01:16 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 27 Feb 2024 17:40:46 +0000 (09:40 -0800)
commit688a0a751e9ee032be9fb70d7d63220bc85acae1
tree74511084cdb4bc7539b685175b629f63d82e6358
parent0d464a4e6a5a19bd8fbea1deae22d48d14dccb01
commit: avoid redundant scissor line with --cleanup=scissors -v

`git commit --cleanup=scissors -v` prints two scissors lines:
one at the start of the comment lines, and the other right before the
diff. This is redundant, and pushes the diff further down in the user's
editor than it needs to be.

Make wt_status_add_cut_line() remember if it has added a cut line before,
and avoid adding a redundant one.

Add a test for this.

Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/commit.c
t/t7502-commit-porcelain.sh
wt-status.c
wt-status.h