Skip to content

Commit 4d92452

Browse files
committed
Revert "Merge branch 'ra/rebase-i-more-options'"
This reverts commit 5d9324e, reversing changes made to c58ae96. The topic turns out to be too buggy for real use. cf. <[email protected]>
1 parent 1cf4836 commit 4d92452

File tree

7 files changed

+28
-327
lines changed

7 files changed

+28
-327
lines changed

Documentation/RelNotes/2.25.0.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@ UI, Workflows & Features
5353
or a named file, instead of taking it as the command line
5454
arguments, with the "--pathspec-from-file" option.
5555

56-
* "git rebase -i" learned a few options that are known by "git
57-
rebase" proper.
58-
5956
* "git submodule" learned a subcommand "set-url".
6057

6158
* "git log" family learned "--pretty=reference" that gives the name

Documentation/git-rebase.txt

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -393,31 +393,16 @@ your branch contains commits which were dropped, this option can be used
393393
with `--keep-base` in order to drop those commits from your branch.
394394

395395
--ignore-whitespace::
396-
Behaves differently depending on which backend is selected.
397-
+
398-
'am' backend: When applying a patch, ignore changes in whitespace in
399-
context lines if necessary.
400-
+
401-
'interactive' backend: Treat lines with only whitespace changes as
402-
unchanged for the sake of a three-way merge.
403-
404396
--whitespace=<option>::
405-
This flag is passed to the 'git apply' program
397+
These flag are passed to the 'git apply' program
406398
(see linkgit:git-apply[1]) that applies the patch.
407399
+
408400
See also INCOMPATIBLE OPTIONS below.
409401

410402
--committer-date-is-author-date::
411-
Instead of recording the time the rebased commits are
412-
created as the committer date, reuse the author date
413-
as the committer date. This implies --force-rebase.
414-
415403
--ignore-date::
416-
--reset-author-date::
417-
By default, the author date of the original commit is used
418-
as the author date for the resulting commit. This option
419-
tells Git to use the current timestamp instead and implies
420-
`--force-rebase`.
404+
These flags are passed to 'git am' to easily change the dates
405+
of the rebased commits (see linkgit:git-am[1]).
421406
+
422407
See also INCOMPATIBLE OPTIONS below.
423408

@@ -554,7 +539,10 @@ INCOMPATIBLE OPTIONS
554539

555540
The following options:
556541

542+
* --committer-date-is-author-date
543+
* --ignore-date
557544
* --whitespace
545+
* --ignore-whitespace
558546
* -C
559547

560548
are incompatible with the following options:
@@ -577,9 +565,6 @@ In addition, the following pairs of options are incompatible:
577565
* --preserve-merges and --interactive
578566
* --preserve-merges and --signoff
579567
* --preserve-merges and --rebase-merges
580-
* --preserve-merges and --ignore-whitespace
581-
* --preserve-merges and --committer-date-is-author-date
582-
* --preserve-merges and --ignore-date
583568
* --keep-base and --onto
584569
* --keep-base and --root
585570

builtin/rebase.c

