Another revision to keep this thread alive.
Rohit Ashiwal (2):
sequencer: add NULL checks under read_author_script
rebase -i: support --committer-date-is-author-date
Documentation/git-rebase.txt | 7 ++-
builtin/rebase.c | 23 +++++++--
sequencer.c | 62 +++++++++++++++++++++++--
sequencer.h | 1 +
t/t3422-rebase-incompatible-options.sh | 1 -
t/t3431-rebase-options-compatibility.sh | 21 +++++++++
6 files changed, 103 insertions(+), 12 deletions(-)
Range-diff:
1: 6d2a5a382d ! 1: a1bb91fe43 rebase -i: add --ignore-whitespace flag
@@ -85,6 +85,15 @@
OPT_STRING(0, "strategy", &opts.strategy, N_("strategy"),
N_("rebase strategy")),
OPT_STRING(0, "strategy-opts", &opts.strategy_opts,
N_("strategy-opts"),
+@@
+ argc = parse_options(argc, argv, NULL, 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;
+
@@
am.git_cmd = 1;
argv_array_push(&am.args, "am");
2: 3e6a67410c = 2: 597d282fa6 sequencer: add NULL checks under
read_author_script
3: 3d5f2e2960 ! 3: 33cfc0f890 rebase -i: support
--committer-date-is-author-date
@@ -262,14 +262,20 @@
test_cmp expect file
'
-+test_expect_success '--committer-date-is-author-date works with
interactive backend' '
++test_expect_success '--committer-date-is-author-date works with am
backend' '
It is implied that --force-rebase will change the committer date.
We can add a test (somewhere else) that will check so, but that will
be moot IMO.
+ git rebase -f HEAD^ &&
++ git rebase --committer-date-is-author-date HEAD^ &&
+ git cat-file commit HEAD | sed -e "/^\$/q" >head &&
+ sed -ne "/^author /s/.*> //p" head >authortime &&
+ sed -ne "/^committer /s/.*> //p" head >committertime &&
-+ ! test_cmp at ct &&
++ test_cmp authortime committertime
++'
++
++test_expect_success '--committer-date-is-author-date works with
interactive backend' '
++ git rebase -f HEAD^ &&
+ git rebase -i --committer-date-is-author-date HEAD^ &&
+ git cat-file commit HEAD | sed -e "/^\$/q" >head &&
++ sed -ne "/^author /s/.*> //p" head >authortime &&
+ sed -ne "/^committer /s/.*> //p" head >committertime &&
+ test_cmp authortime committertime
+'
--
2.21.0