]> git.ipfire.org Git - thirdparty/git.git/commit
add-patch: document that option J rolls over
authorRené Scharfe <l.s.r@web.de>
Mon, 6 Oct 2025 17:20:31 +0000 (19:20 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 6 Oct 2025 17:51:42 +0000 (10:51 -0700)
commitc309b65a7c8a0dc8a1566ac3587d37d935632e4d
tree0a0bdaa6d684dc019c44498dc24e18842d918557
parent2c3cc43f96f9568d5475e46bd1442c5551129ce8
add-patch: document that option J rolls over

The variable "permitted" is not reset after moving to a different hunk,
so it only accumulates permission and doesn't necessarily reflect those
of the current hunk.  This may be a bug, but is actually useful with the
option J, which can be used at the last hunk to roll over to the first
hunk.  Make this particular behavior official.

Also adjust the error message, as it will only be shown if there's just
a single hunk.

Suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-add.adoc
add-patch.c
t/t3701-add-interactive.sh