]> granicus.if.org Git - git/commitdiff
Merge branch 'ra/rebase-i-more-options' into pu
authorJunio C Hamano <gitster@pobox.com>
Fri, 25 Oct 2019 06:10:18 +0000 (15:10 +0900)
committerJunio C Hamano <gitster@pobox.com>
Fri, 25 Oct 2019 06:10:18 +0000 (15:10 +0900)
"git rebase -i" learned a few options that are known by "git
rebase" proper.

* ra/rebase-i-more-options:
  rebase: add --reset-author-date
  rebase -i: support --ignore-date
  sequencer: rename amend_author to author_to_rename
  rebase -i: support --committer-date-is-author-date
  sequencer: allow callers of read_author_script() to ignore fields
  rebase -i: add --ignore-whitespace flag

1  2 
Documentation/git-rebase.txt
builtin/rebase.c
sequencer.c
sequencer.h
t/t3422-rebase-incompatible-options.sh

index 639a4179d18e4d154f30351aaa4f3b3c79c48c1e,11137837c2d33290c7470d0db7482a7b150a6ae8..05ba1d331ff59caf47f7bcb7e1e36c0fc95e6aaa
@@@ -387,14 -369,18 +387,22 @@@ ends up being empty, the <upstream> wil
  +
  If either <upstream> or --root is given on the command line, then the
  default is `--no-fork-point`, otherwise the default is `--fork-point`.
 ++
 +If your branch was based on <upstream> but <upstream> was rewound and
 +your branch contains commits which were dropped, this option can be used
 +with `--keep-base` in order to drop those commits from your branch.
  
  --ignore-whitespace::
+       Behaves differently depending on which backend is selected.
+ +
+ 'am' backend: When applying a patch, ignore changes in whitespace in
+ context lines if necessary.
+ +
+ 'interactive' backend: Treat lines with only whitespace changes as
+ unchanged for the sake of a three-way merge.
  --whitespace=<option>::
-       These flag are passed to the 'git apply' program
+       This flag is passed to the 'git apply' program
        (see linkgit:git-apply[1]) that applies the patch.
  +
  See also INCOMPATIBLE OPTIONS below.
@@@ -565,8 -553,12 +575,12 @@@ In addition, the following pairs of opt
   * --preserve-merges and --interactive
   * --preserve-merges and --signoff
   * --preserve-merges and --rebase-merges
 - * --rebase-merges and --strategy
 - * --rebase-merges and --strategy-option
+  * --preserve-merges and --ignore-whitespace
+  * --preserve-merges and --committer-date-is-author-date
+  * --preserve-merges and --ignore-date
 + * --keep-base and --onto
 + * --keep-base and --root
+  * --rebase-merges and --ignore-whitespace
  
  BEHAVIORAL DIFFERENCES
  -----------------------
index f1eb74b3444202c1a6bace26bf642dc173076d27,56e7a44cffc9182f3ffc7b92cd0aeece33ba7dbc..f6c9f57c54b98fb3f99da12e943b36ac46f886b3
@@@ -112,16 -116,20 +116,26 @@@ static struct replay_opts get_replay_op
        replay.allow_empty_message = opts->allow_empty_message;
        replay.verbose = opts->flags & REBASE_VERBOSE;
        replay.reschedule_failed_exec = opts->reschedule_failed_exec;
+       replay.committer_date_is_author_date =
+                                       opts->committer_date_is_author_date;
+       replay.ignore_date = opts->ignore_date;
        replay.gpg_sign = xstrdup_or_null(opts->gpg_sign_opt);
        replay.strategy = opts->strategy;
        if (opts->strategy_opts)
-               parse_strategy_opts(&replay, opts->strategy_opts);
+               strbuf_addstr(&strategy_buf, opts->strategy_opts);
+       if (opts->ignore_whitespace)
+               strbuf_addstr(&strategy_buf, " --ignore-space-change");
+       if (strategy_buf.len)
+               parse_strategy_opts(&replay, strategy_buf.buf);
+       strbuf_release(&strategy_buf);
 +
 +      if (opts->squash_onto) {
 +              oidcpy(&replay.squash_onto, opts->squash_onto);
 +              replay.have_squash_onto = 1;
 +      }
 +
        return replay;
  }
  
@@@ -514,9 -521,11 +528,11 @@@ int cmd_rebase__interactive(int argc, c
        if (argc == 1)
                usage_with_options(builtin_rebase_interactive_usage, options);
  
 -      argc = parse_options(argc, argv, NULL, options,
 +      argc = parse_options(argc, argv, prefix, options,
                        builtin_rebase_interactive_usage, PARSE_OPT_KEEP_ARGV0);
  
+       opts.strategy_opts = xstrdup_or_null(opts.strategy_opts);
        if (!is_null_oid(&squash_onto))
                opts.squash_onto = &squash_onto;
  
@@@ -1870,6 -1870,18 +1899,12 @@@ int cmd_rebase(int argc, const char **a
                              "'--reschedule-failed-exec'"));
        }
  
 -              if (strategy_options.nr)
 -                      die(_("cannot combine '--rebase-merges' with "
 -                            "'--strategy-option'"));
 -              if (options.strategy)
 -                      die(_("cannot combine '--rebase-merges' with "
 -                            "'--strategy'"));
+       if (options.rebase_merges) {
+               if (options.ignore_whitespace)
+                       die(_("cannot combine '--rebase-merges' with "
+                             "'--ignore-whitespace'"));
+       }
        if (!options.root) {
                if (argc < 1) {
                        struct branch *branch;
diff --cc sequencer.c
Simple merge
diff --cc sequencer.h
Simple merge