]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'zh/commit-trailer'
authorJunio C Hamano <gitster@pobox.com>
Wed, 7 Apr 2021 23:54:08 +0000 (16:54 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 7 Apr 2021 23:54:08 +0000 (16:54 -0700)
"git commit" learned "--trailer <key>[=<value>]" option; together
with the interpret-trailers command, this will make it easier to
support custom trailers.

* zh/commit-trailer:
  commit: add --trailer option

1  2 
Documentation/git-commit.txt
builtin/commit.c

Simple merge
index d5138582187e7a876bcee1cb20b41c45286532f1,4b06672bd07d0d3200f9471bd46b12d3ef866303..55d50a8891b75bc98805ebdf8fd49f85d3935ee1
@@@ -1589,13 -1525,10 +1610,14 @@@ int cmd_commit(int argc, const char **a
                OPT_CALLBACK('m', "message", &message, N_("message"), N_("commit message"), opt_parse_m),
                OPT_STRING('c', "reedit-message", &edit_message, N_("commit"), N_("reuse and edit message from specified commit")),
                OPT_STRING('C', "reuse-message", &use_message, N_("commit"), N_("reuse message from specified commit")),
 -              OPT_STRING(0, "fixup", &fixup_message, N_("commit"), N_("use autosquash formatted message to fixup specified commit")),
 +              /*
 +               * TRANSLATORS: Leave "[(amend|reword):]" as-is,
 +               * and only translate <commit>.
 +               */
 +              OPT_STRING(0, "fixup", &fixup_message, N_("[(amend|reword):]commit"), N_("use autosquash formatted message to fixup or amend/reword specified commit")),
                OPT_STRING(0, "squash", &squash_message, N_("commit"), N_("use autosquash formatted message to squash specified commit")),
                OPT_BOOL(0, "reset-author", &renew_authorship, N_("the commit is authored by me now (used with -C/-c/--amend)")),
+               OPT_CALLBACK_F(0, "trailer", NULL, N_("trailer"), N_("add custom trailer(s)"), PARSE_OPT_NONEG, opt_pass_trailer),
                OPT_BOOL('s', "signoff", &signoff, N_("add a Signed-off-by trailer")),
                OPT_FILENAME('t', "template", &template_file, N_("use specified template file")),
                OPT_BOOL('e', "edit", &edit_flag, N_("force edit of commit")),