Lines changed: 12 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,8 @@ struct rebase_options {
7979
int allow_rerere_autoupdate;
8080
int keep_empty;
8181
int autosquash;
82-
int ignore_whitespace;
8382
char *gpg_sign_opt;
8483
int autostash;
85-
int committer_date_is_author_date;
86-
int ignore_date;
8784
char *cmd;
8885
int allow_empty_message;
8986
int rebase_merges, rebase_cousins;
@@ -102,7 +99,6 @@ struct rebase_options {
10299

103100
static struct replay_opts get_replay_opts(const struct rebase_options *opts)
104101
{
105-
struct strbuf strategy_buf = STRBUF_INIT;
106102
struct replay_opts replay = REPLAY_OPTS_INIT;
107103

108104
replay.action = REPLAY_INTERACTIVE_REBASE;
@@ -116,20 +112,10 @@ static struct replay_opts get_replay_opts(const struct rebase_options *opts)
116112
replay.allow_empty_message = opts->allow_empty_message;
117113
replay.verbose = opts->flags & REBASE_VERBOSE;
118114
replay.reschedule_failed_exec = opts->reschedule_failed_exec;
119-
replay.committer_date_is_author_date =
120-
opts->committer_date_is_author_date;
121-
replay.ignore_date = opts->ignore_date;
122115
replay.gpg_sign = xstrdup_or_null(opts->gpg_sign_opt);
123116
replay.strategy = opts->strategy;
124-
125117
if (opts->strategy_opts)
126-
strbuf_addstr(&strategy_buf, opts->strategy_opts);
127-
if (opts->ignore_whitespace)
128-
strbuf_addstr(&strategy_buf, " --ignore-space-change");
129-
if (strategy_buf.len)
130-
parse_strategy_opts(&replay, strategy_buf.buf);
131-
132-
strbuf_release(&strategy_buf);
118+
parse_strategy_opts(&replay, opts->strategy_opts);
133119

134120
if (opts->squash_onto) {
135121
oidcpy(&replay.squash_onto, opts->squash_onto);
@@ -531,8 +517,6 @@ int cmd_rebase__interactive(int argc, const char **argv, const char *prefix)
531517
argc = parse_options(argc, argv, prefix, options,
532518
builtin_rebase_interactive_usage, PARSE_OPT_KEEP_ARGV0);
533519

534-
opts.strategy_opts = xstrdup_or_null(opts.strategy_opts);
535-
536520
if (!is_null_oid(&squash_onto))
537521
opts.squash_onto = &squash_onto;
538522

@@ -986,12 +970,6 @@ static int run_am(struct rebase_options *opts)
986970
am.git_cmd = 1;
987971
argv_array_push(&am.args, "am");
988972

989-
if (opts->ignore_whitespace)
990-
argv_array_push(&am.args, "--ignore-whitespace");
991-
if (opts->committer_date_is_author_date)
992-
argv_array_push(&opts->git_am_opts, "--committer-date-is-author-date");
993-
if (opts->ignore_date)
994-
argv_array_push(&opts->git_am_opts, "--ignore-date");
995973
if (opts->action && !strcmp("continue", opts->action)) {
996974
argv_array_push(&am.args, "--resolved");
997975
argv_array_pushf(&am.args, "--resolvemsg=%s", resolvemsg);
@@ -1459,17 +1437,16 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
14591437
PARSE_OPT_NOARG, NULL, REBASE_DIFFSTAT },
14601438
OPT_BOOL(0, "signoff", &options.signoff,
14611439
N_("add a Signed-off-by: line to each commit")),
1462-
OPT_BOOL(0, "committer-date-is-author-date",
1463-
&options.committer_date_is_author_date,
1464-
N_("make committer date match author date")),
1465-
OPT_BOOL(0, "reset-author-date", &options.ignore_date,
1466-
N_("ignore author date and use current date")),
1467-
OPT_HIDDEN_BOOL(0, "ignore-date", &options.ignore_date,
1468-
N_("synonym of --reset-author-date")),
1440+
OPT_PASSTHRU_ARGV(0, "ignore-whitespace", &options.git_am_opts,
1441+
NULL, N_("passed to 'git am'"),
1442+
PARSE_OPT_NOARG),
1443+
OPT_PASSTHRU_ARGV(0, "committer-date-is-author-date",
1444+
&options.git_am_opts, NULL,
1445+
N_("passed to 'git am'"), PARSE_OPT_NOARG),
1446+
OPT_PASSTHRU_ARGV(0, "ignore-date", &options.git_am_opts, NULL,
1447+
N_("passed to 'git am'"), PARSE_OPT_NOARG),
14691448
OPT_PASSTHRU_ARGV('C', NULL, &options.git_am_opts, N_("n"),
14701449
N_("passed to 'git apply'"), 0),
1471-
OPT_BOOL(0, "ignore-whitespace", &options.ignore_whitespace,
1472-
N_("ignore changes in whitespace")),
14731450
OPT_PASSTHRU_ARGV(0, "whitespace", &options.git_am_opts,
14741451
N_("action"), N_("passed to 'git apply'"), 0),
14751452
OPT_BIT('f', "force-rebase", &options.flags,
@@ -1742,13 +1719,11 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
17421719
state_dir_base, cmd_live_rebase, buf.buf);
17431720
}
17441721

1745-
if (options.committer_date_is_author_date ||
1746-
options.ignore_date)
1747-
options.flags |= REBASE_FORCE;
1748-
17491722
for (i = 0; i < options.git_am_opts.argc; i++) {
17501723
const char *option = options.git_am_opts.argv[i], *p;
1751-
if (!strcmp(option, "--whitespace=fix") ||
1724+
if (!strcmp(option, "--committer-date-is-author-date") ||
1725+
!strcmp(option, "--ignore-date") ||
1726+
!strcmp(option, "--whitespace=fix") ||
17521727
!strcmp(option, "--whitespace=strip"))
17531728
options.flags |= REBASE_FORCE;
17541729
else if (skip_prefix(option, "-C", &p)) {

0 commit comments

Comments
 (0)