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 <predatoramigo@gmail.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
99d8cc7ce8
commit
53f9e5be94
@ -527,6 +527,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
|
|||||||
ACTION_SHOW_CURRENT_PATCH,
|
ACTION_SHOW_CURRENT_PATCH,
|
||||||
} action = NO_ACTION;
|
} action = NO_ACTION;
|
||||||
int committer_date_is_author_date = 0;
|
int committer_date_is_author_date = 0;
|
||||||
|
int ignore_date = 0;
|
||||||
int ignore_whitespace = 0;
|
int ignore_whitespace = 0;
|
||||||
struct option builtin_rebase_options[] = {
|
struct option builtin_rebase_options[] = {
|
||||||
OPT_STRING(0, "onto", &options.onto_name,
|
OPT_STRING(0, "onto", &options.onto_name,
|
||||||
@ -550,6 +551,8 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
|
|||||||
OPT_BOOL(0, "committer-date-is-author-date",
|
OPT_BOOL(0, "committer-date-is-author-date",
|
||||||
&committer_date_is_author_date,
|
&committer_date_is_author_date,
|
||||||
N_("passed to 'git am'")),
|
N_("passed to 'git am'")),
|
||||||
|
OPT_BOOL(0, "ignore-date", &ignore_date,
|
||||||
|
N_("passed to 'git am'")),
|
||||||
OPT_BIT('f', "force-rebase", &options.flags,
|
OPT_BIT('f', "force-rebase", &options.flags,
|
||||||
N_("cherry-pick all commits, even if unchanged"),
|
N_("cherry-pick all commits, even if unchanged"),
|
||||||
REBASE_FORCE),
|
REBASE_FORCE),
|
||||||
@ -779,6 +782,11 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
|
|||||||
if (ignore_whitespace)
|
if (ignore_whitespace)
|
||||||
strbuf_addstr(&options.git_am_opt, " --ignore-whitespace");
|
strbuf_addstr(&options.git_am_opt, " --ignore-whitespace");
|
||||||
|
|
||||||
|
if (ignore_date) {
|
||||||
|
strbuf_addstr(&options.git_am_opt, " --ignore-date");
|
||||||
|
options.flags |= REBASE_FORCE;
|
||||||
|
}
|
||||||
|
|
||||||
switch (options.type) {
|
switch (options.type) {
|
||||||
case REBASE_MERGE:
|
case REBASE_MERGE:
|
||||||
case REBASE_INTERACTIVE:
|
case REBASE_INTERACTIVE:
|
||||||
|
Loading…
Reference in New Issue
Block a user