Skip to content

Commit 1f5db32

Browse files
peffgitster
authored andcommitted
tag: mark "--message" option with NONEG
We do not allow "--no-message" to work now, as the option callback returns "-1" when it sees a NULL arg. However, that will cause parse-options to exit(129) without printing anything further, leaving the user confused about what happened. Instead, let's explicitly mark it as PARSE_OPT_NONEG, which will give a useful error message (and print the usual -h output). In theory this could be used to override an earlier "-m", but it's not clear how it would interact with other message options (e.g., would it also clear data read for "-F"?). Since it's already disabled and nobody is asking for it, let's punt on that and just improve the error message. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 403d2ba commit 1f5db32

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

builtin/tag.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,8 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
390390
OPT_GROUP(N_("Tag creation options")),
391391
OPT_BOOL('a', "annotate", &annotate,
392392
N_("annotated tag, needs a message")),
393-
OPT_CALLBACK('m', "message", &msg, N_("message"),
394-
N_("tag message"), parse_msg_arg),
393+
{ OPTION_CALLBACK, 'm', "message", &msg, N_("message"),
394+
N_("tag message"), PARSE_OPT_NONEG, parse_msg_arg },
395395
OPT_FILENAME('F', "file", &msgfile, N_("read message from file")),
396396
OPT_BOOL('e', "edit", &edit_flag, N_("force edit of tag message")),
397397
OPT_BOOL('s', "sign", &opt.sign, N_("annotated and GPG-signed tag")),

0 commit comments

Comments
 (0)