Thread (12 messages) flat view 12 messages, 3 authors, 2023-08-08
STALE1128d

[PATCH] am: unify definition of --keep-cr and --no-keep-cr

From: René Scharfe <hidden>
Date: 2023-07-21 12:42:42
Subsystem: the rest · Maintainer: Linus Torvalds

The options --keep-cr and --no-keep-cr set the variable keep_cr to 1 and
0, respectively.  We don't usually define the negative variant
explicitly.  The extra help text only tells users that the option
overrules the config option am.keepcr, which conforms to convention.

So allow --keep-cr to be negated and drop the now redundant definition
of --no-keep-cr for consistency.

Suggested-by: Junio C Hamano <redacted>
Signed-off-by: René Scharfe <redacted>
---
 builtin/am.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/builtin/am.c b/builtin/am.c
index dcb89439b1..a216024e1d 100644
--- a/builtin/am.c
+++ b/builtin/am.c
@@ -2347,12 +2347,9 @@ int cmd_am(int argc, const char **argv, const char *prefix)
 			N_("pass -b flag to git-mailinfo"), KEEP_NON_PATCH),
 		OPT_BOOL('m', "message-id", &state.message_id,
 			N_("pass -m flag to git-mailinfo")),
-		OPT_SET_INT_F(0, "keep-cr", &keep_cr,
+		OPT_SET_INT(0, "keep-cr", &keep_cr,
 			N_("pass --keep-cr flag to git-mailsplit for mbox format"),
-			1, PARSE_OPT_NONEG),
-		OPT_SET_INT_F(0, "no-keep-cr", &keep_cr,
-			N_("do not pass --keep-cr flag to git-mailsplit independent of am.keepcr"),
-			0, PARSE_OPT_NONEG),
+			1),
 		OPT_BOOL('c', "scissors", &state.scissors,
 			N_("strip everything before a scissors line")),
 		OPT_CALLBACK_F(0, "quoted-cr", &state.quoted_cr, N_("action"),
--
2.41.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help