aboutsummaryrefslogtreecommitdiff
path: root/builtin/commit.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2026-03-19 09:54:56 -0700
committerJunio C Hamano <gitster@pobox.com>2026-03-19 09:54:56 -0700
commitaccd0e107bb36cbcdb158f8bb19d5bae589294a9 (patch)
tree9c127dab3844830d92aaf884a0f1037d11d5a3c3 /builtin/commit.c
parenta7a079c2c4bc7b269229a6ea6c147b6b2d5b2684 (diff)
parente4f9d6b0ab2e1903765258991a6265599d0007ce (diff)
downloadgit-accd0e107bb36cbcdb158f8bb19d5bae589294a9.tar.xz
Merge branch 'lc/rebase-trailer'
"git rebase" learns "--trailer" command to drive the interpret-trailers machinery. * lc/rebase-trailer: rebase: support --trailer commit, tag: parse --trailer with OPT_STRVEC trailer: append trailers without fork/exec trailer: libify a couple of functions interpret-trailers: refactor create_in_place_tempfile() interpret-trailers: factor trailer rewriting
Diffstat (limited to 'builtin/commit.c')
-rw-r--r--builtin/commit.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/builtin/commit.c b/builtin/commit.c
index 7b23c1f883..02a04f68be 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -1720,7 +1720,8 @@ int cmd_commit(int argc,
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_PASSTHRU_ARGV(0, "trailer", &trailer_args, N_("trailer"), N_("add custom trailer(s)"), PARSE_OPT_NONEG),
+ OPT_STRVEC(0, "trailer", &trailer_args, N_("trailer"),
+ N_("add custom trailer(s)")),
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")),
@@ -1820,6 +1821,9 @@ int cmd_commit(int argc,
argc = parse_and_validate_options(argc, argv, builtin_commit_options,
builtin_commit_usage,
prefix, current_head, &s);
+ if (trailer_args.nr)
+ trailer_config_init();
+
if (verbose == -1)
verbose = (config_commit_verbose < 0) ? 0 : config_commit_verbose;