Skip to content

Commit 38dbcef

Browse files
prertikgitster
authored andcommitted
builtin rebase: support --committer-date-is-author-date
This option is simply handed down to `git am` by way of setting the `git_am_opt` variable that is handled by the `git-rebase--am` backend. Signed-off-by: Pratik Karki <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ead98c1 commit 38dbcef

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

builtin/rebase.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
526526
ACTION_EDIT_TODO,
527527
ACTION_SHOW_CURRENT_PATCH,
528528
} action = NO_ACTION;
529+
int committer_date_is_author_date = 0;
529530
struct option builtin_rebase_options[] = {
530531
OPT_STRING(0, "onto", &options.onto_name,
531532
N_("revision"),
@@ -543,6 +544,9 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
543544
PARSE_OPT_NOARG, NULL, REBASE_DIFFSTAT },
544545
OPT_BOOL(0, "signoff", &options.signoff,
545546
N_("add a Signed-off-by: line to each commit")),
547+
OPT_BOOL(0, "committer-date-is-author-date",
548+
&committer_date_is_author_date,
549+
N_("passed to 'git am'")),
546550
OPT_BIT('f', "force-rebase", &options.flags,
547551
N_("cherry-pick all commits, even if unchanged"),
548552
REBASE_FORCE),
@@ -763,6 +767,12 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
763767
if (!(options.flags & REBASE_NO_QUIET))
764768
strbuf_addstr(&options.git_am_opt, " -q");
765769

770+
if (committer_date_is_author_date) {
771+
strbuf_addstr(&options.git_am_opt,
772+
" --committer-date-is-author-date");
773+
options.flags |= REBASE_FORCE;
774+
}
775+
766776
switch (options.type) {
767777
case REBASE_MERGE:
768778
case REBASE_INTERACTIVE:

0 commit comments

Comments
 (0)