Skip to content

Commit 53f9e5b

Browse files
prertikgitster
authored andcommitted
builtin rebase: support ignore-date option
This commit adds support for `--ignore-date` which is passed to `git am` to easily change the dates of the rebased commits. Signed-off-by: Pratik Karki <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 99d8cc7 commit 53f9e5b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

builtin/rebase.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
527527
ACTION_SHOW_CURRENT_PATCH,
528528
} action = NO_ACTION;
529529
int committer_date_is_author_date = 0;
530+
int ignore_date = 0;
530531
int ignore_whitespace = 0;
531532
struct option builtin_rebase_options[] = {
532533
OPT_STRING(0, "onto", &options.onto_name,
@@ -550,6 +551,8 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
550551
OPT_BOOL(0, "committer-date-is-author-date",
551552
&committer_date_is_author_date,
552553
N_("passed to 'git am'")),
554+
OPT_BOOL(0, "ignore-date", &ignore_date,
555+
N_("passed to 'git am'")),
553556
OPT_BIT('f', "force-rebase", &options.flags,
554557
N_("cherry-pick all commits, even if unchanged"),
555558
REBASE_FORCE),
@@ -779,6 +782,11 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
779782
if (ignore_whitespace)
780783
strbuf_addstr(&options.git_am_opt, " --ignore-whitespace");
781784

785+
if (ignore_date) {
786+
strbuf_addstr(&options.git_am_opt, " --ignore-date");
787+
options.flags |= REBASE_FORCE;
788+
}
789+
782790
switch (options.type) {
783791
case REBASE_MERGE:
784792
case REBASE_INTERACTIVE:

0 commit comments

Comments
 (0)