[PATCH v6 0/5] fixup ra/rebase-i-more-options
- From
- Phillip Wood <phillip.wood123@gmail.com>
- Date
- Jul 13, 2020, 10:10 UTC
- Message-ID
- <20200713101045.27335-1-phillip.wood123@gmail.com>
- In-Reply-To
- <20200407141125.30872-1-phillip.wood123@gmail.com>
From: Phillip Wood <phillip.wood@dunelm.org.uk>
Thanks for the comments on the last round, I've modified the controversial conditional in the first patch as suggested by Junio and updated patch 4 as suggested as well
Best Wishes
Phillip
Phillip Wood (2): rebase -i: support --committer-date-is-author-date rebase -i: support --ignore-date
Rohit Ashiwal (3): rebase -i: add --ignore-whitespace flag sequencer: rename amend_author to author_to_free rebase: add --reset-author-date
Documentation/git-rebase.txt | 33 ++++- builtin/rebase.c | 47 +++++-- sequencer.c | 112 ++++++++++++++- sequencer.h | 2 + t/t3422-rebase-incompatible-options.sh | 2 - t/t3436-rebase-more-options.sh | 180 +++++++++++++++++++++++++ 6 files changed, 353 insertions(+), 23 deletions(-) create mode 100755 t/t3436-rebase-more-options.sh
Range-diff against v5:
1: 43ee10d4d5 ! 1: 5bb4226007 rebase -i: add --ignore-whitespace flag
@@ builtin/rebase.c: int cmd_rebase(int argc, const char **argv, const char *prefix
+ if (options.type == REBASE_APPLY) {
+ if (ignore_whitespace)
-+ argv_array_push (&options.git_am_opts,
-+ "--ignore-whitespace");
-+ } else if (ignore_whitespace) {
-+ string_list_append (&strategy_options,
-+ "ignore-space-change");
++ argv_array_push(&options.git_am_opts,
++ "--ignore-whitespace");
++ } else {
++ /* REBASE_MERGE and PRESERVE_MERGES */
++ if (ignore_whitespace) {
++ string_list_append(&strategy_options,
++ "ignore-space-change");
++ }
+ }
+
if (strategy_options.nr) {
2: a2b57df19c ! 2: e5fdb574ed rebase -i: support --committer-date-is-author-date
@@ builtin/rebase.c: int cmd_rebase(int argc, const char **argv, const char *prefix
allow_preemptive_ff = 0;
@@ builtin/rebase.c: int cmd_rebase(int argc, const char **argv, const char *prefix)
if (ignore_whitespace)
- argv_array_push (&options.git_am_opts,
- "--ignore-whitespace");
+ argv_array_push(&options.git_am_opts,
+ "--ignore-whitespace");
+ if (options.committer_date_is_author_date)
+ argv_array_push(&options.git_am_opts,
+ "--committer-date-is-author-date");
- } else if (ignore_whitespace) {
- string_list_append (&strategy_options,
- "ignore-space-change");
+ } else {
+ /* REBASE_MERGE and PRESERVE_MERGES */
+ if (ignore_whitespace) {
## sequencer.c ##
@@ sequencer.c: static GIT_PATH_FUNC(rebase_path_refs_to_delete, "rebase-merge/refs-to-delete")
3: 363a0140ad = 3: cf5c9a2456 sequencer: rename amend_author to author_to_free
4: 46d9e108be ! 4: 0fc90eaff1 rebase -i: support --ignore-date
@@ builtin/rebase.c: int cmd_rebase(int argc, const char **argv, const char *prefix
- OPT_PASSTHRU_ARGV(0, "ignore-date", &options.git_am_opts, NULL,
- N_("passed to 'git am'"), PARSE_OPT_NOARG),
+ OPT_BOOL(0, "ignore-date", &options.ignore_date,
-+ "ignore author date and use current date"),
++ N_("ignore author date and use current date")),
OPT_PASSTHRU_ARGV('C', NULL, &options.git_am_opts, N_("n"),
N_("passed to 'git apply'"), 0),
OPT_BOOL(0, "ignore-whitespace", &ignore_whitespace,
@@ builtin/rebase.c: int cmd_rebase(int argc, const char **argv, const char *prefix
"--committer-date-is-author-date");
+ if (options.ignore_date)
+ argv_array_push(&options.git_am_opts, "--ignore-date");
- } else if (ignore_whitespace) {
- string_list_append (&strategy_options,
- "ignore-space-change");
+ } else {
+ /* REBASE_MERGE and PRESERVE_MERGES */
+ if (ignore_whitespace) {
## sequencer.c ##
@@ sequencer.c: static GIT_PATH_FUNC(rebase_path_refs_to_delete, "rebase-merge/refs-to-delete")
@@ sequencer.c: static const char *author_date_from_env_array(const struct argv_arr
+/* Construct a free()able author string with current time as the author date */
+static char *ignore_author_date(const char *author)
+{
-+ int len = strlen(author);
++ int len;
+ struct ident_split ident;
+ struct strbuf new_author = STRBUF_INIT;
+
-+ if (split_ident_line(&ident, author, len) < 0) {
++ if (split_ident_line(&ident, author, strlen(author)) < 0) {
+ error(_("malformed ident line '%s'"), author);
+ return NULL;
+ }
5: 26d5eefdcb ! 5: 21cf5e5512 rebase: add --reset-author-date
@@ builtin/rebase.c: int cmd_rebase(int argc, const char **argv, const char *prefix
&options.committer_date_is_author_date,
N_("make committer date match author date")),
- OPT_BOOL(0, "ignore-date", &options.ignore_date,
-- "ignore author date and use current date"),
+ OPT_BOOL(0, "reset-author-date", &options.ignore_date,
-+ N_("ignore author date and use current date")),
+ N_("ignore author date and use current date")),
+ OPT_HIDDEN_BOOL(0, "ignore-date", &options.ignore_date,
+ N_("synonym of --reset-author-date")),
OPT_PASSTHRU_ARGV('C', NULL, &options.git_am_opts, N_("n"),-- 2.27.0