{"thread":{"id":"55117","subject":"[PATCH 0/7][Outreachy] Improve the 'fixup [-C | -c]' in interactive rebase","startedAt":"2021-02-07T18:19:35Z","lastAt":"2021-02-12T00:21:22Z","messageCount":58,"participants":["Charvi Mendiratta","Eric Sunshine","Phillip Wood","Junio C Hamano","Christian Couder"],"isPatch":true,"patchVersion":1,"patchTotal":7},"messages":[{"id":"416358","messageId":"20210207181439.1178-1-charvi077@gmail.com","threadId":"55117","inReplyTo":null,"subject":"[PATCH 0/7][Outreachy] Improve the 'fixup [-C | -c]' in interactive rebase","fromName":"Charvi Mendiratta","fromEmail":"charvi077@gmail.com","sentAt":"2021-02-07T18:14:33Z","receivedAt":"2021-02-07T18:19:35Z","isPatch":true,"sender":{"key":"charvi077@gmail.com","avatar":"https://avatars.githubusercontent.com/u/32788121?v=4"},"body":"This patch series is build on the top of \"cm/rebase-i\" in the 'next' branch and\nimproves it. It fixup the source code of 'fixup [-C | -c]' command in the\nsequencer, do some fixes in rebase -i, improves the 'fixup_-C' like commands\nin lib-rebase.sh, update the test-script 't3437' and fixes a typo in the\ndocumentation.\n\n(Thanks to Junio C Hamano, Eric Sunshine, Christian Couder and Phillip Wood\nfor the suggestions and guidance for this patch series)\n\nCharvi Mendiratta (7):\n  sequencer: fixup the datatype of the 'flag' argument\n  sequencer: rename a few functions\n  rebase -i: clarify and fix 'fixup -c' rebase-todo help\n  t/lib-rebase: change the implementation of commands with options\n  t3437: fix indendation of the here-doc\n  t/t3437: update the tests\n  doc/rebase -i: fix typo in the documentation of 'fixup' command\n\n Documentation/git-rebase.txt    |   2 +-\n rebase-interactive.c            |   6 +-\n sequencer.c                     |  23 +++---\n t/lib-rebase.sh                 |   8 +-\n t/t3437-rebase-fixup-options.sh | 140 +++++++++++++++++---------------\n 5 files changed, 93 insertions(+), 86 deletions(-)\n\n--\n2.29.0.rc1\n\n"},{"id":"416359","messageId":"20210207181439.1178-2-charvi077@gmail.com","threadId":"55117","inReplyTo":"20210207181439.1178-1-charvi077@gmail.com","subject":"[PATCH 1/7] sequencer: fixup the datatype of the 'flag' argument","fromName":"Charvi Mendiratta","fromEmail":"charvi077@gmail.com","sentAt":"2021-02-07T18:14:34Z","receivedAt":"2021-02-07T18:19:39Z","isPatch":true,"sender":{"key":"charvi077@gmail.com","avatar":"https://avatars.githubusercontent.com/u/32788121?v=4"},"body":"As 'flag' is a combination of bits, so change its datatype from\n'enum todo_item_flags' to 'unsigned'.\n\nMentored-by: Christian Couder <chriscool@tuxfamily.org>\nMentored-by: Phillip Wood <phillip.wood@dunelm.org.uk>\nHelped-by: Eric Sunshine <sunshine@sunshineco.com>\nSigned-off-by: Charvi Mendiratta <charvi077@gmail.com>\n---\n sequencer.c | 7 +++----\n 1 file changed, 3 insertions(+), 4 deletions(-)\n\ndiff --git a/sequencer.c b/sequencer.c\nindex d09ce446b6..f3928cf45c 100644\n--- a/sequencer.c\n+++ b/sequencer.c\n@@ -1744,8 +1744,7 @@ static const char skip_first_commit_msg_str[] = N_(\"The 1st commit message will\n static const char skip_nth_commit_msg_fmt[] = N_(\"The commit message #%d will be skipped:\");\n static const char combined_commit_msg_fmt[] = N_(\"This is a combination of %d commits.\");\n \n-static int check_fixup_flag(enum todo_command command,\n-\t\t\t    enum todo_item_flags flag)\n+static int check_fixup_flag(enum todo_command command, unsigned flag)\n {\n \treturn command == TODO_FIXUP && ((flag & TODO_REPLACE_FIXUP_MSG) ||\n \t\t\t\t\t (flag & TODO_EDIT_FIXUP_MSG));\n@@ -1850,7 +1849,7 @@ static void update_squash_message_for_fixup(struct strbuf *msg)\n \n static int append_squash_message(struct strbuf *buf, const char *body,\n \t\t\t enum todo_command command, struct replay_opts *opts,\n-\t\t\t enum todo_item_flags flag)\n+\t\t\t unsigned flag)\n {\n \tconst char *fixup_msg;\n \tsize_t commented_len = 0, fixup_off;\n@@ -1906,7 +1905,7 @@ static int update_squash_messages(struct repository *r,\n \t\t\t\t  enum todo_command command,\n \t\t\t\t  struct commit *commit,\n \t\t\t\t  struct replay_opts *opts,\n-\t\t\t\t  enum todo_item_flags flag)\n+\t\t\t\t  unsigned flag)\n {\n \tstruct strbuf buf = STRBUF_INIT;\n \tint res = 0;\n-- \n2.29.0.rc1\n\n"},{"id":"416360","messageId":"20210207181439.1178-3-charvi077@gmail.com","threadId":"55117","inReplyTo":"20210207181439.1178-1-charvi077@gmail.com","subject":"[PATCH 2/7] sequencer: rename a few functions","fromName":"Charvi Mendiratta","fromEmail":"charvi077@gmail.com","sentAt":"2021-02-07T18:14:35Z","receivedAt":"2021-02-07T18:19:44Z","isPatch":true,"sender":{"key":"charvi077@gmail.com","avatar":"https://avatars.githubusercontent.com/u/32788121?v=4"},"body":"Rename functions to make them more descriptive and while at it, remove\nunnecessary 'inline' of the skip_fixupish() function.\n\nMentored-by: Christian Couder <chriscool@tuxfamily.org>\nMentored-by: Phillip Wood <phillip.wood@dunelm.org.uk>\nHelped-by: Eric Sunshine <sunshine@sunshineco.com>\nSigned-off-by: Charvi Mendiratta <charvi077@gmail.com>\n---\n sequencer.c | 18 +++++++++---------\n 1 file changed, 9 insertions(+), 9 deletions(-)\n\ndiff --git a/sequencer.c b/sequencer.c\nindex f3928cf45c..abc6d5cdfd 100644\n--- a/sequencer.c\n+++ b/sequencer.c\n@@ -1744,7 +1744,7 @@ static const char skip_first_commit_msg_str[] = N_(\"The 1st commit message will\n static const char skip_nth_commit_msg_fmt[] = N_(\"The commit message #%d will be skipped:\");\n static const char combined_commit_msg_fmt[] = N_(\"This is a combination of %d commits.\");\n \n-static int check_fixup_flag(enum todo_command command, unsigned flag)\n+static int is_fixup_flag(enum todo_command command, unsigned flag)\n {\n \treturn command == TODO_FIXUP && ((flag & TODO_REPLACE_FIXUP_MSG) ||\n \t\t\t\t\t (flag & TODO_EDIT_FIXUP_MSG));\n@@ -1873,7 +1873,7 @@ static int append_squash_message(struct strbuf *buf, const char *body,\n \tstrbuf_addstr(buf, body + commented_len);\n \n \t/* fixup -C after squash behaves like squash */\n-\tif (check_fixup_flag(command, flag) && !seen_squash(opts)) {\n+\tif (is_fixup_flag(command, flag) && !seen_squash(opts)) {\n \t\t/*\n \t\t * We're replacing the commit message so we need to\n \t\t * append the Signed-off-by: trailer if the user\n@@ -1928,7 +1928,7 @@ static int update_squash_messages(struct repository *r,\n \t\t\t    opts->current_fixup_count + 2);\n \t\tstrbuf_splice(&buf, 0, eol - buf.buf, header.buf, header.len);\n \t\tstrbuf_release(&header);\n-\t\tif (check_fixup_flag(command, flag) && !seen_squash(opts))\n+\t\tif (is_fixup_flag(command, flag) && !seen_squash(opts))\n \t\t\tupdate_squash_message_for_fixup(&buf);\n \t} else {\n \t\tstruct object_id head;\n@@ -1951,11 +1951,11 @@ static int update_squash_messages(struct repository *r,\n \t\tstrbuf_addf(&buf, \"%c \", comment_line_char);\n \t\tstrbuf_addf(&buf, _(combined_commit_msg_fmt), 2);\n \t\tstrbuf_addf(&buf, \"\\n%c \", comment_line_char);\n-\t\tstrbuf_addstr(&buf, check_fixup_flag(command, flag) ?\n+\t\tstrbuf_addstr(&buf, is_fixup_flag(command, flag) ?\n \t\t\t      _(skip_first_commit_msg_str) :\n \t\t\t      _(first_commit_msg_str));\n \t\tstrbuf_addstr(&buf, \"\\n\\n\");\n-\t\tif (check_fixup_flag(command, flag))\n+\t\tif (is_fixup_flag(command, flag))\n \t\t\tstrbuf_add_commented_lines(&buf, body, strlen(body));\n \t\telse\n \t\t\tstrbuf_addstr(&buf, body);\n@@ -1968,7 +1968,7 @@ static int update_squash_messages(struct repository *r,\n \t\t\t     oid_to_hex(&commit->object.oid));\n \tfind_commit_subject(message, &body);\n \n-\tif (command == TODO_SQUASH || check_fixup_flag(command, flag)) {\n+\tif (command == TODO_SQUASH || is_fixup_flag(command, flag)) {\n \t\tres = append_squash_message(&buf, body, command, opts, flag);\n \t} else if (command == TODO_FIXUP) {\n \t\tstrbuf_addf(&buf, \"\\n%c \", comment_line_char);\n@@ -5661,7 +5661,7 @@ static int subject2item_cmp(const void *fndata,\n \n define_commit_slab(commit_todo_item, struct todo_item *);\n \n-static inline int skip_fixup_amend_squash(const char *subject, const char **p) {\n+static int skip_fixupish(const char *subject, const char **p) {\n \treturn skip_prefix(subject, \"fixup! \", p) ||\n \t       skip_prefix(subject, \"amend! \", p) ||\n \t       skip_prefix(subject, \"squash! \", p);\n@@ -5725,13 +5725,13 @@ int todo_list_rearrange_squash(struct todo_list *todo_list)\n \t\tformat_subject(&buf, subject, \" \");\n \t\tsubject = subjects[i] = strbuf_detach(&buf, &subject_len);\n \t\tunuse_commit_buffer(item->commit, commit_buffer);\n-\t\tif (skip_fixup_amend_squash(subject, &p)) {\n+\t\tif (skip_fixupish(subject, &p)) {\n \t\t\tstruct commit *commit2;\n \n \t\t\tfor (;;) {\n \t\t\t\twhile (isspace(*p))\n \t\t\t\t\tp++;\n-\t\t\t\tif (!skip_fixup_amend_squash(p, &p))\n+\t\t\t\tif (!skip_fixupish(p, &p))\n \t\t\t\t\tbreak;\n \t\t\t}\n \n-- \n2.29.0.rc1\n\n"},{"id":"416361","messageId":"20210207181439.1178-4-charvi077@gmail.com","threadId":"55117","inReplyTo":"20210207181439.1178-1-charvi077@gmail.com","subject":"[PATCH 3/7] rebase -i: clarify and fix 'fixup -c' rebase-todo help","fromName":"Charvi Mendiratta","fromEmail":"charvi077@gmail.com","sentAt":"2021-02-07T18:14:36Z","receivedAt":"2021-02-07T18:19:53Z","isPatch":true,"sender":{"key":"charvi077@gmail.com","avatar":"https://avatars.githubusercontent.com/u/32788121?v=4"},"body":"When `-c` says \"edit the commit message\" it's not clear what will be\nedited. The original's commit message or the replacement's message or a\ncombination of the two. Word it such that it states more precisely what\nexactly will be edited and also remove the use of a period and\ncapitalized word in the to-do help text.\n\nMentored-by: Christian Couder <chriscool@tuxfamily.org>\nMentored-by: Phillip Wood <phillip.wood@dunelm.org.uk>\nHelped-by: Eric Sunshine <sunshine@sunshineco.com>\nSigned-off-by: Charvi Mendiratta <charvi077@gmail.com>\n---\n rebase-interactive.c | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/rebase-interactive.c b/rebase-interactive.c\nindex c3bd02adee..e85994beb6 100644\n--- a/rebase-interactive.c\n+++ b/rebase-interactive.c\n@@ -45,8 +45,8 @@ void append_todo_help(int command_count,\n \"e, edit <commit> = use commit, but stop for amending\\n\"\n \"s, squash <commit> = use commit, but meld into previous commit\\n\"\n \"f, fixup [-C | -c] <commit> = like \\\"squash\\\", but discard this\\n\"\n-\"                   commit's log message. Use -C to replace with this\\n\"\n-\"                   commit message or -c to edit the commit message\\n\"\n+\"                   commit's log message; use -C to replace with this\\n\"\n+\"                   commit message or -c to edit this commit message\\n\"\n \"x, exec <command> = run command (the rest of the line) using shell\\n\"\n \"b, break = stop here (continue rebase later with 'git rebase --continue')\\n\"\n \"d, drop <commit> = remove commit\\n\"\n@@ -55,7 +55,7 @@ void append_todo_help(int command_count,\n \"m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]\\n\"\n \".       create a merge commit using the original merge commit's\\n\"\n \".       message (or the oneline, if no original merge commit was\\n\"\n-\".       specified). Use -c <commit> to reword the commit message.\\n\"\n+\".       specified); use -c <commit> to reword the commit message\\n\"\n \"\\n\"\n \"These lines can be re-ordered; they are executed from top to bottom.\\n\");\n \tunsigned edit_todo = !(shortrevisions && shortonto);\n-- \n2.29.0.rc1\n\n"},{"id":"416362","messageId":"20210207181439.1178-8-charvi077@gmail.com","threadId":"55117","inReplyTo":"20210207181439.1178-1-charvi077@gmail.com","subject":"[PATCH 7/7] doc/rebase -i: fix typo in the documentation of 'fixup' command","fromName":"Charvi Mendiratta","fromEmail":"charvi077@gmail.com","sentAt":"2021-02-07T18:14:40Z","receivedAt":"2021-02-07T18:20:40Z","isPatch":true,"sender":{"key":"charvi077@gmail.com","avatar":"https://avatars.githubusercontent.com/u/32788121?v=4"},"body":"Mentored-by: Christian Couder <chriscool@tuxfamily.org>\nMentored-by: Phillip Wood <phillip.wood@dunelm.org.uk>\nHelped-by: Eric Sunshine <sunshine@sunshineco.com>\nSigned-off-by: Charvi Mendiratta <charvi077@gmail.com>\n---\n Documentation/git-rebase.txt | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt\nindex a6903419c4..8bfa5a9272 100644\n--- a/Documentation/git-rebase.txt\n+++ b/Documentation/git-rebase.txt\n@@ -894,7 +894,7 @@ is used.  In that case the suggested commit message is only the message\n of the \"fixup -c\" commit, and an editor is opened allowing you to edit\n the message.  The contents (patch) of the \"fixup -c\" commit are still\n incorporated into the folded commit. If there is more than one \"fixup -c\"\n-commit, the message from the last last one is used.  You can also use\n+commit, the message from the final one is used.  You can also use\n \"fixup -C\" to get the same behavior as \"fixup -c\" except without opening\n an editor.\n \n-- \n2.29.0.rc1\n\n"},{"id":"416364","messageId":"20210207181439.1178-6-charvi077@gmail.com","threadId":"55117","inReplyTo":"20210207181439.1178-1-charvi077@gmail.com","subject":"[PATCH 5/7] t3437: fix indendation of the here-doc","fromName":"Charvi Mendiratta","fromEmail":"charvi077@gmail.com","sentAt":"2021-02-07T18:14:38Z","receivedAt":"2021-02-07T18:20:40Z","isPatch":true,"sender":{"key":"charvi077@gmail.com","avatar":"https://avatars.githubusercontent.com/u/32788121?v=4"},"body":"In the test scripts, the here-doc body and EOF are indented the same\namount as the command which opened the here-doc. Let's remove\none level of indendation.\n\nOriginal-patch-by: Phillip Wood <phillip.wood@dunelm.org.uk>\nMentored-by: Christian Couder <chriscool@tuxfamily.org>\nMentored-by: Phillip Wood <phillip.wood@dunelm.org.uk>\nHelped-by: Eric Sunshine <sunshine@sunshineco.com>\nSigned-off-by: Charvi Mendiratta <charvi077@gmail.com>\n---\n t/t3437-rebase-fixup-options.sh | 62 ++++++++++++++++-----------------\n 1 file changed, 31 insertions(+), 31 deletions(-)\n\ndiff --git a/t/t3437-rebase-fixup-options.sh b/t/t3437-rebase-fixup-options.sh\nindex 36dee15c4b..3de899f68a 100755\n--- a/t/t3437-rebase-fixup-options.sh\n+++ b/t/t3437-rebase-fixup-options.sh\n@@ -38,13 +38,13 @@ get_author () {\n \n test_expect_success 'setup' '\n \tcat >message <<-EOF &&\n-\t\tamend! B\n-\t\t${EMPTY}\n-\t\tnew subject\n-\t\t${EMPTY}\n-\t\tnew\n-\t\tbody\n-\t\tEOF\n+\tamend! B\n+\t${EMPTY}\n+\tnew subject\n+\t${EMPTY}\n+\tnew\n+\tbody\n+\tEOF\n \n \tsed \"1,2d\" message >expected-message &&\n \n@@ -70,38 +70,38 @@ test_expect_success 'setup' '\n \tgit commit --fixup=HEAD -a &&\n \ttest_tick &&\n \tgit commit --allow-empty -F - <<-EOF &&\n-\t\tamend! B\n-\t\t${EMPTY}\n-\t\tB\n-\t\t${EMPTY}\n-\t\tedited 1\n-\t\tEOF\n+\tamend! B\n+\t${EMPTY}\n+\tB\n+\t${EMPTY}\n+\tedited 1\n+\tEOF\n \ttest_tick &&\n \tgit commit --allow-empty -F - <<-EOF &&\n-\t\tamend! amend! B\n-\t\t${EMPTY}\n-\t\tB\n-\t\t${EMPTY}\n-\t\tedited 1\n-\t\t${EMPTY}\n-\t\tedited 2\n-\t\tEOF\n+\tamend! amend! B\n+\t${EMPTY}\n+\tB\n+\t${EMPTY}\n+\tedited 1\n+\t${EMPTY}\n+\tedited 2\n+\tEOF\n \techo B2 >B &&\n \ttest_tick &&\n \tFAKE_COMMIT_AMEND=\"edited squash\" git commit --squash=HEAD -a &&\n \techo B3 >B &&\n \ttest_tick &&\n \tgit commit -a -F - <<-EOF &&\n-\t\tamend! amend! amend! B\n-\t\t${EMPTY}\n-\t\tB\n-\t\t${EMPTY}\n-\t\tedited 1\n-\t\t${EMPTY}\n-\t\tedited 2\n-\t\t${EMPTY}\n-\t\tedited 3\n-\t\tEOF\n+\tamend! amend! amend! B\n+\t${EMPTY}\n+\tB\n+\t${EMPTY}\n+\tedited 1\n+\t${EMPTY}\n+\tedited 2\n+\t${EMPTY}\n+\tedited 3\n+\tEOF\n \n \tGIT_AUTHOR_NAME=\"Rebase Author\" &&\n \tGIT_AUTHOR_EMAIL=\"rebase.author@example.com\" &&\n-- \n2.29.0.rc1\n\n"},{"id":"416365","messageId":"20210207181439.1178-5-charvi077@gmail.com","threadId":"55117","inReplyTo":"20210207181439.1178-1-charvi077@gmail.com","subject":"[PATCH 4/7] t/lib-rebase: change the implementation of commands with options","fromName":"Charvi Mendiratta","fromEmail":"charvi077@gmail.com","sentAt":"2021-02-07T18:14:37Z","receivedAt":"2021-02-07T18:20:40Z","isPatch":true,"sender":{"key":"charvi077@gmail.com","avatar":"https://avatars.githubusercontent.com/u/32788121?v=4"},"body":"\"fixup\" and \"merge\" mirrors the implementation of FAKE_LINES handling of\n\"exec\", but the cases are quite different. The argument to \"exec\" is\narbitrary and can have any number of spaces embedded in it, which\nconflicts with the meaning of spaces in FAKE_LINES, which separate the\nindividual commands in FAKE_LINES. Consequently, \"_\" was chosen as a\nplaceholder in \"exec\" to mean \"space\".\n\nHowever, \"fixup\" is very different from \"exec\". Its arguments are not\narbitrary at all, so there isn't a good reason to mirror the choice of\n\"_\" to represent a space, which leads to rather unsightly tokens such\nas \"fixup_-C\". Let's replace it with simpler tokens such as \"fixup-C\"\nand \"fixup-c\".\n\nMentored-by: Christian Couder <chriscool@tuxfamily.org>\nMentored-by: Phillip Wood <phillip.wood@dunelm.org.uk>\nHelped-by: Eric Sunshine <sunshine@sunshineco.com>\nSigned-off-by: Charvi Mendiratta <charvi077@gmail.com>\n---\n t/lib-rebase.sh                 |  8 ++++----\n t/t3437-rebase-fixup-options.sh | 18 +++++++++---------\n 2 files changed, 13 insertions(+), 13 deletions(-)\n\ndiff --git a/t/lib-rebase.sh b/t/lib-rebase.sh\nindex e10e38060b..e6bd295c05 100644\n--- a/t/lib-rebase.sh\n+++ b/t/lib-rebase.sh\n@@ -15,8 +15,8 @@\n #       specified line.\n #\n #   \"<cmd> <lineno>\" -- add a line with the specified command\n-#       (\"pick\", \"squash\", \"fixup\", \"edit\", \"reword\" or \"drop\") and the\n-#       SHA1 taken from the specified line.\n+#      (\"pick\", \"squash\", \"fixup\"|\"fixup-C\"|\"fixup-c\", \"edit\", \"reword\" or \"drop\")\n+#      and the SHA1 taken from the specified line.\n #\n #   \"exec_cmd_with_args\" -- add an \"exec cmd with args\" line.\n #\n@@ -53,8 +53,8 @@ set_fake_editor () {\n \t\t\taction=\"$line\";;\n \t\texec_*|x_*|break|b)\n \t\t\techo \"$line\" | sed 's/_/ /g' >> \"$1\";;\n-\t\tmerge_*|fixup_*)\n-\t\t\taction=$(echo \"$line\" | sed 's/_/ /g');;\n+\t\tmerge-*|fixup-*)\n+\t\t\taction=$(echo \"$line\" | sed 's/-/ -/');;\n \t\t\"#\")\n \t\t\techo '# comment' >> \"$1\";;\n \t\t\">\")\ndiff --git a/t/t3437-rebase-fixup-options.sh b/t/t3437-rebase-fixup-options.sh\nindex 945df2555b..36dee15c4b 100755\n--- a/t/t3437-rebase-fixup-options.sh\n+++ b/t/t3437-rebase-fixup-options.sh\n@@ -112,7 +112,7 @@ test_expect_success 'setup' '\n test_expect_success 'simple fixup -C works' '\n \ttest_when_finished \"test_might_fail git rebase --abort\" &&\n \tgit checkout --detach A2 &&\n-\tFAKE_LINES=\"1 fixup_-C 2\" git rebase -i B &&\n+\tFAKE_LINES=\"1 fixup-C 2\" git rebase -i B &&\n \ttest_cmp_rev HEAD^ B &&\n \ttest_cmp_rev HEAD^{tree} A2^{tree} &&\n \ttest_commit_message HEAD -m \"A2\"\n@@ -123,7 +123,7 @@ test_expect_success 'simple fixup -c works' '\n \tgit checkout --detach A2 &&\n \tgit log -1 --pretty=format:%B >expected-fixup-message &&\n \ttest_write_lines \"\" \"Modified A2\" >>expected-fixup-message &&\n-\tFAKE_LINES=\"1 fixup_-c 2\" \\\n+\tFAKE_LINES=\"1 fixup-c 2\" \\\n \t\tFAKE_COMMIT_AMEND=\"Modified A2\" \\\n \t\tgit rebase -i B &&\n \ttest_cmp_rev HEAD^ B &&\n@@ -134,7 +134,7 @@ test_expect_success 'simple fixup -c works' '\n test_expect_success 'fixup -C removes amend! from message' '\n \ttest_when_finished \"test_might_fail git rebase --abort\" &&\n \tgit checkout --detach A1 &&\n-\tFAKE_LINES=\"1 fixup_-C 2\" git rebase -i A &&\n+\tFAKE_LINES=\"1 fixup-C 2\" git rebase -i A &&\n \ttest_cmp_rev HEAD^ A &&\n \ttest_cmp_rev HEAD^{tree} A1^{tree} &&\n \ttest_commit_message HEAD expected-message &&\n@@ -145,7 +145,7 @@ test_expect_success 'fixup -C removes amend! from message' '\n test_expect_success 'fixup -C with conflicts gives correct message' '\n \ttest_when_finished \"test_might_fail git rebase --abort\" &&\n \tgit checkout --detach A1 &&\n-\ttest_must_fail env FAKE_LINES=\"1 fixup_-C 2\" git rebase -i conflicts &&\n+\ttest_must_fail env FAKE_LINES=\"1 fixup-C 2\" git rebase -i conflicts &&\n \tgit checkout --theirs -- A &&\n \tgit add A &&\n \tFAKE_COMMIT_AMEND=edited git rebase --continue &&\n@@ -160,7 +160,7 @@ test_expect_success 'fixup -C with conflicts gives correct message' '\n test_expect_success 'skipping fixup -C after fixup gives correct message' '\n \ttest_when_finished \"test_might_fail git rebase --abort\" &&\n \tgit checkout --detach A3 &&\n-\ttest_must_fail env FAKE_LINES=\"1 fixup 2 fixup_-C 4\" git rebase -i A &&\n+\ttest_must_fail env FAKE_LINES=\"1 fixup 2 fixup-C 4\" git rebase -i A &&\n \tgit reset --hard &&\n \tFAKE_COMMIT_AMEND=edited git rebase --continue &&\n \ttest_commit_message HEAD -m \"B\"\n@@ -168,7 +168,7 @@ test_expect_success 'skipping fixup -C after fixup gives correct message' '\n \n test_expect_success 'sequence of fixup, fixup -C & squash --signoff works' '\n \tgit checkout --detach branch &&\n-\tFAKE_LINES=\"1 fixup 2 fixup_-C 3 fixup_-C 4 squash 5 fixup_-C 6\" \\\n+\tFAKE_LINES=\"1 fixup 2 fixup-C 3 fixup-C 4 squash 5 fixup-C 6\" \\\n \t\tFAKE_COMMIT_AMEND=squashed \\\n \t\tFAKE_MESSAGE_COPY=actual-squash-message \\\n \t\tgit -c commit.status=false rebase -ik --signoff A &&\n@@ -182,7 +182,7 @@ test_expect_success 'first fixup -C commented out in sequence fixup fixup -C fix\n \ttest_when_finished \"test_might_fail git rebase --abort\" &&\n \tgit checkout branch && git checkout --detach branch~2 &&\n \tgit log -1 --pretty=format:%b >expected-message &&\n-\tFAKE_LINES=\"1 fixup 2 fixup_-C 3 fixup_-C 4\" git rebase -i A &&\n+\tFAKE_LINES=\"1 fixup 2 fixup-C 3 fixup-C 4\" git rebase -i A &&\n \ttest_cmp_rev HEAD^ A &&\n \ttest_commit_message HEAD expected-message\n '\n@@ -192,7 +192,7 @@ test_expect_success 'multiple fixup -c opens editor once' '\n \tgit checkout --detach A3 &&\n \tbase=$(git rev-parse HEAD~4) &&\n \tFAKE_COMMIT_MESSAGE=\"Modified-A3\" \\\n-\t\tFAKE_LINES=\"1 fixup_-C 2 fixup_-c 3 fixup_-c 4\" \\\n+\t\tFAKE_LINES=\"1 fixup-C 2 fixup-c 3 fixup-c 4\" \\\n \t\tEXPECT_HEADER_COUNT=4 \\\n \t\tgit rebase -i $base &&\n \ttest_cmp_rev $base HEAD^ &&\n@@ -202,7 +202,7 @@ test_expect_success 'multiple fixup -c opens editor once' '\n test_expect_success 'sequence squash, fixup & fixup -c gives combined message' '\n \ttest_when_finished \"test_might_fail git rebase --abort\" &&\n \tgit checkout --detach A3 &&\n-\tFAKE_LINES=\"1 squash 2 fixup 3 fixup_-c 4\" \\\n+\tFAKE_LINES=\"1 squash 2 fixup 3 fixup-c 4\" \\\n \t\tFAKE_MESSAGE_COPY=actual-combined-message \\\n \t\tgit -c commit.status=false rebase -i A &&\n \ttest_i18ncmp \"$TEST_DIRECTORY/t3437/expected-combined-message\" \\\n-- \n2.29.0.rc1\n\n"},{"id":"416366","messageId":"20210207181439.1178-7-charvi077@gmail.com","threadId":"55117","inReplyTo":"20210207181439.1178-1-charvi077@gmail.com","subject":"[PATCH 6/7] t/t3437: update the tests","fromName":"Charvi Mendiratta","fromEmail":"charvi077@gmail.com","sentAt":"2021-02-07T18:14:39Z","receivedAt":"2021-02-07T18:20:57Z","isPatch":true,"sender":{"key":"charvi077@gmail.com","avatar":"https://avatars.githubusercontent.com/u/32788121?v=4"},"body":"Let's do the changes listed below to make tests more easier to follow :\n\n-Remove the dependency of 'expected-message' file from earlier tests to\nmake it easier to run tests selectively with '--run' or 'GIT_SKIP_TESTS'.\n\n-Add author timestamp to check that the author date of fixed up commit\nis unchanged.\n\n-Simplify the test_commit_message() and add comments before the\nfunction.\n\n-Clarify the working of 'fixup -c' with \"amend!\" in the test-description.\n\n-Remove unnecessary curly braces and use the named commits in the\ntests so that they will still refer to the same commit if the setup\ngets changed in the future whereas 'branch~2' will change which commit\nit points to.\n\nOriginal-patch-by: Phillip Wood <phillip.wood@dunelm.org.uk>\nMentored-by: Christian Couder <chriscool@tuxfamily.org>\nMentored-by: Phillip Wood <phillip.wood@dunelm.org.uk>\nHelped-by: Eric Sunshine <sunshine@sunshineco.com>\nSigned-off-by: Charvi Mendiratta <charvi077@gmail.com>\n---\n t/t3437-rebase-fixup-options.sh | 82 ++++++++++++++++++---------------\n 1 file changed, 45 insertions(+), 37 deletions(-)\n\ndiff --git a/t/t3437-rebase-fixup-options.sh b/t/t3437-rebase-fixup-options.sh\nindex 3de899f68a..96f3a94831 100755\n--- a/t/t3437-rebase-fixup-options.sh\n+++ b/t/t3437-rebase-fixup-options.sh\n@@ -8,8 +8,10 @@ test_description='git rebase interactive fixup options\n This test checks the \"fixup [-C|-c]\" command of rebase interactive.\n In addition to amending the contents of the commit, \"fixup -C\"\n replaces the original commit message with the message of the fixup\n-commit. \"fixup -c\" also replaces the original message, but opens the\n-editor to allow the user to edit the message before committing.\n+commit and similar to \"fixup\" command that works with \"fixup!\", \"fixup -C\"\n+works with \"amend!\" upon --autosquash. \"fixup -c\" also replaces the original\n+message, but opens the editor to allow the user to edit the message before\n+committing.\n '\n\n . ./test-lib.sh\n@@ -18,36 +20,34 @@ editor to allow the user to edit the message before committing.\n\n EMPTY=\"\"\n\n+# test_commit_message <rev> -m <msg>\n+# test_commit_message <rev> <path>\n+# Verify that the commit message of <rev> matches\n+# <msg> or the content of <path>.\n test_commit_message () {\n-\trev=\"$1\" && # commit or tag we want to test\n-\tfile=\"$2\" && # test against the content of a file\n-\tgit show --no-patch --pretty=format:%B \"$rev\" >actual-message &&\n-\tif test \"$2\" = -m\n-\tthen\n-\t\tstr=\"$3\" && # test against a string\n-\t\tprintf \"%s\\n\" \"$str\" >tmp-expected-message &&\n-\t\tfile=\"tmp-expected-message\"\n-\tfi\n-\ttest_cmp \"$file\" actual-message\n+\tgit show --no-patch --pretty=format:%B \"$1\" >actual &&\n+    case \"$2\" in\n+    -m) echo \"$3\" >expect &&\n+\t    test_cmp expect actual ;;\n+    *) test_cmp \"$2\" actual ;;\n+    esac\n }\n\n get_author () {\n \trev=\"$1\" &&\n-\tgit log -1 --pretty=format:\"%an %ae\" \"$rev\"\n+\tgit log -1 --pretty=format:\"%an %ae %at\" \"$rev\"\n }\n\n test_expect_success 'setup' '\n \tcat >message <<-EOF &&\n \tamend! B\n-\t${EMPTY}\n+\t$EMPTY\n \tnew subject\n-\t${EMPTY}\n+\t$EMPTY\n \tnew\n \tbody\n \tEOF\n\n-\tsed \"1,2d\" message >expected-message &&\n-\n \ttest_commit A A &&\n \ttest_commit B B &&\n \tget_author HEAD >expected-author &&\n@@ -68,40 +68,43 @@ test_expect_success 'setup' '\n \techo B1 >B &&\n \ttest_tick &&\n \tgit commit --fixup=HEAD -a &&\n+\tgit tag B1 &&\n \ttest_tick &&\n \tgit commit --allow-empty -F - <<-EOF &&\n \tamend! B\n-\t${EMPTY}\n+\t$EMPTY\n \tB\n-\t${EMPTY}\n+\t$EMPTY\n \tedited 1\n \tEOF\n \ttest_tick &&\n \tgit commit --allow-empty -F - <<-EOF &&\n \tamend! amend! B\n-\t${EMPTY}\n+\t$EMPTY\n \tB\n-\t${EMPTY}\n+\t$EMPTY\n \tedited 1\n-\t${EMPTY}\n+\t$EMPTY\n \tedited 2\n \tEOF\n \techo B2 >B &&\n \ttest_tick &&\n \tFAKE_COMMIT_AMEND=\"edited squash\" git commit --squash=HEAD -a &&\n+\tgit tag B2 &&\n \techo B3 >B &&\n \ttest_tick &&\n \tgit commit -a -F - <<-EOF &&\n \tamend! amend! amend! B\n-\t${EMPTY}\n+\t$EMPTY\n \tB\n-\t${EMPTY}\n+\t$EMPTY\n \tedited 1\n-\t${EMPTY}\n+\t$EMPTY\n \tedited 2\n-\t${EMPTY}\n+\t$EMPTY\n \tedited 3\n \tEOF\n+\tgit tag B3 &&\n\n \tGIT_AUTHOR_NAME=\"Rebase Author\" &&\n \tGIT_AUTHOR_EMAIL=\"rebase.author@example.com\" &&\n@@ -134,6 +137,7 @@ test_expect_success 'simple fixup -c works' '\n test_expect_success 'fixup -C removes amend! from message' '\n \ttest_when_finished \"test_might_fail git rebase --abort\" &&\n \tgit checkout --detach A1 &&\n+\tgit log -1 --pretty=format:%b >expected-message &&\n \tFAKE_LINES=\"1 fixup-C 2\" git rebase -i A &&\n \ttest_cmp_rev HEAD^ A &&\n \ttest_cmp_rev HEAD^{tree} A1^{tree} &&\n@@ -145,13 +149,14 @@ test_expect_success 'fixup -C removes amend! from message' '\n test_expect_success 'fixup -C with conflicts gives correct message' '\n \ttest_when_finished \"test_might_fail git rebase --abort\" &&\n \tgit checkout --detach A1 &&\n+\tgit log -1 --pretty=format:%b >expected-message &&\n+\ttest_write_lines \"\" \"edited\" >>expected-message &&\n \ttest_must_fail env FAKE_LINES=\"1 fixup-C 2\" git rebase -i conflicts &&\n \tgit checkout --theirs -- A &&\n \tgit add A &&\n \tFAKE_COMMIT_AMEND=edited git rebase --continue &&\n \ttest_cmp_rev HEAD^ conflicts &&\n \ttest_cmp_rev HEAD^{tree} A1^{tree} &&\n-\ttest_write_lines \"\" edited >>expected-message &&\n \ttest_commit_message HEAD expected-message &&\n \tget_author HEAD >actual-author &&\n \ttest_cmp expected-author actual-author\n@@ -167,12 +172,12 @@ test_expect_success 'skipping fixup -C after fixup gives correct message' '\n '\n\n test_expect_success 'sequence of fixup, fixup -C & squash --signoff works' '\n-\tgit checkout --detach branch &&\n+\tgit checkout --detach B3 &&\n \tFAKE_LINES=\"1 fixup 2 fixup-C 3 fixup-C 4 squash 5 fixup-C 6\" \\\n \t\tFAKE_COMMIT_AMEND=squashed \\\n \t\tFAKE_MESSAGE_COPY=actual-squash-message \\\n \t\tgit -c commit.status=false rebase -ik --signoff A &&\n-\tgit diff-tree --exit-code --patch HEAD branch -- &&\n+\tgit diff-tree --exit-code --patch HEAD B3 -- &&\n \ttest_cmp_rev HEAD^ A &&\n \ttest_i18ncmp \"$TEST_DIRECTORY/t3437/expected-squash-message\" \\\n \t\tactual-squash-message\n@@ -180,7 +185,7 @@ test_expect_success 'sequence of fixup, fixup -C & squash --signoff works' '\n\n test_expect_success 'first fixup -C commented out in sequence fixup fixup -C fixup -C' '\n \ttest_when_finished \"test_might_fail git rebase --abort\" &&\n-\tgit checkout branch && git checkout --detach branch~2 &&\n+\tgit checkout --detach B2~ &&\n \tgit log -1 --pretty=format:%b >expected-message &&\n \tFAKE_LINES=\"1 fixup 2 fixup-C 3 fixup-C 4\" git rebase -i A &&\n \ttest_cmp_rev HEAD^ A &&\n@@ -190,13 +195,16 @@ test_expect_success 'first fixup -C commented out in sequence fixup fixup -C fix\n test_expect_success 'multiple fixup -c opens editor once' '\n \ttest_when_finished \"test_might_fail git rebase --abort\" &&\n \tgit checkout --detach A3 &&\n-\tbase=$(git rev-parse HEAD~4) &&\n-\tFAKE_COMMIT_MESSAGE=\"Modified-A3\" \\\n+\tgit log -1 --pretty=format:%B >expected-message &&\n+\ttest_write_lines \"\" \"Modified-A3\" >>expected-message &&\n+\tFAKE_COMMIT_AMEND=\"Modified-A3\" \\\n \t\tFAKE_LINES=\"1 fixup-C 2 fixup-c 3 fixup-c 4\" \\\n \t\tEXPECT_HEADER_COUNT=4 \\\n-\t\tgit rebase -i $base &&\n-\ttest_cmp_rev $base HEAD^ &&\n-\ttest 1 = $(git show | grep Modified-A3 | wc -l)\n+\t\tgit rebase -i A &&\n+\ttest_cmp_rev HEAD^ A &&\n+\tget_author HEAD >actual-author &&\n+\ttest_cmp expected-author actual-author &&\n+\ttest_commit_message HEAD expected-message\n '\n\n test_expect_success 'sequence squash, fixup & fixup -c gives combined message' '\n@@ -211,12 +219,12 @@ test_expect_success 'sequence squash, fixup & fixup -c gives combined message' '\n '\n\n test_expect_success 'fixup -C works upon --autosquash with amend!' '\n-\tgit checkout --detach branch &&\n+\tgit checkout --detach B3 &&\n \tFAKE_COMMIT_AMEND=squashed \\\n \t\tFAKE_MESSAGE_COPY=actual-squash-message \\\n \t\tgit -c commit.status=false rebase -ik --autosquash \\\n \t\t\t\t\t\t--signoff A &&\n-\tgit diff-tree --exit-code --patch HEAD branch -- &&\n+\tgit diff-tree --exit-code --patch HEAD B3 -- &&\n \ttest_cmp_rev HEAD^ A &&\n \ttest_i18ncmp \"$TEST_DIRECTORY/t3437/expected-squash-message\" \\\n \t\tactual-squash-message\n--\n2.29.0.rc1\n\n"},{"id":"416369","messageId":"CAPig+cTDT5Hct7dUTY93nO+P5-US=ZokuGhOQeELPpZwQGzf=w@mail.gmail.com","threadId":"55117","inReplyTo":"20210207181439.1178-7-charvi077@gmail.com","subject":"Re: [PATCH 6/7] t/t3437: update the tests","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2021-02-07T18:43:14Z","receivedAt":"2021-02-07T18:46:31Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Sun, Feb 7, 2021 at 1:19 PM Charvi Mendiratta <charvi077@gmail.com> wrote:\n> Let's do the changes listed below to make tests more easier to follow :\n>\n> -Remove the dependency of 'expected-message' file from earlier tests to\n> make it easier to run tests selectively with '--run' or 'GIT_SKIP_TESTS'.\n>\n> -Add author timestamp to check that the author date of fixed up commit\n> is unchanged.\n>\n> -Simplify the test_commit_message() and add comments before the\n> function.\n>\n> -Clarify the working of 'fixup -c' with \"amend!\" in the test-description.\n>\n> -Remove unnecessary curly braces and use the named commits in the\n> tests so that they will still refer to the same commit if the setup\n> gets changed in the future whereas 'branch~2' will change which commit\n> it points to.\n\nTypically, if you find yourself enumerating a list of distinct changes\nlike this in a commit message, it's a good indication that it should\nbe split into multiple patches, each taking care of one item from the\nlist. A good reason for splitting it up like this is that it's\ndifficult for reviewers to keep the entire list in mind while\nreviewing the patch, however, it's easy to keep in mind a single\nstated goal while reading the changes.\n\nHaving said that, I'm not sure it's worth a re-roll or the extra work\nof actually splitting it up since you've already been dragged deeper\ninto this than planned, and these are relatively minor issues.\n\n(Returning to this after reading the remainder of the patch, I did\nfind it reasonably confusing trying to figure out which changes\nrelated to each other and to items from the list above. It would have\nbeen easier to reason about the changes had they been done in separate\npatches. Still, though, I'm not sure it's worth the time and effort to\nsplit them up -- but I wouldn't complain if you did.)\n\nMore below...\n\n> Signed-off-by: Charvi Mendiratta <charvi077@gmail.com>\n> ---\n> diff --git a/t/t3437-rebase-fixup-options.sh b/t/t3437-rebase-fixup-options.sh\n> @@ -8,8 +8,10 @@ test_description='git rebase interactive fixup options\n>  This test checks the \"fixup [-C|-c]\" command of rebase interactive.\n>  In addition to amending the contents of the commit, \"fixup -C\"\n>  replaces the original commit message with the message of the fixup\n> -commit. \"fixup -c\" also replaces the original message, but opens the\n> -editor to allow the user to edit the message before committing.\n> +commit and similar to \"fixup\" command that works with \"fixup!\", \"fixup -C\"\n> +works with \"amend!\" upon --autosquash. \"fixup -c\" also replaces the original\n> +message, but opens the editor to allow the user to edit the message before\n> +committing.\n>  '\n\nI had trouble digesting this run-on sentence due, I think, to the\nmixing of thoughts. It might be easier to understand if you first talk\nonly about the options to `fixup` (-c/-C), and then, as a separate\nsentence, talk about how `amend!` is transformed into `fixup -C` (like\n`fixup!` is transformed into `fixup`). However, as this is just minor\ndescriptive text in a test file, not user-facing documentation, I'm\nnot sure it matters enough to warrant a re-roll.\n\n> @@ -18,36 +20,34 @@ editor to allow the user to edit the message before committing.\n> +# test_commit_message <rev> -m <msg>\n> +# test_commit_message <rev> <path>\n> +# Verify that the commit message of <rev> matches\n> +# <msg> or the content of <path>.\n\nGood.\n\n>  test_commit_message () {\n> +       git show --no-patch --pretty=format:%B \"$1\" >actual &&\n> +    case \"$2\" in\n> +    -m) echo \"$3\" >expect &&\n> +           test_cmp expect actual ;;\n> +    *) test_cmp \"$2\" actual ;;\n> +    esac\n>  }\n\nThe funky indentation here is due to a mix of tabs and spaces. It\nshould use tabs exclusively.\n"},{"id":"416370","messageId":"CAPig+cS-QK7dZ63NfEY8S2z+wveY43dHkQWV3krNDP_dYSfyJw@mail.gmail.com","threadId":"55117","inReplyTo":"20210207181439.1178-4-charvi077@gmail.com","subject":"Re: [PATCH 3/7] rebase -i: clarify and fix 'fixup -c' rebase-todo help","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2021-02-07T18:49:47Z","receivedAt":"2021-02-07T18:50:51Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Sun, Feb 7, 2021 at 1:19 PM Charvi Mendiratta <charvi077@gmail.com> wrote:\n> When `-c` says \"edit the commit message\" it's not clear what will be\n> edited. The original's commit message or the replacement's message or a\n> combination of the two. Word it such that it states more precisely what\n> exactly will be edited and also remove the use of a period and\n> capitalized word in the to-do help text.\n\nIf you happen to re-roll for some reason, it might be a good idea to\nexplain why you are removing the period and capitalization since the\nreason is not otherwise clear to the casual reader. So, perhaps:\n\n    ... exactly will be edited. While at it, also drop the jarring\n    period and capitalization, neither of which is otherwise present\n    in the message.\n\nor something like that.\n\n> Signed-off-by: Charvi Mendiratta <charvi077@gmail.com>\n"},{"id":"416371","messageId":"CAPig+cQ+_neX_FLCQawG44US6Rtu_4wgVe+HMNseh7AvjTu=Qg@mail.gmail.com","threadId":"55117","inReplyTo":"20210207181439.1178-6-charvi077@gmail.com","subject":"Re: [PATCH 5/7] t3437: fix indendation of the here-doc","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2021-02-07T18:54:44Z","receivedAt":"2021-02-07T18:55:53Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Sun, Feb 7, 2021 at 1:19 PM Charvi Mendiratta <charvi077@gmail.com> wrote:\n> In the test scripts, the here-doc body and EOF are indented the same\n> amount as the command which opened the here-doc. Let's remove\n> one level of indendation.\n\ns/indendation/indentation/\n\nI found \"In the test scripts\" ambiguous. It isn't clear if you are\ntalking about all test scripts or the script(s) this patch is fixing\nup. Sp, if you happen to re-roll for some reason, perhaps clarify by\nsaying something like:\n\n    The most common way to format here-docs in Git test scripts is for\n    the body and EOF to be indented the same amount as the command\n    which opened the here-doc. Fix a few here-docs in this script to\n    conform to that standard.\n\n> Original-patch-by: Phillip Wood <phillip.wood@dunelm.org.uk>\n\nI don't think this new patch is based upon Phillip's, so you can\nprobably drop this attribution.\n\n> Signed-off-by: Charvi Mendiratta <charvi077@gmail.com>\n"},{"id":"416372","messageId":"CAPig+cTQaP_FvixPiwosPybxy-C91pvV_FvQfwf7cO0QGpH7UQ@mail.gmail.com","threadId":"55117","inReplyTo":"20210207181439.1178-1-charvi077@gmail.com","subject":"Re: [PATCH 0/7][Outreachy] Improve the 'fixup [-C | -c]' in interactive rebase","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2021-02-07T18:57:49Z","receivedAt":"2021-02-07T18:58:43Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Sun, Feb 7, 2021 at 1:18 PM Charvi Mendiratta <charvi077@gmail.com> wrote:\n> This patch series is build on the top of \"cm/rebase-i\" in the 'next' branch and\n> improves it. It fixup the source code of 'fixup [-C | -c]' command in the\n> sequencer, do some fixes in rebase -i, improves the 'fixup_-C' like commands\n> in lib-rebase.sh, update the test-script 't3437' and fixes a typo in the\n> documentation.\n\nThanks for working on this. I looked over the entire series and left a\nfew minor comments. As mentioned in my [6/7] review, you might also\nwant to consider splitting that patch into several patches (though\nit's not clear if the extra work of doing so is warranted). Anyhow,\naside from some botched indentation in [6/7], it all looked clean.\n"},{"id":"416391","messageId":"CAPSFM5ewDzL6UEKoYfjhvBfDxZj-YrzA4aoO2McqNdCVW=SZBQ@mail.gmail.com","threadId":"55117","inReplyTo":"CAPig+cS-QK7dZ63NfEY8S2z+wveY43dHkQWV3krNDP_dYSfyJw@mail.gmail.com","subject":"Re: [PATCH 3/7] rebase -i: clarify and fix 'fixup -c' rebase-todo help","fromName":"Charvi Mendiratta","fromEmail":"charvi077@gmail.com","sentAt":"2021-02-08T04:30:32Z","receivedAt":"2021-02-08T04:31:43Z","isPatch":true,"sender":{"key":"charvi077@gmail.com","avatar":"https://avatars.githubusercontent.com/u/32788121?v=4"},"body":"On Mon, 8 Feb 2021 at 00:19, Eric Sunshine <sunshine@sunshineco.com> wrote:\n>\n> On Sun, Feb 7, 2021 at 1:19 PM Charvi Mendiratta <charvi077@gmail.com> wrote:\n> > When `-c` says \"edit the commit message\" it's not clear what will be\n> > edited. The original's commit message or the replacement's message or a\n> > combination of the two. Word it such that it states more precisely what\n> > exactly will be edited and also remove the use of a period and\n> > capitalized word in the to-do help text.\n>\n> If you happen to re-roll for some reason, it might be a good idea to\n> explain why you are removing the period and capitalization since the\n> reason is not otherwise clear to the casual reader. So, perhaps:\n>\n>     ... exactly will be edited. While at it, also drop the jarring\n>     period and capitalization, neither of which is otherwise present\n>     in the message.\n>\n> or something like that.\n\nokay, I will change it.\n"},{"id":"416392","messageId":"CAPSFM5f0pYv_0wJFw61wQnWP_cPVA8Baz6HQLcrBsB=zCkNqvw@mail.gmail.com","threadId":"55117","inReplyTo":"CAPig+cTDT5Hct7dUTY93nO+P5-US=ZokuGhOQeELPpZwQGzf=w@mail.gmail.com","subject":"Re: [PATCH 6/7] t/t3437: update the tests","fromName":"Charvi Mendiratta","fromEmail":"charvi077@gmail.com","sentAt":"2021-02-08T04:30:18Z","receivedAt":"2021-02-08T04:31:43Z","isPatch":true,"sender":{"key":"charvi077@gmail.com","avatar":"https://avatars.githubusercontent.com/u/32788121?v=4"},"body":"Hi Eric,\n\nOn Mon, 8 Feb 2021 at 00:13, Eric Sunshine <sunshine@sunshineco.com> wrote:\n>\n[...]\n> Typically, if you find yourself enumerating a list of distinct changes\n> like this in a commit message, it's a good indication that it should\n> be split into multiple patches, each taking care of one item from the\n> list. A good reason for splitting it up like this is that it's\n> difficult for reviewers to keep the entire list in mind while\n> reviewing the patch, however, it's easy to keep in mind a single\n> stated goal while reading the changes.\n>\n> Having said that, I'm not sure it's worth a re-roll or the extra work\n> of actually splitting it up since you've already been dragged deeper\n> into this than planned, and these are relatively minor issues.\n\n> (Returning to this after reading the remainder of the patch, I did\n> find it reasonably confusing trying to figure out which changes\n> related to each other and to items from the list above. It would have\n> been easier to reason about the changes had they been done in separate\n> patches. Still, though, I'm not sure it's worth the time and effort to\n> split them up -- but I wouldn't complain if you did.)\n>\n\nAgree, I will split this patch.\n\n> More below...\n>\n> > Signed-off-by: Charvi Mendiratta <charvi077@gmail.com>\n> > ---\n> > diff --git a/t/t3437-rebase-fixup-options.sh b/t/t3437-rebase-fixup-options.sh\n> > @@ -8,8 +8,10 @@ test_description='git rebase interactive fixup options\n> >  This test checks the \"fixup [-C|-c]\" command of rebase interactive.\n> >  In addition to amending the contents of the commit, \"fixup -C\"\n> >  replaces the original commit message with the message of the fixup\n> > -commit. \"fixup -c\" also replaces the original message, but opens the\n> > -editor to allow the user to edit the message before committing.\n> > +commit and similar to \"fixup\" command that works with \"fixup!\", \"fixup -C\"\n> > +works with \"amend!\" upon --autosquash. \"fixup -c\" also replaces the original\n> > +message, but opens the editor to allow the user to edit the message before\n> > +committing.\n> >  '\n>\n> I had trouble digesting this run-on sentence due, I think, to the\n> mixing of thoughts. It might be easier to understand if you first talk\n> only about the options to `fixup` (-c/-C), and then, as a separate\n> sentence, talk about how `amend!` is transformed into `fixup -C` (like\n> `fixup!` is transformed into `fixup`). However, as this is just minor\n> descriptive text in a test file, not user-facing documentation, I'm\n> not sure it matters enough to warrant a re-roll.\n>\n\nOkay, will change it.\n\n> >  test_commit_message () {\n> > +       git show --no-patch --pretty=format:%B \"$1\" >actual &&\n> > +    case \"$2\" in\n> > +    -m) echo \"$3\" >expect &&\n> > +           test_cmp expect actual ;;\n> > +    *) test_cmp \"$2\" actual ;;\n> > +    esac\n> >  }\n>\n> The funky indentation here is due to a mix of tabs and spaces. It\n> should use tabs exclusively.\n\nOh, thanks I will correct it.\n"},{"id":"416393","messageId":"CAPSFM5f67naGx7kywKJF0DxesWhatDqTVHfA7hCF76NSO9p94g@mail.gmail.com","threadId":"55117","inReplyTo":"CAPig+cQ+_neX_FLCQawG44US6Rtu_4wgVe+HMNseh7AvjTu=Qg@mail.gmail.com","subject":"Re: [PATCH 5/7] t3437: fix indendation of the here-doc","fromName":"Charvi Mendiratta","fromEmail":"charvi077@gmail.com","sentAt":"2021-02-08T04:30:48Z","receivedAt":"2021-02-08T04:32:06Z","isPatch":true,"sender":{"key":"charvi077@gmail.com","avatar":"https://avatars.githubusercontent.com/u/32788121?v=4"},"body":"On Mon, 8 Feb 2021 at 00:24, Eric Sunshine <sunshine@sunshineco.com> wrote:\n>\n> On Sun, Feb 7, 2021 at 1:19 PM Charvi Mendiratta <charvi077@gmail.com> wrote:\n> > In the test scripts, the here-doc body and EOF are indented the same\n> > amount as the command which opened the here-doc. Let's remove\n> > one level of indendation.\n>\n> s/indendation/indentation/\n>\n\nMy spelling mistake, I will fix it.\n\n> I found \"In the test scripts\" ambiguous. It isn't clear if you are\n> talking about all test scripts or the script(s) this patch is fixing\n> up. Sp, if you happen to re-roll for some reason, perhaps clarify by\n> saying something like:\n>\n>     The most common way to format here-docs in Git test scripts is for\n>     the body and EOF to be indented the same amount as the command\n>     which opened the here-doc. Fix a few here-docs in this script to\n>     conform to that standard.\n>\n\nOkay, will change in the above way.\n\n> > Original-patch-by: Phillip Wood <phillip.wood@dunelm.org.uk>\n>\n> I don't think this new patch is based upon Phillip's, so you can\n> probably drop this attribution.\n>\n\nOkay, thanks.\n"},{"id":"416394","messageId":"CAPSFM5fG1jSUM1tuw8UCzkLigpM9SqVqDO=wA1CQ_fs5Xy+04w@mail.gmail.com","threadId":"55117","inReplyTo":"CAPig+cTQaP_FvixPiwosPybxy-C91pvV_FvQfwf7cO0QGpH7UQ@mail.gmail.com","subject":"Re: [PATCH 0/7][Outreachy] Improve the 'fixup [-C | -c]' in interactive rebase","fromName":"Charvi Mendiratta","fromEmail":"charvi077@gmail.com","sentAt":"2021-02-08T04:31:15Z","receivedAt":"2021-02-08T04:32:48Z","isPatch":true,"sender":{"key":"charvi077@gmail.com","avatar":"https://avatars.githubusercontent.com/u/32788121?v=4"},"body":"On Mon, 8 Feb 2021 at 00:28, Eric Sunshine <sunshine@sunshineco.com> wrote:\n>\n> On Sun, Feb 7, 2021 at 1:18 PM Charvi Mendiratta <charvi077@gmail.com> wrote:\n> > This patch series is build on the top of \"cm/rebase-i\" in the 'next' branch and\n> > improves it. It fixup the source code of 'fixup [-C | -c]' command in the\n> > sequencer, do some fixes in rebase -i, improves the 'fixup_-C' like commands\n> > in lib-rebase.sh, update the test-script 't3437' and fixes a typo in the\n> > documentation.\n>\n> Thanks for working on this. I looked over the entire series and left a\n> few minor comments. As mentioned in my [6/7] review, you might also\n> want to consider splitting that patch into several patches (though\n> it's not clear if the extra work of doing so is warranted). Anyhow,\n> aside from some botched indentation in [6/7], it all looked clean.\n\nThanks for the corrections. I admit there are few silly mistakes, will\nfixup all and\nalso split [6/7] in the next version.\n\nThanks and Regards,\nCharvi\n"},{"id":"416405","messageId":"d000c590-728b-6105-db4d-eed57975fcbb@gmail.com","threadId":"55117","inReplyTo":"CAPig+cQ+_neX_FLCQawG44US6Rtu_4wgVe+HMNseh7AvjTu=Qg@mail.gmail.com","subject":"Re: [PATCH 5/7] t3437: fix indendation of the here-doc","fromName":"Phillip Wood","fromEmail":"phillip.wood123@gmail.com","sentAt":"2021-02-08T10:37:46Z","receivedAt":"2021-02-08T10:40:49Z","isPatch":true,"sender":{"key":"phillip.wood@dunelm.org.uk","avatar":null},"body":"Hi Chariv and Eric\n\nOn 07/02/2021 18:54, Eric Sunshine wrote:\n> On Sun, Feb 7, 2021 at 1:19 PM Charvi Mendiratta <charvi077@gmail.com> wrote:\n>> In the test scripts, the here-doc body and EOF are indented the same\n>> amount as the command which opened the here-doc. Let's remove\n>> one level of indendation.\n> \n> s/indendation/indentation/\n> \n> I found \"In the test scripts\" ambiguous. It isn't clear if you are\n> talking about all test scripts or the script(s) this patch is fixing\n> up. Sp, if you happen to re-roll for some reason, perhaps clarify by\n> saying something like:\n> \n>      The most common way to format here-docs in Git test scripts is for\n>      the body and EOF to be indented the same amount as the command\n>      which opened the here-doc. Fix a few here-docs in this script to\n>      conform to that standard.\n> \n>> Original-patch-by: Phillip Wood <phillip.wood@dunelm.org.uk>\n> \n> I don't think this new patch is based upon Phillip's, so you can\n> probably drop this attribution.\n\nGood point - well spotted as ever Eric\n\nThanks\n\nPhillip\n>> Signed-off-by: Charvi Mendiratta <charvi077@gmail.com>\n"},{"id":"416424","messageId":"20210208192528.21399-1-charvi077@gmail.com","threadId":"55117","inReplyTo":"20210207181439.1178-1-charvi077@gmail.com","subject":"[PATCH v2 00/11][Outreachy] Improve the 'fixup [-C | -c]' in interactive rebase","fromName":"Charvi Mendiratta","fromEmail":"charvi077@gmail.com","sentAt":"2021-02-08T19:25:18Z","receivedAt":"2021-02-08T19:27:31Z","isPatch":true,"sender":{"key":"charvi077@gmail.com","avatar":"https://avatars.githubusercontent.com/u/32788121?v=4"},"body":"This patch series is build on the top of \"cm/rebase-i\" in the 'next' branch and\nimproves it. It fixup the source code of 'fixup [-C | -c]' command in the\nsequencer, do some fixes in rebase -i, improves the 'fixup_-C' like commands\nin lib-rebase.sh, update the test-script 't3437' and fixes a typo in the\ndocumentation.\n\nChanges from v1 :\n* Splits the patch 'update test-script', to make it more easy to follow.\n* Modification in few commit messages as suggested by Eric.\n\n\nCharvi Mendiratta (11):\n  sequencer: fixup the datatype of the 'flag' argument\n  sequencer: rename a few functions\n  rebase -i: clarify and fix 'fixup -c' rebase-todo help\n  t/lib-rebase: change the implementation of commands with options\n  t/t3437: fix indentation of the here-doc\n  t/t3437: remove the dependency of 'expected-message' file from tests\n  t/t3437: check author date of the fixed up commit\n  t/t3437: simplify and document the test helpers\n  t/t3437: cleanup the 'setup' test and use named commits in the tests\n  t/t3437: fixup the test 'multiple fixup -c opens editor once'\n  doc/rebase -i: fix typo in the documentation of 'fixup' command\n\n Documentation/git-rebase.txt    |   2 +-\n rebase-interactive.c            |   6 +-\n sequencer.c                     |  23 +++---\n t/lib-rebase.sh                 |   8 +-\n t/t3437-rebase-fixup-options.sh | 140 +++++++++++++++++---------------\n 5 files changed, 94 insertions(+), 85 deletions(-)\n\n--\n2.29.0.rc1\n\n"},{"id":"416425","messageId":"20210208192528.21399-2-charvi077@gmail.com","threadId":"55117","inReplyTo":"20210207181439.1178-1-charvi077@gmail.com","subject":"[PATCH v2 01/11] sequencer: fixup the datatype of the 'flag' argument","fromName":"Charvi Mendiratta","fromEmail":"charvi077@gmail.com","sentAt":"2021-02-08T19:25:19Z","receivedAt":"2021-02-08T19:28:24Z","isPatch":true,"sender":{"key":"charvi077@gmail.com","avatar":"https://avatars.githubusercontent.com/u/32788121?v=4"},"body":"As 'flag' is a combination of bits, so change its datatype from\n'enum todo_item_flags' to 'unsigned'.\n\nMentored-by: Christian Couder <chriscool@tuxfamily.org>\nMentored-by: Phillip Wood <phillip.wood@dunelm.org.uk>\nHelped-by: Eric Sunshine <sunshine@sunshineco.com>\nSigned-off-by: Charvi Mendiratta <charvi077@gmail.com>\n---\n sequencer.c | 7 +++----\n 1 file changed, 3 insertions(+), 4 deletions(-)\n\ndiff --git a/sequencer.c b/sequencer.c\nindex d09ce446b6..f3928cf45c 100644\n--- a/sequencer.c\n+++ b/sequencer.c\n@@ -1744,8 +1744,7 @@ static const char skip_first_commit_msg_str[] = N_(\"The 1st commit message will\n static const char skip_nth_commit_msg_fmt[] = N_(\"The commit message #%d will be skipped:\");\n static const char combined_commit_msg_fmt[] = N_(\"This is a combination of %d commits.\");\n \n-static int check_fixup_flag(enum todo_command command,\n-\t\t\t    enum todo_item_flags flag)\n+static int check_fixup_flag(enum todo_command command, unsigned flag)\n {\n \treturn command == TODO_FIXUP && ((flag & TODO_REPLACE_FIXUP_MSG) ||\n \t\t\t\t\t (flag & TODO_EDIT_FIXUP_MSG));\n@@ -1850,7 +1849,7 @@ static void update_squash_message_for_fixup(struct strbuf *msg)\n \n static int append_squash_message(struct strbuf *buf, const char *body,\n \t\t\t enum todo_command command, struct replay_opts *opts,\n-\t\t\t enum todo_item_flags flag)\n+\t\t\t unsigned flag)\n {\n \tconst char *fixup_msg;\n \tsize_t commented_len = 0, fixup_off;\n@@ -1906,7 +1905,7 @@ static int update_squash_messages(struct repository *r,\n \t\t\t\t  enum todo_command command,\n \t\t\t\t  struct commit *commit,\n \t\t\t\t  struct replay_opts *opts,\n-\t\t\t\t  enum todo_item_flags flag)\n+\t\t\t\t  unsigned flag)\n {\n \tstruct strbuf buf = STRBUF_INIT;\n \tint res = 0;\n-- \n2.29.0.rc1\n\n"},{"id":"416426","messageId":"20210208192528.21399-3-charvi077@gmail.com","threadId":"55117","inReplyTo":"20210207181439.1178-1-charvi077@gmail.com","subject":"[PATCH v2 02/11] sequencer: rename a few functions","fromName":"Charvi Mendiratta","fromEmail":"charvi077@gmail.com","sentAt":"2021-02-08T19:25:20Z","receivedAt":"2021-02-08T19:28:25Z","isPatch":true,"sender":{"key":"charvi077@gmail.com","avatar":"https://avatars.githubusercontent.com/u/32788121?v=4"},"body":"Rename functions to make them more descriptive and while at it, remove\nunnecessary 'inline' of the skip_fixupish() function.\n\nMentored-by: Christian Couder <chriscool@tuxfamily.org>\nMentored-by: Phillip Wood <phillip.wood@dunelm.org.uk>\nHelped-by: Eric Sunshine <sunshine@sunshineco.com>\nSigned-off-by: Charvi Mendiratta <charvi077@gmail.com>\n---\n sequencer.c | 18 +++++++++---------\n 1 file changed, 9 insertions(+), 9 deletions(-)\n\ndiff --git a/sequencer.c b/sequencer.c\nindex f3928cf45c..abc6d5cdfd 100644\n--- a/sequencer.c\n+++ b/sequencer.c\n@@ -1744,7 +1744,7 @@ static const char skip_first_commit_msg_str[] = N_(\"The 1st commit message will\n static const char skip_nth_commit_msg_fmt[] = N_(\"The commit message #%d will be skipped:\");\n static const char combined_commit_msg_fmt[] = N_(\"This is a combination of %d commits.\");\n \n-static int check_fixup_flag(enum todo_command command, unsigned flag)\n+static int is_fixup_flag(enum todo_command command, unsigned flag)\n {\n \treturn command == TODO_FIXUP && ((flag & TODO_REPLACE_FIXUP_MSG) ||\n \t\t\t\t\t (flag & TODO_EDIT_FIXUP_MSG));\n@@ -1873,7 +1873,7 @@ static int append_squash_message(struct strbuf *buf, const char *body,\n \tstrbuf_addstr(buf, body + commented_len);\n \n \t/* fixup -C after squash behaves like squash */\n-\tif (check_fixup_flag(command, flag) && !seen_squash(opts)) {\n+\tif (is_fixup_flag(command, flag) && !seen_squash(opts)) {\n \t\t/*\n \t\t * We're replacing the commit message so we need to\n \t\t * append the Signed-off-by: trailer if the user\n@@ -1928,7 +1928,7 @@ static int update_squash_messages(struct repository *r,\n \t\t\t    opts->current_fixup_count + 2);\n \t\tstrbuf_splice(&buf, 0, eol - buf.buf, header.buf, header.len);\n \t\tstrbuf_release(&header);\n-\t\tif (check_fixup_flag(command, flag) && !seen_squash(opts))\n+\t\tif (is_fixup_flag(command, flag) && !seen_squash(opts))\n \t\t\tupdate_squash_message_for_fixup(&buf);\n \t} else {\n \t\tstruct object_id head;\n@@ -1951,11 +1951,11 @@ static int update_squash_messages(struct repository *r,\n \t\tstrbuf_addf(&buf, \"%c \", comment_line_char);\n \t\tstrbuf_addf(&buf, _(combined_commit_msg_fmt), 2);\n \t\tstrbuf_addf(&buf, \"\\n%c \", comment_line_char);\n-\t\tstrbuf_addstr(&buf, check_fixup_flag(command, flag) ?\n+\t\tstrbuf_addstr(&buf, is_fixup_flag(command, flag) ?\n \t\t\t      _(skip_first_commit_msg_str) :\n \t\t\t      _(first_commit_msg_str));\n \t\tstrbuf_addstr(&buf, \"\\n\\n\");\n-\t\tif (check_fixup_flag(command, flag))\n+\t\tif (is_fixup_flag(command, flag))\n \t\t\tstrbuf_add_commented_lines(&buf, body, strlen(body));\n \t\telse\n \t\t\tstrbuf_addstr(&buf, body);\n@@ -1968,7 +1968,7 @@ static int update_squash_messages(struct repository *r,\n \t\t\t     oid_to_hex(&commit->object.oid));\n \tfind_commit_subject(message, &body);\n \n-\tif (command == TODO_SQUASH || check_fixup_flag(command, flag)) {\n+\tif (command == TODO_SQUASH || is_fixup_flag(command, flag)) {\n \t\tres = append_squash_message(&buf, body, command, opts, flag);\n \t} else if (command == TODO_FIXUP) {\n \t\tstrbuf_addf(&buf, \"\\n%c \", comment_line_char);\n@@ -5661,7 +5661,7 @@ static int subject2item_cmp(const void *fndata,\n \n define_commit_slab(commit_todo_item, struct todo_item *);\n \n-static inline int skip_fixup_amend_squash(const char *subject, const char **p) {\n+static int skip_fixupish(const char *subject, const char **p) {\n \treturn skip_prefix(subject, \"fixup! \", p) ||\n \t       skip_prefix(subject, \"amend! \", p) ||\n \t       skip_prefix(subject, \"squash! \", p);\n@@ -5725,13 +5725,13 @@ int todo_list_rearrange_squash(struct todo_list *todo_list)\n \t\tformat_subject(&buf, subject, \" \");\n \t\tsubject = subjects[i] = strbuf_detach(&buf, &subject_len);\n \t\tunuse_commit_buffer(item->commit, commit_buffer);\n-\t\tif (skip_fixup_amend_squash(subject, &p)) {\n+\t\tif (skip_fixupish(subject, &p)) {\n \t\t\tstruct commit *commit2;\n \n \t\t\tfor (;;) {\n \t\t\t\twhile (isspace(*p))\n \t\t\t\t\tp++;\n-\t\t\t\tif (!skip_fixup_amend_squash(p, &p))\n+\t\t\t\tif (!skip_fixupish(p, &p))\n \t\t\t\t\tbreak;\n \t\t\t}\n \n-- \n2.29.0.rc1\n\n"},{"id":"416427","messageId":"20210208192528.21399-4-charvi077@gmail.com","threadId":"55117","inReplyTo":"20210207181439.1178-1-charvi077@gmail.com","subject":"[PATCH v2 03/11] rebase -i: clarify and fix 'fixup -c' rebase-todo help","fromName":"Charvi Mendiratta","fromEmail":"charvi077@gmail.com","sentAt":"2021-02-08T19:25:21Z","receivedAt":"2021-02-08T19:29:01Z","isPatch":true,"sender":{"key":"charvi077@gmail.com","avatar":"https://avatars.githubusercontent.com/u/32788121?v=4"},"body":"When `-c` says \"edit the commit message\" it's not clear what will be\nedited. The original's commit message or the replacement's message or a\ncombination of the two. Word it such that it states more precisely what\nexactly will be edited. While at it, also drop the jarring period and\ncapitalization, neither of which is otherwise present in the message.\n\nMentored-by: Christian Couder <chriscool@tuxfamily.org>\nMentored-by: Phillip Wood <phillip.wood@dunelm.org.uk>\nHelped-by: Eric Sunshine <sunshine@sunshineco.com>\nSigned-off-by: Charvi Mendiratta <charvi077@gmail.com>\n---\n rebase-interactive.c | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/rebase-interactive.c b/rebase-interactive.c\nindex c3bd02adee..e85994beb6 100644\n--- a/rebase-interactive.c\n+++ b/rebase-interactive.c\n@@ -45,8 +45,8 @@ void append_todo_help(int command_count,\n \"e, edit <commit> = use commit, but stop for amending\\n\"\n \"s, squash <commit> = use commit, but meld into previous commit\\n\"\n \"f, fixup [-C | -c] <commit> = like \\\"squash\\\", but discard this\\n\"\n-\"                   commit's log message. Use -C to replace with this\\n\"\n-\"                   commit message or -c to edit the commit message\\n\"\n+\"                   commit's log message; use -C to replace with this\\n\"\n+\"                   commit message or -c to edit this commit message\\n\"\n \"x, exec <command> = run command (the rest of the line) using shell\\n\"\n \"b, break = stop here (continue rebase later with 'git rebase --continue')\\n\"\n \"d, drop <commit> = remove commit\\n\"\n@@ -55,7 +55,7 @@ void append_todo_help(int command_count,\n \"m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]\\n\"\n \".       create a merge commit using the original merge commit's\\n\"\n \".       message (or the oneline, if no original merge commit was\\n\"\n-\".       specified). Use -c <commit> to reword the commit message.\\n\"\n+\".       specified); use -c <commit> to reword the commit message\\n\"\n \"\\n\"\n \"These lines can be re-ordered; they are executed from top to bottom.\\n\");\n \tunsigned edit_todo = !(shortrevisions && shortonto);\n-- \n2.29.0.rc1\n\n"},{"id":"416428","messageId":"20210208192528.21399-5-charvi077@gmail.com","threadId":"55117","inReplyTo":"20210207181439.1178-1-charvi077@gmail.com","subject":"[PATCH v2 04/11] t/lib-rebase: change the implementation of commands with options","fromName":"Charvi Mendiratta","fromEmail":"charvi077@gmail.com","sentAt":"2021-02-08T19:25:22Z","receivedAt":"2021-02-08T19:29:02Z","isPatch":true,"sender":{"key":"charvi077@gmail.com","avatar":"https://avatars.githubusercontent.com/u/32788121?v=4"},"body":"\"fixup\" and \"merge\" mirrors the implementation of FAKE_LINES handling of\n\"exec\", but the cases are quite different. The argument to \"exec\" is\narbitrary and can have any number of spaces embedded in it, which\nconflicts with the meaning of spaces in FAKE_LINES, which separate the\nindividual commands in FAKE_LINES. Consequently, \"_\" was chosen as a\nplaceholder in \"exec\" to mean \"space\".\n\nHowever, \"fixup\" is very different from \"exec\". Its arguments are not\narbitrary at all, so there isn't a good reason to mirror the choice of\n\"_\" to represent a space, which leads to rather unsightly tokens such\nas \"fixup_-C\". Let's replace it with simpler tokens such as \"fixup-C\"\nand \"fixup-c\".\n\nMentored-by: Christian Couder <chriscool@tuxfamily.org>\nMentored-by: Phillip Wood <phillip.wood@dunelm.org.uk>\nHelped-by: Eric Sunshine <sunshine@sunshineco.com>\nSigned-off-by: Charvi Mendiratta <charvi077@gmail.com>\n---\n t/lib-rebase.sh                 |  8 ++++----\n t/t3437-rebase-fixup-options.sh | 18 +++++++++---------\n 2 files changed, 13 insertions(+), 13 deletions(-)\n\ndiff --git a/t/lib-rebase.sh b/t/lib-rebase.sh\nindex e10e38060b..e6bd295c05 100644\n--- a/t/lib-rebase.sh\n+++ b/t/lib-rebase.sh\n@@ -15,8 +15,8 @@\n #       specified line.\n #\n #   \"<cmd> <lineno>\" -- add a line with the specified command\n-#       (\"pick\", \"squash\", \"fixup\", \"edit\", \"reword\" or \"drop\") and the\n-#       SHA1 taken from the specified line.\n+#      (\"pick\", \"squash\", \"fixup\"|\"fixup-C\"|\"fixup-c\", \"edit\", \"reword\" or \"drop\")\n+#      and the SHA1 taken from the specified line.\n #\n #   \"exec_cmd_with_args\" -- add an \"exec cmd with args\" line.\n #\n@@ -53,8 +53,8 @@ set_fake_editor () {\n \t\t\taction=\"$line\";;\n \t\texec_*|x_*|break|b)\n \t\t\techo \"$line\" | sed 's/_/ /g' >> \"$1\";;\n-\t\tmerge_*|fixup_*)\n-\t\t\taction=$(echo \"$line\" | sed 's/_/ /g');;\n+\t\tmerge-*|fixup-*)\n+\t\t\taction=$(echo \"$line\" | sed 's/-/ -/');;\n \t\t\"#\")\n \t\t\techo '# comment' >> \"$1\";;\n \t\t\">\")\ndiff --git a/t/t3437-rebase-fixup-options.sh b/t/t3437-rebase-fixup-options.sh\nindex 945df2555b..36dee15c4b 100755\n--- a/t/t3437-rebase-fixup-options.sh\n+++ b/t/t3437-rebase-fixup-options.sh\n@@ -112,7 +112,7 @@ test_expect_success 'setup' '\n test_expect_success 'simple fixup -C works' '\n \ttest_when_finished \"test_might_fail git rebase --abort\" &&\n \tgit checkout --detach A2 &&\n-\tFAKE_LINES=\"1 fixup_-C 2\" git rebase -i B &&\n+\tFAKE_LINES=\"1 fixup-C 2\" git rebase -i B &&\n \ttest_cmp_rev HEAD^ B &&\n \ttest_cmp_rev HEAD^{tree} A2^{tree} &&\n \ttest_commit_message HEAD -m \"A2\"\n@@ -123,7 +123,7 @@ test_expect_success 'simple fixup -c works' '\n \tgit checkout --detach A2 &&\n \tgit log -1 --pretty=format:%B >expected-fixup-message &&\n \ttest_write_lines \"\" \"Modified A2\" >>expected-fixup-message &&\n-\tFAKE_LINES=\"1 fixup_-c 2\" \\\n+\tFAKE_LINES=\"1 fixup-c 2\" \\\n \t\tFAKE_COMMIT_AMEND=\"Modified A2\" \\\n \t\tgit rebase -i B &&\n \ttest_cmp_rev HEAD^ B &&\n@@ -134,7 +134,7 @@ test_expect_success 'simple fixup -c works' '\n test_expect_success 'fixup -C removes amend! from message' '\n \ttest_when_finished \"test_might_fail git rebase --abort\" &&\n \tgit checkout --detach A1 &&\n-\tFAKE_LINES=\"1 fixup_-C 2\" git rebase -i A &&\n+\tFAKE_LINES=\"1 fixup-C 2\" git rebase -i A &&\n \ttest_cmp_rev HEAD^ A &&\n \ttest_cmp_rev HEAD^{tree} A1^{tree} &&\n \ttest_commit_message HEAD expected-message &&\n@@ -145,7 +145,7 @@ test_expect_success 'fixup -C removes amend! from message' '\n test_expect_success 'fixup -C with conflicts gives correct message' '\n \ttest_when_finished \"test_might_fail git rebase --abort\" &&\n \tgit checkout --detach A1 &&\n-\ttest_must_fail env FAKE_LINES=\"1 fixup_-C 2\" git rebase -i conflicts &&\n+\ttest_must_fail env FAKE_LINES=\"1 fixup-C 2\" git rebase -i conflicts &&\n \tgit checkout --theirs -- A &&\n \tgit add A &&\n \tFAKE_COMMIT_AMEND=edited git rebase --continue &&\n@@ -160,7 +160,7 @@ test_expect_success 'fixup -C with conflicts gives correct message' '\n test_expect_success 'skipping fixup -C after fixup gives correct message' '\n \ttest_when_finished \"test_might_fail git rebase --abort\" &&\n \tgit checkout --detach A3 &&\n-\ttest_must_fail env FAKE_LINES=\"1 fixup 2 fixup_-C 4\" git rebase -i A &&\n+\ttest_must_fail env FAKE_LINES=\"1 fixup 2 fixup-C 4\" git rebase -i A &&\n \tgit reset --hard &&\n \tFAKE_COMMIT_AMEND=edited git rebase --continue &&\n \ttest_commit_message HEAD -m \"B\"\n@@ -168,7 +168,7 @@ test_expect_success 'skipping fixup -C after fixup gives correct message' '\n \n test_expect_success 'sequence of fixup, fixup -C & squash --signoff works' '\n \tgit checkout --detach branch &&\n-\tFAKE_LINES=\"1 fixup 2 fixup_-C 3 fixup_-C 4 squash 5 fixup_-C 6\" \\\n+\tFAKE_LINES=\"1 fixup 2 fixup-C 3 fixup-C 4 squash 5 fixup-C 6\" \\\n \t\tFAKE_COMMIT_AMEND=squashed \\\n \t\tFAKE_MESSAGE_COPY=actual-squash-message \\\n \t\tgit -c commit.status=false rebase -ik --signoff A &&\n@@ -182,7 +182,7 @@ test_expect_success 'first fixup -C commented out in sequence fixup fixup -C fix\n \ttest_when_finished \"test_might_fail git rebase --abort\" &&\n \tgit checkout branch && git checkout --detach branch~2 &&\n \tgit log -1 --pretty=format:%b >expected-message &&\n-\tFAKE_LINES=\"1 fixup 2 fixup_-C 3 fixup_-C 4\" git rebase -i A &&\n+\tFAKE_LINES=\"1 fixup 2 fixup-C 3 fixup-C 4\" git rebase -i A &&\n \ttest_cmp_rev HEAD^ A &&\n \ttest_commit_message HEAD expected-message\n '\n@@ -192,7 +192,7 @@ test_expect_success 'multiple fixup -c opens editor once' '\n \tgit checkout --detach A3 &&\n \tbase=$(git rev-parse HEAD~4) &&\n \tFAKE_COMMIT_MESSAGE=\"Modified-A3\" \\\n-\t\tFAKE_LINES=\"1 fixup_-C 2 fixup_-c 3 fixup_-c 4\" \\\n+\t\tFAKE_LINES=\"1 fixup-C 2 fixup-c 3 fixup-c 4\" \\\n \t\tEXPECT_HEADER_COUNT=4 \\\n \t\tgit rebase -i $base &&\n \ttest_cmp_rev $base HEAD^ &&\n@@ -202,7 +202,7 @@ test_expect_success 'multiple fixup -c opens editor once' '\n test_expect_success 'sequence squash, fixup & fixup -c gives combined message' '\n \ttest_when_finished \"test_might_fail git rebase --abort\" &&\n \tgit checkout --detach A3 &&\n-\tFAKE_LINES=\"1 squash 2 fixup 3 fixup_-c 4\" \\\n+\tFAKE_LINES=\"1 squash 2 fixup 3 fixup-c 4\" \\\n \t\tFAKE_MESSAGE_COPY=actual-combined-message \\\n \t\tgit -c commit.status=false rebase -i A &&\n \ttest_i18ncmp \"$TEST_DIRECTORY/t3437/expected-combined-message\" \\\n-- \n2.29.0.rc1\n\n"},{"id":"416429","messageId":"20210208192528.21399-6-charvi077@gmail.com","threadId":"55117","inReplyTo":"20210207181439.1178-1-charvi077@gmail.com","subject":"[PATCH v2 05/11] t/t3437: fix indentation of the here-doc","fromName":"Charvi Mendiratta","fromEmail":"charvi077@gmail.com","sentAt":"2021-02-08T19:25:24Z","receivedAt":"2021-02-08T19:29:33Z","isPatch":true,"sender":{"key":"charvi077@gmail.com","avatar":"https://avatars.githubusercontent.com/u/32788121?v=4"},"body":"The most common way to format here-docs in Git test scripts is for the\nbody and EOF to be indented the same amount as the command which opened\nthe here-doc. Fix a few here-docs in this script to conform to that\nstandard.\n\nMentored-by: Christian Couder <chriscool@tuxfamily.org>\nMentored-by: Phillip Wood <phillip.wood@dunelm.org.uk>\nHelped-by: Eric Sunshine <sunshine@sunshineco.com>\nSigned-off-by: Charvi Mendiratta <charvi077@gmail.com>\n---\n t/t3437-rebase-fixup-options.sh | 62 ++++++++++++++++-----------------\n 1 file changed, 31 insertions(+), 31 deletions(-)\n\ndiff --git a/t/t3437-rebase-fixup-options.sh b/t/t3437-rebase-fixup-options.sh\nindex 36dee15c4b..3de899f68a 100755\n--- a/t/t3437-rebase-fixup-options.sh\n+++ b/t/t3437-rebase-fixup-options.sh\n@@ -38,13 +38,13 @@ get_author () {\n \n test_expect_success 'setup' '\n \tcat >message <<-EOF &&\n-\t\tamend! B\n-\t\t${EMPTY}\n-\t\tnew subject\n-\t\t${EMPTY}\n-\t\tnew\n-\t\tbody\n-\t\tEOF\n+\tamend! B\n+\t${EMPTY}\n+\tnew subject\n+\t${EMPTY}\n+\tnew\n+\tbody\n+\tEOF\n \n \tsed \"1,2d\" message >expected-message &&\n \n@@ -70,38 +70,38 @@ test_expect_success 'setup' '\n \tgit commit --fixup=HEAD -a &&\n \ttest_tick &&\n \tgit commit --allow-empty -F - <<-EOF &&\n-\t\tamend! B\n-\t\t${EMPTY}\n-\t\tB\n-\t\t${EMPTY}\n-\t\tedited 1\n-\t\tEOF\n+\tamend! B\n+\t${EMPTY}\n+\tB\n+\t${EMPTY}\n+\tedited 1\n+\tEOF\n \ttest_tick &&\n \tgit commit --allow-empty -F - <<-EOF &&\n-\t\tamend! amend! B\n-\t\t${EMPTY}\n-\t\tB\n-\t\t${EMPTY}\n-\t\tedited 1\n-\t\t${EMPTY}\n-\t\tedited 2\n-\t\tEOF\n+\tamend! amend! B\n+\t${EMPTY}\n+\tB\n+\t${EMPTY}\n+\tedited 1\n+\t${EMPTY}\n+\tedited 2\n+\tEOF\n \techo B2 >B &&\n \ttest_tick &&\n \tFAKE_COMMIT_AMEND=\"edited squash\" git commit --squash=HEAD -a &&\n \techo B3 >B &&\n \ttest_tick &&\n \tgit commit -a -F - <<-EOF &&\n-\t\tamend! amend! amend! B\n-\t\t${EMPTY}\n-\t\tB\n-\t\t${EMPTY}\n-\t\tedited 1\n-\t\t${EMPTY}\n-\t\tedited 2\n-\t\t${EMPTY}\n-\t\tedited 3\n-\t\tEOF\n+\tamend! amend! amend! B\n+\t${EMPTY}\n+\tB\n+\t${EMPTY}\n+\tedited 1\n+\t${EMPTY}\n+\tedited 2\n+\t${EMPTY}\n+\tedited 3\n+\tEOF\n \n \tGIT_AUTHOR_NAME=\"Rebase Author\" &&\n \tGIT_AUTHOR_EMAIL=\"rebase.author@example.com\" &&\n-- \n2.29.0.rc1\n\n"},{"id":"416430","messageId":"20210208192528.21399-7-charvi077@gmail.com","threadId":"55117","inReplyTo":"20210207181439.1178-1-charvi077@gmail.com","subject":"[PATCH v2 06/11] t/t3437: remove the dependency of 'expected-message' file from tests","fromName":"Charvi Mendiratta","fromEmail":"charvi077@gmail.com","sentAt":"2021-02-08T19:25:25Z","receivedAt":"2021-02-08T19:29:45Z","isPatch":true,"sender":{"key":"charvi077@gmail.com","avatar":"https://avatars.githubusercontent.com/u/32788121?v=4"},"body":"As it is currently implemented, it's too difficult to follow along and\nremember the value of \"expected-message\" from test to test. It also\nmakes it difficult to extend tests or add new tests in between existing\ntests without negatively impacting other tests.\n\nLet's set up \"expected-message\" to the precise content needed by the\ntest, so that both the problems go away and also makes easier to run\ntests selectively with '--run' or 'GIT_SKIP_TESTS'\n\nMentored-by: Christian Couder <chriscool@tuxfamily.org>\nMentored-by: Phillip Wood <phillip.wood@dunelm.org.uk>\nHelped-by: Eric Sunshine <sunshine@sunshineco.com>\nSigned-off-by: Charvi Mendiratta <charvi077@gmail.com>\n---\n t/t3437-rebase-fixup-options.sh | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t3437-rebase-fixup-options.sh b/t/t3437-rebase-fixup-options.sh\nindex 3de899f68a..242770a3ec 100755\n--- a/t/t3437-rebase-fixup-options.sh\n+++ b/t/t3437-rebase-fixup-options.sh\n@@ -46,8 +46,6 @@ test_expect_success 'setup' '\n \tbody\n \tEOF\n \n-\tsed \"1,2d\" message >expected-message &&\n-\n \ttest_commit A A &&\n \ttest_commit B B &&\n \tget_author HEAD >expected-author &&\n@@ -134,6 +132,7 @@ test_expect_success 'simple fixup -c works' '\n test_expect_success 'fixup -C removes amend! from message' '\n \ttest_when_finished \"test_might_fail git rebase --abort\" &&\n \tgit checkout --detach A1 &&\n+\tgit log -1 --pretty=format:%b >expected-message &&\n \tFAKE_LINES=\"1 fixup-C 2\" git rebase -i A &&\n \ttest_cmp_rev HEAD^ A &&\n \ttest_cmp_rev HEAD^{tree} A1^{tree} &&\n@@ -145,13 +144,14 @@ test_expect_success 'fixup -C removes amend! from message' '\n test_expect_success 'fixup -C with conflicts gives correct message' '\n \ttest_when_finished \"test_might_fail git rebase --abort\" &&\n \tgit checkout --detach A1 &&\n+\tgit log -1 --pretty=format:%b >expected-message &&\n+\ttest_write_lines \"\" \"edited\" >>expected-message &&\n \ttest_must_fail env FAKE_LINES=\"1 fixup-C 2\" git rebase -i conflicts &&\n \tgit checkout --theirs -- A &&\n \tgit add A &&\n \tFAKE_COMMIT_AMEND=edited git rebase --continue &&\n \ttest_cmp_rev HEAD^ conflicts &&\n \ttest_cmp_rev HEAD^{tree} A1^{tree} &&\n-\ttest_write_lines \"\" edited >>expected-message &&\n \ttest_commit_message HEAD expected-message &&\n \tget_author HEAD >actual-author &&\n \ttest_cmp expected-author actual-author\n-- \n2.29.0.rc1\n\n"},{"id":"416431","messageId":"20210208192528.21399-8-charvi077@gmail.com","threadId":"55117","inReplyTo":"20210207181439.1178-1-charvi077@gmail.com","subject":"[PATCH v2 07/11] t/t3437: check author date of the fixed up commit","fromName":"Charvi Mendiratta","fromEmail":"charvi077@gmail.com","sentAt":"2021-02-08T19:25:27Z","receivedAt":"2021-02-08T19:31:55Z","isPatch":true,"sender":{"key":"charvi077@gmail.com","avatar":"https://avatars.githubusercontent.com/u/32788121?v=4"},"body":"Add '%at' format in the get_author() function and update the test to check\nthat the author date of the fixed up commit is unchanged.\n\nMentored-by: Christian Couder <chriscool@tuxfamily.org>\nMentored-by: Phillip Wood <phillip.wood@dunelm.org.uk>\nHelped-by: Eric Sunshine <sunshine@sunshineco.com>\nSigned-off-by: Charvi Mendiratta <charvi077@gmail.com>\n---\n t/t3437-rebase-fixup-options.sh | 4 +++-\n 1 file changed, 3 insertions(+), 1 deletion(-)\n\ndiff --git a/t/t3437-rebase-fixup-options.sh b/t/t3437-rebase-fixup-options.sh\nindex 242770a3ec..180fc50248 100755\n--- a/t/t3437-rebase-fixup-options.sh\n+++ b/t/t3437-rebase-fixup-options.sh\n@@ -33,7 +33,7 @@ test_commit_message () {\n\n get_author () {\n \trev=\"$1\" &&\n-\tgit log -1 --pretty=format:\"%an %ae\" \"$rev\"\n+\tgit log -1 --pretty=format:\"%an %ae %at\" \"$rev\"\n }\n\n test_expect_success 'setup' '\n@@ -196,6 +196,8 @@ test_expect_success 'multiple fixup -c opens editor once' '\n \t\tEXPECT_HEADER_COUNT=4 \\\n \t\tgit rebase -i $base &&\n \ttest_cmp_rev $base HEAD^ &&\n+\tget_author HEAD >actual-author &&\n+\ttest_cmp expected-author actual-author &&\n \ttest 1 = $(git show | grep Modified-A3 | wc -l)\n '\n\n--\n2.29.0.rc1\n\n"},{"id":"416432","messageId":"20210208192528.21399-11-charvi077@gmail.com","threadId":"55117","inReplyTo":"20210207181439.1178-1-charvi077@gmail.com","subject":"[PATCH v2 10/11] t/t3437: fixup the test 'multiple fixup -c opens editor once'","fromName":"Charvi Mendiratta","fromEmail":"charvi077@gmail.com","sentAt":"2021-02-08T19:25:30Z","receivedAt":"2021-02-08T19:33:02Z","isPatch":true,"sender":{"key":"charvi077@gmail.com","avatar":"https://avatars.githubusercontent.com/u/32788121?v=4"},"body":"In the test, FAKE_COMMIT_MESSAGE replaces the commit message each\ntime it is invoked so there will be only one instance of \"Modified-A3\"\nno matter how many times we invoke the editor. Let's fix this and use\nFAKE_COMMIT_AMEND instead so that it adds \"Modified-A3\" once for each\ntime the editor is invoked.\n\nThis patch also removes the check for counting the number of\n\"Modified-A3\" lines and instead compares the whole message to check\nthat the commenting code works correctly for 'fixup -c' as well as\n'fixup -C'.\n\nMentored-by: Christian Couder <chriscool@tuxfamily.org>\nMentored-by: Phillip Wood <phillip.wood@dunelm.org.uk>\nHelped-by: Eric Sunshine <sunshine@sunshineco.com>\nSigned-off-by: Charvi Mendiratta <charvi077@gmail.com>\n---\n t/t3437-rebase-fixup-options.sh | 6 ++++--\n 1 file changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t3437-rebase-fixup-options.sh b/t/t3437-rebase-fixup-options.sh\nindex d651fb8901..6899d25393 100755\n--- a/t/t3437-rebase-fixup-options.sh\n+++ b/t/t3437-rebase-fixup-options.sh\n@@ -197,14 +197,16 @@ test_expect_success 'first fixup -C commented out in sequence fixup fixup -C fix\n test_expect_success 'multiple fixup -c opens editor once' '\n \ttest_when_finished \"test_might_fail git rebase --abort\" &&\n \tgit checkout --detach A3 &&\n-\tFAKE_COMMIT_MESSAGE=\"Modified-A3\" \\\n+\tgit log -1 --pretty=format:%B >expected-message &&\n+\ttest_write_lines \"\" \"Modified-A3\" >>expected-message &&\n+\tFAKE_COMMIT_AMEND=\"Modified-A3\" \\\n \t\tFAKE_LINES=\"1 fixup-C 2 fixup-c 3 fixup-c 4\" \\\n \t\tEXPECT_HEADER_COUNT=4 \\\n \t\tgit rebase -i A &&\n \ttest_cmp_rev HEAD^ A &&\n \tget_author HEAD >actual-author &&\n \ttest_cmp expected-author actual-author &&\n-\ttest 1 = $(git show | grep Modified-A3 | wc -l)\n+\ttest_commit_message HEAD expected-message\n '\n \n test_expect_success 'sequence squash, fixup & fixup -c gives combined message' '\n-- \n2.29.0.rc1\n\n"},{"id":"416433","messageId":"20210208192528.21399-9-charvi077@gmail.com","threadId":"55117","inReplyTo":"20210207181439.1178-1-charvi077@gmail.com","subject":"[PATCH v2 08/11] t/t3437: simplify and document the test helpers","fromName":"Charvi Mendiratta","fromEmail":"charvi077@gmail.com","sentAt":"2021-02-08T19:25:28Z","receivedAt":"2021-02-08T19:33:02Z","isPatch":true,"sender":{"key":"charvi077@gmail.com","avatar":"https://avatars.githubusercontent.com/u/32788121?v=4"},"body":"Let's simplify the test_commit_message() helper function and add\ncomments to the function.\n\nThis patch also document the working of 'fixup -C' with \"amend!\" in the\ntest-description.\n\nMentored-by: Christian Couder <chriscool@tuxfamily.org>\nMentored-by: Phillip Wood <phillip.wood@dunelm.org.uk>\nHelped-by: Eric Sunshine <sunshine@sunshineco.com>\nSigned-off-by: Charvi Mendiratta <charvi077@gmail.com>\n---\n t/t3437-rebase-fixup-options.sh | 26 +++++++++++++++-----------\n 1 file changed, 15 insertions(+), 11 deletions(-)\n\ndiff --git a/t/t3437-rebase-fixup-options.sh b/t/t3437-rebase-fixup-options.sh\nindex 180fc50248..cc0ae9411a 100755\n--- a/t/t3437-rebase-fixup-options.sh\n+++ b/t/t3437-rebase-fixup-options.sh\n@@ -9,7 +9,9 @@ This test checks the \"fixup [-C|-c]\" command of rebase interactive.\n In addition to amending the contents of the commit, \"fixup -C\"\n replaces the original commit message with the message of the fixup\n commit. \"fixup -c\" also replaces the original message, but opens the\n-editor to allow the user to edit the message before committing.\n+editor to allow the user to edit the message before committing. Similar\n+to the \"fixup\" command that works with \"fixup!\", \"fixup -C\" works with\n+\"amend!\" upon --autosquash.\n '\n \n . ./test-lib.sh\n@@ -18,17 +20,19 @@ editor to allow the user to edit the message before committing.\n \n EMPTY=\"\"\n \n+# test_commit_message <rev> -m <msg>\n+# test_commit_message <rev> <path>\n+# Verify that the commit message of <rev> matches\n+# <msg> or the content of <path>.\n test_commit_message () {\n-\trev=\"$1\" && # commit or tag we want to test\n-\tfile=\"$2\" && # test against the content of a file\n-\tgit show --no-patch --pretty=format:%B \"$rev\" >actual-message &&\n-\tif test \"$2\" = -m\n-\tthen\n-\t\tstr=\"$3\" && # test against a string\n-\t\tprintf \"%s\\n\" \"$str\" >tmp-expected-message &&\n-\t\tfile=\"tmp-expected-message\"\n-\tfi\n-\ttest_cmp \"$file\" actual-message\n+\tgit show --no-patch --pretty=format:%B \"$1\" >actual &&\n+\tcase \"$2\" in\n+\t-m)\n+\t\techo \"$3\" >expect &&\n+\t\ttest_cmp expect actual ;;\n+\t*)\n+\t\ttest_cmp \"$2\" actual ;;\n+\tesac\n }\n \n get_author () {\n-- \n2.29.0.rc1\n\n"},{"id":"416434","messageId":"20210208192528.21399-10-charvi077@gmail.com","threadId":"55117","inReplyTo":"20210207181439.1178-1-charvi077@gmail.com","subject":"[PATCH v2 09/11] t/t3437: cleanup the 'setup' test and use named commits in the tests","fromName":"Charvi Mendiratta","fromEmail":"charvi077@gmail.com","sentAt":"2021-02-08T19:25:29Z","receivedAt":"2021-02-08T19:33:05Z","isPatch":true,"sender":{"key":"charvi077@gmail.com","avatar":"https://avatars.githubusercontent.com/u/32788121?v=4"},"body":"Remove unnecessary curly braces and use the named commits in the\ntests so that they will still refer to the same commit if the setup\ngets changed in the future whereas 'branch~2' will change which commit\nit points to.\n\nMentored-by: Christian Couder <chriscool@tuxfamily.org>\nMentored-by: Phillip Wood <phillip.wood@dunelm.org.uk>\nHelped-by: Eric Sunshine <sunshine@sunshineco.com>\nSigned-off-by: Charvi Mendiratta <charvi077@gmail.com>\n---\n t/t3437-rebase-fixup-options.sh | 40 +++++++++++++++++----------------\n 1 file changed, 21 insertions(+), 19 deletions(-)\n\ndiff --git a/t/t3437-rebase-fixup-options.sh b/t/t3437-rebase-fixup-options.sh\nindex cc0ae9411a..d651fb8901 100755\n--- a/t/t3437-rebase-fixup-options.sh\n+++ b/t/t3437-rebase-fixup-options.sh\n@@ -43,9 +43,9 @@ get_author () {\n test_expect_success 'setup' '\n \tcat >message <<-EOF &&\n \tamend! B\n-\t${EMPTY}\n+\t$EMPTY\n \tnew subject\n-\t${EMPTY}\n+\t$EMPTY\n \tnew\n \tbody\n \tEOF\n@@ -70,40 +70,43 @@ test_expect_success 'setup' '\n \techo B1 >B &&\n \ttest_tick &&\n \tgit commit --fixup=HEAD -a &&\n+\tgit tag B1 &&\n \ttest_tick &&\n \tgit commit --allow-empty -F - <<-EOF &&\n \tamend! B\n-\t${EMPTY}\n+\t$EMPTY\n \tB\n-\t${EMPTY}\n+\t$EMPTY\n \tedited 1\n \tEOF\n \ttest_tick &&\n \tgit commit --allow-empty -F - <<-EOF &&\n \tamend! amend! B\n-\t${EMPTY}\n+\t$EMPTY\n \tB\n-\t${EMPTY}\n+\t$EMPTY\n \tedited 1\n-\t${EMPTY}\n+\t$EMPTY\n \tedited 2\n \tEOF\n \techo B2 >B &&\n \ttest_tick &&\n \tFAKE_COMMIT_AMEND=\"edited squash\" git commit --squash=HEAD -a &&\n+\tgit tag B2 &&\n \techo B3 >B &&\n \ttest_tick &&\n \tgit commit -a -F - <<-EOF &&\n \tamend! amend! amend! B\n-\t${EMPTY}\n+\t$EMPTY\n \tB\n-\t${EMPTY}\n+\t$EMPTY\n \tedited 1\n-\t${EMPTY}\n+\t$EMPTY\n \tedited 2\n-\t${EMPTY}\n+\t$EMPTY\n \tedited 3\n \tEOF\n+\tgit tag B3 &&\n \n \tGIT_AUTHOR_NAME=\"Rebase Author\" &&\n \tGIT_AUTHOR_EMAIL=\"rebase.author@example.com\" &&\n@@ -171,12 +174,12 @@ test_expect_success 'skipping fixup -C after fixup gives correct message' '\n '\n \n test_expect_success 'sequence of fixup, fixup -C & squash --signoff works' '\n-\tgit checkout --detach branch &&\n+\tgit checkout --detach B3 &&\n \tFAKE_LINES=\"1 fixup 2 fixup-C 3 fixup-C 4 squash 5 fixup-C 6\" \\\n \t\tFAKE_COMMIT_AMEND=squashed \\\n \t\tFAKE_MESSAGE_COPY=actual-squash-message \\\n \t\tgit -c commit.status=false rebase -ik --signoff A &&\n-\tgit diff-tree --exit-code --patch HEAD branch -- &&\n+\tgit diff-tree --exit-code --patch HEAD B3 -- &&\n \ttest_cmp_rev HEAD^ A &&\n \ttest_i18ncmp \"$TEST_DIRECTORY/t3437/expected-squash-message\" \\\n \t\tactual-squash-message\n@@ -184,7 +187,7 @@ test_expect_success 'sequence of fixup, fixup -C & squash --signoff works' '\n \n test_expect_success 'first fixup -C commented out in sequence fixup fixup -C fixup -C' '\n \ttest_when_finished \"test_might_fail git rebase --abort\" &&\n-\tgit checkout branch && git checkout --detach branch~2 &&\n+\tgit checkout --detach B2~ &&\n \tgit log -1 --pretty=format:%b >expected-message &&\n \tFAKE_LINES=\"1 fixup 2 fixup-C 3 fixup-C 4\" git rebase -i A &&\n \ttest_cmp_rev HEAD^ A &&\n@@ -194,12 +197,11 @@ test_expect_success 'first fixup -C commented out in sequence fixup fixup -C fix\n test_expect_success 'multiple fixup -c opens editor once' '\n \ttest_when_finished \"test_might_fail git rebase --abort\" &&\n \tgit checkout --detach A3 &&\n-\tbase=$(git rev-parse HEAD~4) &&\n \tFAKE_COMMIT_MESSAGE=\"Modified-A3\" \\\n \t\tFAKE_LINES=\"1 fixup-C 2 fixup-c 3 fixup-c 4\" \\\n \t\tEXPECT_HEADER_COUNT=4 \\\n-\t\tgit rebase -i $base &&\n-\ttest_cmp_rev $base HEAD^ &&\n+\t\tgit rebase -i A &&\n+\ttest_cmp_rev HEAD^ A &&\n \tget_author HEAD >actual-author &&\n \ttest_cmp expected-author actual-author &&\n \ttest 1 = $(git show | grep Modified-A3 | wc -l)\n@@ -217,12 +219,12 @@ test_expect_success 'sequence squash, fixup & fixup -c gives combined message' '\n '\n \n test_expect_success 'fixup -C works upon --autosquash with amend!' '\n-\tgit checkout --detach branch &&\n+\tgit checkout --detach B3 &&\n \tFAKE_COMMIT_AMEND=squashed \\\n \t\tFAKE_MESSAGE_COPY=actual-squash-message \\\n \t\tgit -c commit.status=false rebase -ik --autosquash \\\n \t\t\t\t\t\t--signoff A &&\n-\tgit diff-tree --exit-code --patch HEAD branch -- &&\n+\tgit diff-tree --exit-code --patch HEAD B3 -- &&\n \ttest_cmp_rev HEAD^ A &&\n \ttest_i18ncmp \"$TEST_DIRECTORY/t3437/expected-squash-message\" \\\n \t\tactual-squash-message\n-- \n2.29.0.rc1\n\n"},{"id":"416435","messageId":"20210208192528.21399-12-charvi077@gmail.com","threadId":"55117","inReplyTo":"20210207181439.1178-1-charvi077@gmail.com","subject":"[PATCH v2 11/11] doc/rebase -i: fix typo in the documentation of 'fixup' command","fromName":"Charvi Mendiratta","fromEmail":"charvi077@gmail.com","sentAt":"2021-02-08T19:25:31Z","receivedAt":"2021-02-08T19:33:05Z","isPatch":true,"sender":{"key":"charvi077@gmail.com","avatar":"https://avatars.githubusercontent.com/u/32788121?v=4"},"body":"Mentored-by: Christian Couder <chriscool@tuxfamily.org>\nMentored-by: Phillip Wood <phillip.wood@dunelm.org.uk>\nHelped-by: Eric Sunshine <sunshine@sunshineco.com>\nSigned-off-by: Charvi Mendiratta <charvi077@gmail.com>\n---\n Documentation/git-rebase.txt | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt\nindex a6903419c4..8bfa5a9272 100644\n--- a/Documentation/git-rebase.txt\n+++ b/Documentation/git-rebase.txt\n@@ -894,7 +894,7 @@ is used.  In that case the suggested commit message is only the message\n of the \"fixup -c\" commit, and an editor is opened allowing you to edit\n the message.  The contents (patch) of the \"fixup -c\" commit are still\n incorporated into the folded commit. If there is more than one \"fixup -c\"\n-commit, the message from the last last one is used.  You can also use\n+commit, the message from the final one is used.  You can also use\n \"fixup -C\" to get the same behavior as \"fixup -c\" except without opening\n an editor.\n \n-- \n2.29.0.rc1\n\n"},{"id":"416443","messageId":"xmqq5z325k3j.fsf@gitster.c.googlers.com","threadId":"55117","inReplyTo":"20210208192528.21399-4-charvi077@gmail.com","subject":"Re: [PATCH v2 03/11] rebase -i: clarify and fix 'fixup -c' rebase-todo help","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-02-08T21:24:16Z","receivedAt":"2021-02-08T21:26:06Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Charvi Mendiratta <charvi077@gmail.com> writes:\n\n> When `-c` says \"edit the commit message\" it's not clear what will be\n> edited. The original's commit message or the replacement's message or a\n> combination of the two. Word it such that it states more precisely what\n> exactly will be edited. While at it, also drop the jarring period and\n> capitalization, neither of which is otherwise present in the message.\n\n>\n> Mentored-by: Christian Couder <chriscool@tuxfamily.org>\n> Mentored-by: Phillip Wood <phillip.wood@dunelm.org.uk>\n> Helped-by: Eric Sunshine <sunshine@sunshineco.com>\n> Signed-off-by: Charvi Mendiratta <charvi077@gmail.com>\n> ---\n>  rebase-interactive.c | 6 +++---\n>  1 file changed, 3 insertions(+), 3 deletions(-)\n>\n> diff --git a/rebase-interactive.c b/rebase-interactive.c\n> index c3bd02adee..e85994beb6 100644\n> --- a/rebase-interactive.c\n> +++ b/rebase-interactive.c\n> @@ -45,8 +45,8 @@ void append_todo_help(int command_count,\n>  \"e, edit <commit> = use commit, but stop for amending\\n\"\n>  \"s, squash <commit> = use commit, but meld into previous commit\\n\"\n>  \"f, fixup [-C | -c] <commit> = like \\\"squash\\\", but discard this\\n\"\n> -\"                   commit's log message. Use -C to replace with this\\n\"\n> -\"                   commit message or -c to edit the commit message\\n\"\n> +\"                   commit's log message; use -C to replace with this\\n\"\n> +\"                   commit message or -c to edit this commit message\\n\"\n\nThe goal is good, but I am not sure if this \"the commit\" -> \"this commit\"\nis an effective enough way to fix the issue.  Here is my attempt but\nI do not think it is not 10x better to be worth replacing yours X-<.\n\n    use only the log message of the \"fixup\" commit, discarding the\n    message from the previous commit.  While \"-C\" uses the message\n    as-is, \"-c\" lets the user further edit it.\n\n>  \"x, exec <command> = run command (the rest of the line) using shell\\n\"\n>  \"b, break = stop here (continue rebase later with 'git rebase --continue')\\n\"\n>  \"d, drop <commit> = remove commit\\n\"\n> @@ -55,7 +55,7 @@ void append_todo_help(int command_count,\n>  \"m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]\\n\"\n>  \".       create a merge commit using the original merge commit's\\n\"\n>  \".       message (or the oneline, if no original merge commit was\\n\"\n> -\".       specified). Use -c <commit> to reword the commit message.\\n\"\n> +\".       specified); use -c <commit> to reword the commit message\\n\"\n\nThis hunk fixes the formatting by dropping the full-stop.  Unlike\nthe description of \"fixup -C/-c\", I find it very easy to understand.\n\nThanks.\n"},{"id":"416444","messageId":"xmqq1rdq5jis.fsf@gitster.c.googlers.com","threadId":"55117","inReplyTo":"20210208192528.21399-5-charvi077@gmail.com","subject":"Re: [PATCH v2 04/11] t/lib-rebase: change the implementation of commands with options","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-02-08T21:36:43Z","receivedAt":"2021-02-08T21:38:28Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Charvi Mendiratta <charvi077@gmail.com> writes:\n\n> However, \"fixup\" is very different from \"exec\". Its arguments are not\n> arbitrary at all, so there isn't a good reason to mirror the choice of\n> \"_\" to represent a space, which leads to rather unsightly tokens such\n> as \"fixup_-C\". Let's replace it with simpler tokens such as \"fixup-C\"\n> and \"fixup-c\".\n\nSadly, I have to say that this change may be making the developer\nexperience worse.\n\nTo use the original, test writers only need to remember a single\nrule: \"when a single command needs to embed a SP, replace it with\nunderscore\" regardless of which insn they are listing in FAKE_LINES.\n\nNow they need to remember that rule only applies to exec, and merge\nand fixup uses a different rule, namely, a SP immediately before a\ndash must be removed.\n\nSo, if I didn't know you folks have invested enough hours in this\npatch, I would have said not to do this, but it is such a small\nchange, its effect isolated to only those who would be writing tests\nfor \"rebase -i\", it may be OK to let them endure a bit additional\nburden to remember an extra rule with this patch.  I dunno.\n"},{"id":"416445","messageId":"xmqqwnvi44qi.fsf@gitster.c.googlers.com","threadId":"55117","inReplyTo":"20210208192528.21399-10-charvi077@gmail.com","subject":"Re: [PATCH v2 09/11] t/t3437: cleanup the 'setup' test and use named commits in the tests","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-02-08T21:41:25Z","receivedAt":"2021-02-08T21:43:14Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Charvi Mendiratta <charvi077@gmail.com> writes:\n\n> Remove unnecessary curly braces and use the named commits in the\n> tests so that they will still refer to the same commit if the setup\n> gets changed in the future whereas 'branch~2' will change which commit\n> it points to.\n\nDoing two things in the same commit?  I think ${EMPTY} thing is a\ngeneral style clean-up, while tagging is a bit more meaningful\nchange to make it easier to understand tests and is a change at a\nmore conceptual level.  The ${EMPTY} change would be better done at\nthe same time when the here document was cleaned up in [v2 05/11],\nI would think.\n\nThanks.\n"},{"id":"416447","messageId":"xmqqsg664400.fsf@gitster.c.googlers.com","threadId":"55117","inReplyTo":"20210208192528.21399-1-charvi077@gmail.com","subject":"Re: [PATCH v2 00/11][Outreachy] Improve the 'fixup [-C | -c]' in interactive rebase","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-02-08T21:57:19Z","receivedAt":"2021-02-08T21:58:35Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Charvi Mendiratta <charvi077@gmail.com> writes:\n\n> This patch series is build on the top of \"cm/rebase-i\" in the 'next' branch and\n> improves it. It fixup the source code of 'fixup [-C | -c]' command in the\n> sequencer, do some fixes in rebase -i, improves the 'fixup_-C' like commands\n> in lib-rebase.sh, update the test-script 't3437' and fixes a typo in the\n> documentation.\n\nThanks.  I saw a couple of minor nits, but overall it was a pleasant\nread.\n\n"},{"id":"416457","messageId":"CAP8UFD1GV2s4SjB3YaT5qiW+E12-hikMEiFoU_LV81aK14g8bA@mail.gmail.com","threadId":"55117","inReplyTo":"xmqq1rdq5jis.fsf@gitster.c.googlers.com","subject":"Re: [PATCH v2 04/11] t/lib-rebase: change the implementation of commands with options","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2021-02-08T23:19:17Z","receivedAt":"2021-02-08T23:20:12Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Mon, Feb 8, 2021 at 10:36 PM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Charvi Mendiratta <charvi077@gmail.com> writes:\n>\n> > However, \"fixup\" is very different from \"exec\". Its arguments are not\n> > arbitrary at all, so there isn't a good reason to mirror the choice of\n> > \"_\" to represent a space, which leads to rather unsightly tokens such\n> > as \"fixup_-C\". Let's replace it with simpler tokens such as \"fixup-C\"\n> > and \"fixup-c\".\n>\n> Sadly, I have to say that this change may be making the developer\n> experience worse.\n>\n> To use the original, test writers only need to remember a single\n> rule: \"when a single command needs to embed a SP, replace it with\n> underscore\" regardless of which insn they are listing in FAKE_LINES.\n>\n> Now they need to remember that rule only applies to exec, and merge\n> and fixup uses a different rule, namely, a SP immediately before a\n> dash must be removed.\n\nI agree with that, and discussed it with Eric. See:\n\nhttps://lore.kernel.org/git/CAPig+cSBVG0AdyqXH2mZp6Ohrcb8_ec1Mm_vGbQM4zWT_7yYxQ@mail.gmail.com/\n\nThe discussion was:\n\n-----------------------\n\n> > > However, \"fixup\" is a very different beast. Its arguments are not\n> > > arbitrary at all, so there isn't a good reason to mirror the choice of\n> > > \"_\" to represent a space, which leads to rather unsightly tokens such\n> > > as \"fixup_-C\". It would work just as well to use simpler tokens such\n> > > as \"fixup-C\" and \"fixup-c\", in which case t/lib-rebase.sh might parse\n> > > them like this (note that I also dropped `g` from the `sed` action):\n> > >\n> > >     fixup-*)\n> > >         action=$(echo \"$line\" | sed 's/-/ -/');;\n> >\n> > I agree that \"fixup\" arguments are not arbitrary at all, but I think\n> > it makes things simpler to just use one way to encode spaces instead\n> > of many different ways.\n>\n> Is that the intention here, though? Is the idea that some day `fixup`\n> will accept arbitrary arguments thus needs to encode spaces? If not,\n> then mirroring the treatment given to `exec` confuses readers into\n> thinking that it will/should accept arbitrary arguments. I brought\n> this up in my review specifically because it was confusing to a person\n> (me) new to this topic and reading the patches for the first time. The\n> more specific and exact the code can be, the less likely it will\n> confuse readers in the future.\n\n-----------------------\n\n> So, if I didn't know you folks have invested enough hours in this\n> patch, I would have said not to do this, but it is such a small\n> change, its effect isolated to only those who would be writing tests\n> for \"rebase -i\", it may be OK to let them endure a bit additional\n> burden to remember an extra rule with this patch.  I dunno.\n\nI would be ok with dropping this patch. It might be a good idea to\nimprove the documentation before the function though.\n"},{"id":"416473","messageId":"CAPSFM5dN=gs7m8VskCPMzD10i42ETQ_7UzuGKmi=X-xs2QkYSg@mail.gmail.com","threadId":"55117","inReplyTo":"xmqq5z325k3j.fsf@gitster.c.googlers.com","subject":"Re: [PATCH v2 03/11] rebase -i: clarify and fix 'fixup -c' rebase-todo help","fromName":"Charvi Mendiratta","fromEmail":"charvi077@gmail.com","sentAt":"2021-02-09T07:13:11Z","receivedAt":"2021-02-09T07:14:19Z","isPatch":true,"sender":{"key":"charvi077@gmail.com","avatar":"https://avatars.githubusercontent.com/u/32788121?v=4"},"body":"Hi Junio,\n\n> >  \"f, fixup [-C | -c] <commit> = like \\\"squash\\\", but discard this\\n\"\n> > -\"                   commit's log message. Use -C to replace with this\\n\"\n> > -\"                   commit message or -c to edit the commit message\\n\"\n> > +\"                   commit's log message; use -C to replace with this\\n\"\n> > +\"                   commit message or -c to edit this commit message\\n\"\n>\n> The goal is good, but I am not sure if this \"the commit\" -> \"this commit\"\n> is an effective enough way to fix the issue.  Here is my attempt but\n> I do not think it is not 10x better to be worth replacing yours X-<.\n>\n>     use only the log message of the \"fixup\" commit, discarding the\n>     message from the previous commit.  While \"-C\" uses the message\n>     as-is, \"-c\" lets the user further edit it.\n>\n\nOkay, but in this patch we are also removing period and capitalization from\nrebase to-do help of commands. So, maybe we can replace it like :\n\nf, fixup [-C | -c] <commit> = like \\\"squash\\\", but discard this\\n\"\n \"                  commit's log message; use -C to use only the\\n\"\n \"                  log message of the \"fixup\" commit, discarding the\\n\"\n \"                  message from the previous commit; while -C uses \\n\"\n \"                  the message as-is, -c allows to further edit it\\n\"\n\nIf it is okay ?\n\nThanks and Regards,\nCharvi\n"},{"id":"416474","messageId":"CAPSFM5dWP+_NzbVJvWdCQq3Q6bz70hm9z4W4eFhVKFzwQgQqmw@mail.gmail.com","threadId":"55117","inReplyTo":"xmqqwnvi44qi.fsf@gitster.c.googlers.com","subject":"Re: [PATCH v2 09/11] t/t3437: cleanup the 'setup' test and use named commits in the tests","fromName":"Charvi Mendiratta","fromEmail":"charvi077@gmail.com","sentAt":"2021-02-09T07:13:30Z","receivedAt":"2021-02-09T07:14:54Z","isPatch":true,"sender":{"key":"charvi077@gmail.com","avatar":"https://avatars.githubusercontent.com/u/32788121?v=4"},"body":"On Tue, 9 Feb 2021 at 03:11, Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Charvi Mendiratta <charvi077@gmail.com> writes:\n>\n> > Remove unnecessary curly braces and use the named commits in the\n> > tests so that they will still refer to the same commit if the setup\n> > gets changed in the future whereas 'branch~2' will change which commit\n> > it points to.\n>\n> Doing two things in the same commit?  I think ${EMPTY} thing is a\n> general style clean-up, while tagging is a bit more meaningful\n> change to make it easier to understand tests and is a change at a\n> more conceptual level.  The ${EMPTY} change would be better done at\n> the same time when the here document was cleaned up in [v2 05/11],\n> I would think.\n>\n\nOkay, will move it to the other patch.\n\nThanks and Regards,\nCharvi\n"},{"id":"416475","messageId":"CAPSFM5fdpvb9uOFpZvy_Le3+33nbq6yE8ZBDxAXBBDgNhYU0dg@mail.gmail.com","threadId":"55117","inReplyTo":"CAP8UFD1GV2s4SjB3YaT5qiW+E12-hikMEiFoU_LV81aK14g8bA@mail.gmail.com","subject":"Re: [PATCH v2 04/11] t/lib-rebase: change the implementation of commands with options","fromName":"Charvi Mendiratta","fromEmail":"charvi077@gmail.com","sentAt":"2021-02-09T07:19:05Z","receivedAt":"2021-02-09T07:21:13Z","isPatch":true,"sender":{"key":"charvi077@gmail.com","avatar":"https://avatars.githubusercontent.com/u/32788121?v=4"},"body":"> I agree with that, and discussed it with Eric. See:\n>\n> https://lore.kernel.org/git/CAPig+cSBVG0AdyqXH2mZp6Ohrcb8_ec1Mm_vGbQM4zWT_7yYxQ@mail.gmail.com/\n>\n> The discussion was:\n>\n> -----------------------\n>\n> > > > However, \"fixup\" is a very different beast. Its arguments are not\n> > > > arbitrary at all, so there isn't a good reason to mirror the choice of\n> > > > \"_\" to represent a space, which leads to rather unsightly tokens such\n> > > > as \"fixup_-C\". It would work just as well to use simpler tokens such\n> > > > as \"fixup-C\" and \"fixup-c\", in which case t/lib-rebase.sh might parse\n> > > > them like this (note that I also dropped `g` from the `sed` action):\n> > > >\n> > > >     fixup-*)\n> > > >         action=$(echo \"$line\" | sed 's/-/ -/');;\n> > >\n> > > I agree that \"fixup\" arguments are not arbitrary at all, but I think\n> > > it makes things simpler to just use one way to encode spaces instead\n> > > of many different ways.\n> >\n> > Is that the intention here, though? Is the idea that some day `fixup`\n> > will accept arbitrary arguments thus needs to encode spaces? If not,\n> > then mirroring the treatment given to `exec` confuses readers into\n> > thinking that it will/should accept arbitrary arguments. I brought\n> > this up in my review specifically because it was confusing to a person\n> > (me) new to this topic and reading the patches for the first time. The\n> > more specific and exact the code can be, the less likely it will\n> > confuse readers in the future.\n>\n> -----------------------\n>\n> > So, if I didn't know you folks have invested enough hours in this\n> > patch, I would have said not to do this, but it is such a small\n> > change, its effect isolated to only those who would be writing tests\n> > for \"rebase -i\", it may be OK to let them endure a bit additional\n> > burden to remember an extra rule with this patch.  I dunno.\n>\n> I would be ok with dropping this patch.\n\nEarlier from the discussions I thought it would be ok to make separate rules for\ncommand taking arbitrary arguments(exec) and the command taking single\noption(fixup).\n\nBut I also agree we can make the same rules and will remove it.\n\n> It might be a good idea to\n> improve the documentation before the function though.\n\nOkay, Maybe we can improve like below:\n\nupdate the current comment:\n# \"exec_cmd_with_args\" -- add an \"exec cmd with args\" line.\n\nwith:\n# \"_\" -- add a space, like \"fixup_-C\" implies \"fixup -C\" and\n#        \"exec_cmd_with_args\" add an \"exec cmd with args\" line.\n\nThanks and Regards,\nCharvi.\n"},{"id":"416476","messageId":"CAPSFM5es01OVGOgDOHpBnCrTQpb_NebB9PganVJi7us7pHnV7w@mail.gmail.com","threadId":"55117","inReplyTo":"xmqqsg664400.fsf@gitster.c.googlers.com","subject":"Re: [PATCH v2 00/11][Outreachy] Improve the 'fixup [-C | -c]' in interactive rebase","fromName":"Charvi Mendiratta","fromEmail":"charvi077@gmail.com","sentAt":"2021-02-09T07:19:20Z","receivedAt":"2021-02-09T07:21:19Z","isPatch":true,"sender":{"key":"charvi077@gmail.com","avatar":"https://avatars.githubusercontent.com/u/32788121?v=4"},"body":"On Tue, 9 Feb 2021 at 03:27, Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Charvi Mendiratta <charvi077@gmail.com> writes:\n>\n> > This patch series is build on the top of \"cm/rebase-i\" in the 'next' branch and\n> > improves it. It fixup the source code of 'fixup [-C | -c]' command in the\n> > sequencer, do some fixes in rebase -i, improves the 'fixup_-C' like commands\n> > in lib-rebase.sh, update the test-script 't3437' and fixes a typo in the\n> > documentation.\n>\n> Thanks.  I saw a couple of minor nits, but overall it was a pleasant\n> read.\n>\n\nThanks for feedback! I will fix those nits in the next version.\n\nThanks and Regards,\nCharvi\n"},{"id":"416487","messageId":"CAPig+cSoa4Vw0N53vJgMCWiW5yVS0j1H0ejS_01xs1WDF2d82g@mail.gmail.com","threadId":"55117","inReplyTo":"CAPSFM5dN=gs7m8VskCPMzD10i42ETQ_7UzuGKmi=X-xs2QkYSg@mail.gmail.com","subject":"Re: [PATCH v2 03/11] rebase -i: clarify and fix 'fixup -c' rebase-todo help","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2021-02-09T08:33:40Z","receivedAt":"2021-02-09T08:35:12Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Tue, Feb 9, 2021 at 2:13 AM Charvi Mendiratta <charvi077@gmail.com> wrote:\n> > The goal is good, but I am not sure if this \"the commit\" -> \"this commit\"\n> > is an effective enough way to fix the issue.  Here is my attempt but\n> > I do not think it is not 10x better to be worth replacing yours X-<.\n> >\n> >     use only the log message of the \"fixup\" commit, discarding the\n> >     message from the previous commit.  While \"-C\" uses the message\n> >     as-is, \"-c\" lets the user further edit it.\n>\n> Okay, but in this patch we are also removing period and capitalization from\n> rebase to-do help of commands. So, maybe we can replace it like :\n>\n> f, fixup [-C | -c] <commit> = like \\\"squash\\\", but discard this\\n\"\n>  \"                  commit's log message; use -C to use only the\\n\"\n>  \"                  log message of the \"fixup\" commit, discarding the\\n\"\n>  \"                  message from the previous commit; while -C uses \\n\"\n>  \"                  the message as-is, -c allows to further edit it\\n\"\n\nHere's another more concise attempt:\n\n    like \"squash\" but keep only the previous commit's log message,\n    unless -C is used, in which case keep only this commit's message;\n    -c is same as -C but opens editor\n"},{"id":"416547","messageId":"CAPig+cR0aC-XynowmvAz23-h=LP8+vhF7_c3fUg+M+XHg5o8bA@mail.gmail.com","threadId":"55117","inReplyTo":"xmqq5z312h5w.fsf@gitster.c.googlers.com","subject":"Re: [PATCH v2 03/11] rebase -i: clarify and fix 'fixup -c' rebase-todo help","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2021-02-09T19:13:14Z","receivedAt":"2021-02-09T19:37:19Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Tue, Feb 9, 2021 at 2:08 PM Junio C Hamano <gitster@pobox.com> wrote:\n> Eric Sunshine <sunshine@sunshineco.com> writes:\n> > Here's another more concise attempt:\n> >\n> >     like \"squash\" but keep only the previous commit's log message,\n> >     unless -C is used, in which case keep only this commit's message;\n> >     -c is same as -C but opens editor\n>\n> Nice.\n\nFor conciseness, I intentionally omitted \"the\", however, upon\nreflection, it probably would be a good idea to insert \"the\" between\n\"opens\" and \"editor\".\n"},{"id":"416549","messageId":"xmqq5z312h5w.fsf@gitster.c.googlers.com","threadId":"55117","inReplyTo":"CAPig+cSoa4Vw0N53vJgMCWiW5yVS0j1H0ejS_01xs1WDF2d82g@mail.gmail.com","subject":"Re: [PATCH v2 03/11] rebase -i: clarify and fix 'fixup -c' rebase-todo help","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-02-09T19:08:11Z","receivedAt":"2021-02-09T19:51:34Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Sunshine <sunshine@sunshineco.com> writes:\n\n> Here's another more concise attempt:\n>\n>     like \"squash\" but keep only the previous commit's log message,\n>     unless -C is used, in which case keep only this commit's message;\n>     -c is same as -C but opens editor\n\nNice.\n"},{"id":"416602","messageId":"CAPSFM5dHL-QzzO0tw=1eAwXZ47gp_8xy4L70vgAsStLGaGF3dA@mail.gmail.com","threadId":"55117","inReplyTo":"CAPig+cR0aC-XynowmvAz23-h=LP8+vhF7_c3fUg+M+XHg5o8bA@mail.gmail.com","subject":"Re: [PATCH v2 03/11] rebase -i: clarify and fix 'fixup -c' rebase-todo help","fromName":"Charvi Mendiratta","fromEmail":"charvi077@gmail.com","sentAt":"2021-02-10T05:43:16Z","receivedAt":"2021-02-10T05:44:27Z","isPatch":true,"sender":{"key":"charvi077@gmail.com","avatar":"https://avatars.githubusercontent.com/u/32788121?v=4"},"body":"On Wed, 10 Feb 2021 at 00:43, Eric Sunshine <sunshine@sunshineco.com> wrote:\n>\n> On Tue, Feb 9, 2021 at 2:08 PM Junio C Hamano <gitster@pobox.com> wrote:\n> > Eric Sunshine <sunshine@sunshineco.com> writes:\n> > > Here's another more concise attempt:\n> > >\n> > >     like \"squash\" but keep only the previous commit's log message,\n> > >     unless -C is used, in which case keep only this commit's message;\n> > >     -c is same as -C but opens editor\n> >\n> > Nice.\n>\n> For conciseness, I intentionally omitted \"the\", however, upon\n> reflection, it probably would be a good idea to insert \"the\" between\n> \"opens\" and \"editor\".\n\nOkay, I agree this is also very easy to understand and will update it.\n\nThanks !\n"},{"id":"416614","messageId":"20210210113650.19715-1-charvi077@gmail.com","threadId":"55117","inReplyTo":"20210207181439.1178-1-charvi077@gmail.com","subject":"[PATCH v3 00/11][Outreachy] Improve the 'fixup [-C | -c]' in interactive rebase","fromName":"Charvi Mendiratta","fromEmail":"charvi077@gmail.com","sentAt":"2021-02-10T11:36:40Z","receivedAt":"2021-02-10T11:40:10Z","isPatch":true,"sender":{"key":"charvi077@gmail.com","avatar":"https://avatars.githubusercontent.com/u/32788121?v=4"},"body":"This patch series is build on the top of \"cm/rebase-i\" in the 'next' branch and\nimproves it. It fixup the source code of 'fixup [-C | -c]' command in the\nsequencer, do some fixes in rebase -i, improves the 'fixup_-C' like commands\nin lib-rebase.sh, update the test-script 't3437' and fixes a typo in the\ndocumentation.\n\nChanges from v2 :\n* Update the rebase-todo help\n* Remove the changes and resets to fixup_-* command\n* Update the documentation of FAKE_LINES\n* Move the changes of \"unnecessary curly braces in test\" to the other patch\n  (from v2-9/11 to v2-5/11)\n\nThanks all for the suggestions.\n\nCharvi Mendiratta (11):\n  sequencer: fixup the datatype of the 'flag' argument\n  sequencer: rename a few functions\n  rebase -i: clarify and fix 'fixup -c' rebase-todo help\n  t/lib-rebase: update the documentation of FAKE_LINES\n  t/t3437: fixup here-docs in the 'setup' test\n  t/t3437: remove the dependency of 'expected-message' file from tests\n  t/t3437: check the author date of fixed up commit\n  t/t3437: simplify and document the test helpers\n  t/t3437: use named commits in the tests\n  t/t3437: fixup the test 'multiple fixup -c opens editor once'\n  doc/rebase -i: fix typo in the documentation of 'fixup' command\n\n Documentation/git-rebase.txt    |   2 +-\n rebase-interactive.c            |   9 +--\n sequencer.c                     |  23 +++---\n t/lib-rebase.sh                 |   7 +-\n t/t3437-rebase-fixup-options.sh | 122 +++++++++++++++++---------------\n 5 files changed, 87 insertions(+), 76 deletions(-)\n\n--\n2.29.0.rc1\n\n"},{"id":"416615","messageId":"20210210113650.19715-2-charvi077@gmail.com","threadId":"55117","inReplyTo":"20210207181439.1178-1-charvi077@gmail.com","subject":"[PATCH v3 01/11] sequencer: fixup the datatype of the 'flag' argument","fromName":"Charvi Mendiratta","fromEmail":"charvi077@gmail.com","sentAt":"2021-02-10T11:36:41Z","receivedAt":"2021-02-10T11:40:16Z","isPatch":true,"sender":{"key":"charvi077@gmail.com","avatar":"https://avatars.githubusercontent.com/u/32788121?v=4"},"body":"As 'flag' is a combination of bits, so change its datatype from\n'enum todo_item_flags' to 'unsigned'.\n\nMentored-by: Christian Couder <chriscool@tuxfamily.org>\nMentored-by: Phillip Wood <phillip.wood@dunelm.org.uk>\nHelped-by: Eric Sunshine <sunshine@sunshineco.com>\nSigned-off-by: Charvi Mendiratta <charvi077@gmail.com>\n---\n sequencer.c | 7 +++----\n 1 file changed, 3 insertions(+), 4 deletions(-)\n\ndiff --git a/sequencer.c b/sequencer.c\nindex d09ce446b6..f3928cf45c 100644\n--- a/sequencer.c\n+++ b/sequencer.c\n@@ -1744,8 +1744,7 @@ static const char skip_first_commit_msg_str[] = N_(\"The 1st commit message will\n static const char skip_nth_commit_msg_fmt[] = N_(\"The commit message #%d will be skipped:\");\n static const char combined_commit_msg_fmt[] = N_(\"This is a combination of %d commits.\");\n \n-static int check_fixup_flag(enum todo_command command,\n-\t\t\t    enum todo_item_flags flag)\n+static int check_fixup_flag(enum todo_command command, unsigned flag)\n {\n \treturn command == TODO_FIXUP && ((flag & TODO_REPLACE_FIXUP_MSG) ||\n \t\t\t\t\t (flag & TODO_EDIT_FIXUP_MSG));\n@@ -1850,7 +1849,7 @@ static void update_squash_message_for_fixup(struct strbuf *msg)\n \n static int append_squash_message(struct strbuf *buf, const char *body,\n \t\t\t enum todo_command command, struct replay_opts *opts,\n-\t\t\t enum todo_item_flags flag)\n+\t\t\t unsigned flag)\n {\n \tconst char *fixup_msg;\n \tsize_t commented_len = 0, fixup_off;\n@@ -1906,7 +1905,7 @@ static int update_squash_messages(struct repository *r,\n \t\t\t\t  enum todo_command command,\n \t\t\t\t  struct commit *commit,\n \t\t\t\t  struct replay_opts *opts,\n-\t\t\t\t  enum todo_item_flags flag)\n+\t\t\t\t  unsigned flag)\n {\n \tstruct strbuf buf = STRBUF_INIT;\n \tint res = 0;\n-- \n2.29.0.rc1\n\n"},{"id":"416616","messageId":"20210210113650.19715-4-charvi077@gmail.com","threadId":"55117","inReplyTo":"20210207181439.1178-1-charvi077@gmail.com","subject":"[PATCH v3 03/11] rebase -i: clarify and fix 'fixup -c' rebase-todo help","fromName":"Charvi Mendiratta","fromEmail":"charvi077@gmail.com","sentAt":"2021-02-10T11:36:43Z","receivedAt":"2021-02-10T11:42:36Z","isPatch":true,"sender":{"key":"charvi077@gmail.com","avatar":"https://avatars.githubusercontent.com/u/32788121?v=4"},"body":"When `-c` says \"edit the commit message\" it's not clear what will be\nedited. The original's commit message or the replacement's message or a\ncombination of the two. Word it such that it states more precisely what\nexactly will be edited. While at it, also drop the jarring period and\ncapitalization, neither of which is otherwise present in the message.\n\nMentored-by: Christian Couder <chriscool@tuxfamily.org>\nMentored-by: Phillip Wood <phillip.wood@dunelm.org.uk>\nHelped-by: Eric Sunshine <sunshine@sunshineco.com>\nSigned-off-by: Charvi Mendiratta <charvi077@gmail.com>\n---\n rebase-interactive.c | 9 +++++----\n 1 file changed, 5 insertions(+), 4 deletions(-)\n\ndiff --git a/rebase-interactive.c b/rebase-interactive.c\nindex c3bd02adee..b6cbd16a17 100644\n--- a/rebase-interactive.c\n+++ b/rebase-interactive.c\n@@ -44,9 +44,10 @@ void append_todo_help(int command_count,\n \"r, reword <commit> = use commit, but edit the commit message\\n\"\n \"e, edit <commit> = use commit, but stop for amending\\n\"\n \"s, squash <commit> = use commit, but meld into previous commit\\n\"\n-\"f, fixup [-C | -c] <commit> = like \\\"squash\\\", but discard this\\n\"\n-\"                   commit's log message. Use -C to replace with this\\n\"\n-\"                   commit message or -c to edit the commit message\\n\"\n+\"f, fixup [-C | -c] <commit> = like \\\"squash\\\" but keep only the previous\\n\"\n+\"                   commit's log message, unless -C is used, in which case\\n\"\n+\"                   keep only this commit's message; -c is same as -C but\\n\"\n+\"                   opens the editor\\n\"\n \"x, exec <command> = run command (the rest of the line) using shell\\n\"\n \"b, break = stop here (continue rebase later with 'git rebase --continue')\\n\"\n \"d, drop <commit> = remove commit\\n\"\n@@ -55,7 +56,7 @@ void append_todo_help(int command_count,\n \"m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]\\n\"\n \".       create a merge commit using the original merge commit's\\n\"\n \".       message (or the oneline, if no original merge commit was\\n\"\n-\".       specified). Use -c <commit> to reword the commit message.\\n\"\n+\".       specified); use -c <commit> to reword the commit message\\n\"\n \"\\n\"\n \"These lines can be re-ordered; they are executed from top to bottom.\\n\");\n \tunsigned edit_todo = !(shortrevisions && shortonto);\n-- \n2.29.0.rc1\n\n"},{"id":"416617","messageId":"20210210113650.19715-6-charvi077@gmail.com","threadId":"55117","inReplyTo":"20210207181439.1178-1-charvi077@gmail.com","subject":"[PATCH v3 05/11] t/t3437: fixup here-docs in the 'setup' test","fromName":"Charvi Mendiratta","fromEmail":"charvi077@gmail.com","sentAt":"2021-02-10T11:36:45Z","receivedAt":"2021-02-10T11:42:49Z","isPatch":true,"sender":{"key":"charvi077@gmail.com","avatar":"https://avatars.githubusercontent.com/u/32788121?v=4"},"body":"The most common way to format here-docs in Git test scripts is for the\nbody and EOF to be indented the same amount as the command which opened\nthe here-doc. Fix a few here-docs in this script to conform to that\nstandard and also remove the unnecessary curly braces.\n\nMentored-by: Christian Couder <chriscool@tuxfamily.org>\nMentored-by: Phillip Wood <phillip.wood@dunelm.org.uk>\nHelped-by: Eric Sunshine <sunshine@sunshineco.com>\nSigned-off-by: Charvi Mendiratta <charvi077@gmail.com>\n---\n t/t3437-rebase-fixup-options.sh | 62 ++++++++++++++++-----------------\n 1 file changed, 31 insertions(+), 31 deletions(-)\n\ndiff --git a/t/t3437-rebase-fixup-options.sh b/t/t3437-rebase-fixup-options.sh\nindex 945df2555b..f599da3e08 100755\n--- a/t/t3437-rebase-fixup-options.sh\n+++ b/t/t3437-rebase-fixup-options.sh\n@@ -38,13 +38,13 @@ get_author () {\n \n test_expect_success 'setup' '\n \tcat >message <<-EOF &&\n-\t\tamend! B\n-\t\t${EMPTY}\n-\t\tnew subject\n-\t\t${EMPTY}\n-\t\tnew\n-\t\tbody\n-\t\tEOF\n+\tamend! B\n+\t$EMPTY\n+\tnew subject\n+\t$EMPTY\n+\tnew\n+\tbody\n+\tEOF\n \n \tsed \"1,2d\" message >expected-message &&\n \n@@ -70,38 +70,38 @@ test_expect_success 'setup' '\n \tgit commit --fixup=HEAD -a &&\n \ttest_tick &&\n \tgit commit --allow-empty -F - <<-EOF &&\n-\t\tamend! B\n-\t\t${EMPTY}\n-\t\tB\n-\t\t${EMPTY}\n-\t\tedited 1\n-\t\tEOF\n+\tamend! B\n+\t$EMPTY\n+\tB\n+\t$EMPTY\n+\tedited 1\n+\tEOF\n \ttest_tick &&\n \tgit commit --allow-empty -F - <<-EOF &&\n-\t\tamend! amend! B\n-\t\t${EMPTY}\n-\t\tB\n-\t\t${EMPTY}\n-\t\tedited 1\n-\t\t${EMPTY}\n-\t\tedited 2\n-\t\tEOF\n+\tamend! amend! B\n+\t$EMPTY\n+\tB\n+\t$EMPTY\n+\tedited 1\n+\t$EMPTY\n+\tedited 2\n+\tEOF\n \techo B2 >B &&\n \ttest_tick &&\n \tFAKE_COMMIT_AMEND=\"edited squash\" git commit --squash=HEAD -a &&\n \techo B3 >B &&\n \ttest_tick &&\n \tgit commit -a -F - <<-EOF &&\n-\t\tamend! amend! amend! B\n-\t\t${EMPTY}\n-\t\tB\n-\t\t${EMPTY}\n-\t\tedited 1\n-\t\t${EMPTY}\n-\t\tedited 2\n-\t\t${EMPTY}\n-\t\tedited 3\n-\t\tEOF\n+\tamend! amend! amend! B\n+\t$EMPTY\n+\tB\n+\t$EMPTY\n+\tedited 1\n+\t$EMPTY\n+\tedited 2\n+\t$EMPTY\n+\tedited 3\n+\tEOF\n \n \tGIT_AUTHOR_NAME=\"Rebase Author\" &&\n \tGIT_AUTHOR_EMAIL=\"rebase.author@example.com\" &&\n-- \n2.29.0.rc1\n\n"},{"id":"416618","messageId":"20210210113650.19715-5-charvi077@gmail.com","threadId":"55117","inReplyTo":"20210207181439.1178-1-charvi077@gmail.com","subject":"[PATCH v3 04/11] t/lib-rebase: update the documentation of FAKE_LINES","fromName":"Charvi Mendiratta","fromEmail":"charvi077@gmail.com","sentAt":"2021-02-10T11:36:44Z","receivedAt":"2021-02-10T11:42:50Z","isPatch":true,"sender":{"key":"charvi077@gmail.com","avatar":"https://avatars.githubusercontent.com/u/32788121?v=4"},"body":"FAKE_LINES helper function use underscore to embed a space in a single\ncommand. Let's document it and also update the list of commands.\n\nMentored-by: Christian Couder <chriscool@tuxfamily.org>\nMentored-by: Phillip Wood <phillip.wood@dunelm.org.uk>\nHelped-by: Eric Sunshine <sunshine@sunshineco.com>\nSigned-off-by: Charvi Mendiratta <charvi077@gmail.com>\n---\n t/lib-rebase.sh | 7 ++++---\n 1 file changed, 4 insertions(+), 3 deletions(-)\n\ndiff --git a/t/lib-rebase.sh b/t/lib-rebase.sh\nindex e10e38060b..57cee517b2 100644\n--- a/t/lib-rebase.sh\n+++ b/t/lib-rebase.sh\n@@ -15,10 +15,11 @@\n #       specified line.\n #\n #   \"<cmd> <lineno>\" -- add a line with the specified command\n-#       (\"pick\", \"squash\", \"fixup\", \"edit\", \"reword\" or \"drop\") and the\n-#       SHA1 taken from the specified line.\n+#       (\"pick\", \"squash\", \"fixup\"|\"fixup_-C\"|\"fixup_-c\", \"edit\", \"reword\" or \"drop\")\n+#       and the SHA1 taken from the specified line.\n #\n-#   \"exec_cmd_with_args\" -- add an \"exec cmd with args\" line.\n+#   \"_\" -- add a space, like \"fixup_-C\" implies \"fixup -C\" and\n+#       \"exec_cmd_with_args\" add an \"exec cmd with args\" line.\n #\n #   \"#\" -- Add a comment line.\n #\n-- \n2.29.0.rc1\n\n"},{"id":"416619","messageId":"20210210113650.19715-3-charvi077@gmail.com","threadId":"55117","inReplyTo":"20210207181439.1178-1-charvi077@gmail.com","subject":"[PATCH v3 02/11] sequencer: rename a few functions","fromName":"Charvi Mendiratta","fromEmail":"charvi077@gmail.com","sentAt":"2021-02-10T11:36:42Z","receivedAt":"2021-02-10T11:42:50Z","isPatch":true,"sender":{"key":"charvi077@gmail.com","avatar":"https://avatars.githubusercontent.com/u/32788121?v=4"},"body":"Rename functions to make them more descriptive and while at it, remove\nunnecessary 'inline' of the skip_fixupish() function.\n\nMentored-by: Christian Couder <chriscool@tuxfamily.org>\nMentored-by: Phillip Wood <phillip.wood@dunelm.org.uk>\nHelped-by: Eric Sunshine <sunshine@sunshineco.com>\nSigned-off-by: Charvi Mendiratta <charvi077@gmail.com>\n---\n sequencer.c | 18 +++++++++---------\n 1 file changed, 9 insertions(+), 9 deletions(-)\n\ndiff --git a/sequencer.c b/sequencer.c\nindex f3928cf45c..abc6d5cdfd 100644\n--- a/sequencer.c\n+++ b/sequencer.c\n@@ -1744,7 +1744,7 @@ static const char skip_first_commit_msg_str[] = N_(\"The 1st commit message will\n static const char skip_nth_commit_msg_fmt[] = N_(\"The commit message #%d will be skipped:\");\n static const char combined_commit_msg_fmt[] = N_(\"This is a combination of %d commits.\");\n \n-static int check_fixup_flag(enum todo_command command, unsigned flag)\n+static int is_fixup_flag(enum todo_command command, unsigned flag)\n {\n \treturn command == TODO_FIXUP && ((flag & TODO_REPLACE_FIXUP_MSG) ||\n \t\t\t\t\t (flag & TODO_EDIT_FIXUP_MSG));\n@@ -1873,7 +1873,7 @@ static int append_squash_message(struct strbuf *buf, const char *body,\n \tstrbuf_addstr(buf, body + commented_len);\n \n \t/* fixup -C after squash behaves like squash */\n-\tif (check_fixup_flag(command, flag) && !seen_squash(opts)) {\n+\tif (is_fixup_flag(command, flag) && !seen_squash(opts)) {\n \t\t/*\n \t\t * We're replacing the commit message so we need to\n \t\t * append the Signed-off-by: trailer if the user\n@@ -1928,7 +1928,7 @@ static int update_squash_messages(struct repository *r,\n \t\t\t    opts->current_fixup_count + 2);\n \t\tstrbuf_splice(&buf, 0, eol - buf.buf, header.buf, header.len);\n \t\tstrbuf_release(&header);\n-\t\tif (check_fixup_flag(command, flag) && !seen_squash(opts))\n+\t\tif (is_fixup_flag(command, flag) && !seen_squash(opts))\n \t\t\tupdate_squash_message_for_fixup(&buf);\n \t} else {\n \t\tstruct object_id head;\n@@ -1951,11 +1951,11 @@ static int update_squash_messages(struct repository *r,\n \t\tstrbuf_addf(&buf, \"%c \", comment_line_char);\n \t\tstrbuf_addf(&buf, _(combined_commit_msg_fmt), 2);\n \t\tstrbuf_addf(&buf, \"\\n%c \", comment_line_char);\n-\t\tstrbuf_addstr(&buf, check_fixup_flag(command, flag) ?\n+\t\tstrbuf_addstr(&buf, is_fixup_flag(command, flag) ?\n \t\t\t      _(skip_first_commit_msg_str) :\n \t\t\t      _(first_commit_msg_str));\n \t\tstrbuf_addstr(&buf, \"\\n\\n\");\n-\t\tif (check_fixup_flag(command, flag))\n+\t\tif (is_fixup_flag(command, flag))\n \t\t\tstrbuf_add_commented_lines(&buf, body, strlen(body));\n \t\telse\n \t\t\tstrbuf_addstr(&buf, body);\n@@ -1968,7 +1968,7 @@ static int update_squash_messages(struct repository *r,\n \t\t\t     oid_to_hex(&commit->object.oid));\n \tfind_commit_subject(message, &body);\n \n-\tif (command == TODO_SQUASH || check_fixup_flag(command, flag)) {\n+\tif (command == TODO_SQUASH || is_fixup_flag(command, flag)) {\n \t\tres = append_squash_message(&buf, body, command, opts, flag);\n \t} else if (command == TODO_FIXUP) {\n \t\tstrbuf_addf(&buf, \"\\n%c \", comment_line_char);\n@@ -5661,7 +5661,7 @@ static int subject2item_cmp(const void *fndata,\n \n define_commit_slab(commit_todo_item, struct todo_item *);\n \n-static inline int skip_fixup_amend_squash(const char *subject, const char **p) {\n+static int skip_fixupish(const char *subject, const char **p) {\n \treturn skip_prefix(subject, \"fixup! \", p) ||\n \t       skip_prefix(subject, \"amend! \", p) ||\n \t       skip_prefix(subject, \"squash! \", p);\n@@ -5725,13 +5725,13 @@ int todo_list_rearrange_squash(struct todo_list *todo_list)\n \t\tformat_subject(&buf, subject, \" \");\n \t\tsubject = subjects[i] = strbuf_detach(&buf, &subject_len);\n \t\tunuse_commit_buffer(item->commit, commit_buffer);\n-\t\tif (skip_fixup_amend_squash(subject, &p)) {\n+\t\tif (skip_fixupish(subject, &p)) {\n \t\t\tstruct commit *commit2;\n \n \t\t\tfor (;;) {\n \t\t\t\twhile (isspace(*p))\n \t\t\t\t\tp++;\n-\t\t\t\tif (!skip_fixup_amend_squash(p, &p))\n+\t\t\t\tif (!skip_fixupish(p, &p))\n \t\t\t\t\tbreak;\n \t\t\t}\n \n-- \n2.29.0.rc1\n\n"},{"id":"416620","messageId":"20210210113650.19715-7-charvi077@gmail.com","threadId":"55117","inReplyTo":"20210207181439.1178-1-charvi077@gmail.com","subject":"[PATCH v3 06/11] t/t3437: remove the dependency of 'expected-message' file from tests","fromName":"Charvi Mendiratta","fromEmail":"charvi077@gmail.com","sentAt":"2021-02-10T11:36:46Z","receivedAt":"2021-02-10T11:42:50Z","isPatch":true,"sender":{"key":"charvi077@gmail.com","avatar":"https://avatars.githubusercontent.com/u/32788121?v=4"},"body":"As it is currently implemented, it's too difficult to follow along and\nremember the value of \"expected-message\" from test to test. It also\nmakes it difficult to extend tests or add new tests in between existing\ntests without negatively impacting other tests.\n\nLet's set up \"expected-message\" to the precise content needed by the\ntest, so that both the problems go away and also makes easier to run\ntests selectively with '--run' or 'GIT_SKIP_TESTS'\n\nMentored-by: Christian Couder <chriscool@tuxfamily.org>\nMentored-by: Phillip Wood <phillip.wood@dunelm.org.uk>\nHelped-by: Eric Sunshine <sunshine@sunshineco.com>\nSigned-off-by: Charvi Mendiratta <charvi077@gmail.com>\n---\n t/t3437-rebase-fixup-options.sh | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t3437-rebase-fixup-options.sh b/t/t3437-rebase-fixup-options.sh\nindex f599da3e08..d368ab4d4b 100755\n--- a/t/t3437-rebase-fixup-options.sh\n+++ b/t/t3437-rebase-fixup-options.sh\n@@ -46,8 +46,6 @@ test_expect_success 'setup' '\n \tbody\n \tEOF\n \n-\tsed \"1,2d\" message >expected-message &&\n-\n \ttest_commit A A &&\n \ttest_commit B B &&\n \tget_author HEAD >expected-author &&\n@@ -134,6 +132,7 @@ test_expect_success 'simple fixup -c works' '\n test_expect_success 'fixup -C removes amend! from message' '\n \ttest_when_finished \"test_might_fail git rebase --abort\" &&\n \tgit checkout --detach A1 &&\n+\tgit log -1 --pretty=format:%b >expected-message &&\n \tFAKE_LINES=\"1 fixup_-C 2\" git rebase -i A &&\n \ttest_cmp_rev HEAD^ A &&\n \ttest_cmp_rev HEAD^{tree} A1^{tree} &&\n@@ -145,13 +144,14 @@ test_expect_success 'fixup -C removes amend! from message' '\n test_expect_success 'fixup -C with conflicts gives correct message' '\n \ttest_when_finished \"test_might_fail git rebase --abort\" &&\n \tgit checkout --detach A1 &&\n+\tgit log -1 --pretty=format:%b >expected-message &&\n+\ttest_write_lines \"\" \"edited\" >>expected-message &&\n \ttest_must_fail env FAKE_LINES=\"1 fixup_-C 2\" git rebase -i conflicts &&\n \tgit checkout --theirs -- A &&\n \tgit add A &&\n \tFAKE_COMMIT_AMEND=edited git rebase --continue &&\n \ttest_cmp_rev HEAD^ conflicts &&\n \ttest_cmp_rev HEAD^{tree} A1^{tree} &&\n-\ttest_write_lines \"\" edited >>expected-message &&\n \ttest_commit_message HEAD expected-message &&\n \tget_author HEAD >actual-author &&\n \ttest_cmp expected-author actual-author\n-- \n2.29.0.rc1\n\n"},{"id":"416621","messageId":"20210210113650.19715-8-charvi077@gmail.com","threadId":"55117","inReplyTo":"20210207181439.1178-1-charvi077@gmail.com","subject":"[PATCH v3 07/11] t/t3437: check the author date of fixed up commit","fromName":"Charvi Mendiratta","fromEmail":"charvi077@gmail.com","sentAt":"2021-02-10T11:36:47Z","receivedAt":"2021-02-10T11:43:28Z","isPatch":true,"sender":{"key":"charvi077@gmail.com","avatar":"https://avatars.githubusercontent.com/u/32788121?v=4"},"body":"Add '%at' format in the get_author() function and update the test to\ncheck that the author date of the fixed up commit is unchanged.\n\nMentored-by: Christian Couder <chriscool@tuxfamily.org>\nMentored-by: Phillip Wood <phillip.wood@dunelm.org.uk>\nHelped-by: Eric Sunshine <sunshine@sunshineco.com>\nSigned-off-by: Charvi Mendiratta <charvi077@gmail.com>\n---\n t/t3437-rebase-fixup-options.sh | 4 +++-\n 1 file changed, 3 insertions(+), 1 deletion(-)\n\ndiff --git a/t/t3437-rebase-fixup-options.sh b/t/t3437-rebase-fixup-options.sh\nindex d368ab4d4b..505211a589 100755\n--- a/t/t3437-rebase-fixup-options.sh\n+++ b/t/t3437-rebase-fixup-options.sh\n@@ -33,7 +33,7 @@ test_commit_message () {\n \n get_author () {\n \trev=\"$1\" &&\n-\tgit log -1 --pretty=format:\"%an %ae\" \"$rev\"\n+\tgit log -1 --pretty=format:\"%an %ae %at\" \"$rev\"\n }\n \n test_expect_success 'setup' '\n@@ -196,6 +196,8 @@ test_expect_success 'multiple fixup -c opens editor once' '\n \t\tEXPECT_HEADER_COUNT=4 \\\n \t\tgit rebase -i $base &&\n \ttest_cmp_rev $base HEAD^ &&\n+\tget_author HEAD >actual-author &&\n+\ttest_cmp expected-author actual-author &&\n \ttest 1 = $(git show | grep Modified-A3 | wc -l)\n '\n \n-- \n2.29.0.rc1\n\n"},{"id":"416622","messageId":"20210210113650.19715-9-charvi077@gmail.com","threadId":"55117","inReplyTo":"20210207181439.1178-1-charvi077@gmail.com","subject":"[PATCH v3 08/11] t/t3437: simplify and document the test helpers","fromName":"Charvi Mendiratta","fromEmail":"charvi077@gmail.com","sentAt":"2021-02-10T11:36:48Z","receivedAt":"2021-02-10T11:43:59Z","isPatch":true,"sender":{"key":"charvi077@gmail.com","avatar":"https://avatars.githubusercontent.com/u/32788121?v=4"},"body":"Let's simplify the test_commit_message() helper function and add\ncomments to the function.\n\nThis patch also document the working of 'fixup -C' with \"amend!\" in the\ntest-description.\n\nMentored-by: Christian Couder <chriscool@tuxfamily.org>\nMentored-by: Phillip Wood <phillip.wood@dunelm.org.uk>\nHelped-by: Eric Sunshine <sunshine@sunshineco.com>\nSigned-off-by: Charvi Mendiratta <charvi077@gmail.com>\n---\n t/t3437-rebase-fixup-options.sh | 26 +++++++++++++++-----------\n 1 file changed, 15 insertions(+), 11 deletions(-)\n\ndiff --git a/t/t3437-rebase-fixup-options.sh b/t/t3437-rebase-fixup-options.sh\nindex 505211a589..6b464989e9 100755\n--- a/t/t3437-rebase-fixup-options.sh\n+++ b/t/t3437-rebase-fixup-options.sh\n@@ -9,7 +9,9 @@ This test checks the \"fixup [-C|-c]\" command of rebase interactive.\n In addition to amending the contents of the commit, \"fixup -C\"\n replaces the original commit message with the message of the fixup\n commit. \"fixup -c\" also replaces the original message, but opens the\n-editor to allow the user to edit the message before committing.\n+editor to allow the user to edit the message before committing. Similar\n+to the \"fixup\" command that works with \"fixup!\", \"fixup -C\" works with\n+\"amend!\" upon --autosquash.\n '\n \n . ./test-lib.sh\n@@ -18,17 +20,19 @@ editor to allow the user to edit the message before committing.\n \n EMPTY=\"\"\n \n+# test_commit_message <rev> -m <msg>\n+# test_commit_message <rev> <path>\n+# Verify that the commit message of <rev> matches\n+# <msg> or the content of <path>.\n test_commit_message () {\n-\trev=\"$1\" && # commit or tag we want to test\n-\tfile=\"$2\" && # test against the content of a file\n-\tgit show --no-patch --pretty=format:%B \"$rev\" >actual-message &&\n-\tif test \"$2\" = -m\n-\tthen\n-\t\tstr=\"$3\" && # test against a string\n-\t\tprintf \"%s\\n\" \"$str\" >tmp-expected-message &&\n-\t\tfile=\"tmp-expected-message\"\n-\tfi\n-\ttest_cmp \"$file\" actual-message\n+\tgit show --no-patch --pretty=format:%B \"$1\" >actual &&\n+\tcase \"$2\" in\n+\t-m)\n+\t\techo \"$3\" >expect &&\n+\t\ttest_cmp expect actual ;;\n+\t*)\n+\t\ttest_cmp \"$2\" actual ;;\n+\tesac\n }\n \n get_author () {\n-- \n2.29.0.rc1\n\n"},{"id":"416623","messageId":"20210210113650.19715-10-charvi077@gmail.com","threadId":"55117","inReplyTo":"20210207181439.1178-1-charvi077@gmail.com","subject":"[PATCH v3 09/11] t/t3437: use named commits in the tests","fromName":"Charvi Mendiratta","fromEmail":"charvi077@gmail.com","sentAt":"2021-02-10T11:36:49Z","receivedAt":"2021-02-10T11:44:00Z","isPatch":true,"sender":{"key":"charvi077@gmail.com","avatar":"https://avatars.githubusercontent.com/u/32788121?v=4"},"body":"Use the named commits in the tests so that they will still refer to the\nsame commit if the setup gets changed in the future whereas 'branch~2'\nwill change which commit it points to.\n\nMentored-by: Christian Couder <chriscool@tuxfamily.org>\nMentored-by: Phillip Wood <phillip.wood@dunelm.org.uk>\nHelped-by: Eric Sunshine <sunshine@sunshineco.com>\nSigned-off-by: Charvi Mendiratta <charvi077@gmail.com>\n---\n t/t3437-rebase-fixup-options.sh | 18 ++++++++++--------\n 1 file changed, 10 insertions(+), 8 deletions(-)\n\ndiff --git a/t/t3437-rebase-fixup-options.sh b/t/t3437-rebase-fixup-options.sh\nindex 6b464989e9..6e981fa487 100755\n--- a/t/t3437-rebase-fixup-options.sh\n+++ b/t/t3437-rebase-fixup-options.sh\n@@ -70,6 +70,7 @@ test_expect_success 'setup' '\n \techo B1 >B &&\n \ttest_tick &&\n \tgit commit --fixup=HEAD -a &&\n+\tgit tag B1 &&\n \ttest_tick &&\n \tgit commit --allow-empty -F - <<-EOF &&\n \tamend! B\n@@ -91,6 +92,7 @@ test_expect_success 'setup' '\n \techo B2 >B &&\n \ttest_tick &&\n \tFAKE_COMMIT_AMEND=\"edited squash\" git commit --squash=HEAD -a &&\n+\tgit tag B2 &&\n \techo B3 >B &&\n \ttest_tick &&\n \tgit commit -a -F - <<-EOF &&\n@@ -104,6 +106,7 @@ test_expect_success 'setup' '\n \t$EMPTY\n \tedited 3\n \tEOF\n+\tgit tag B3 &&\n \n \tGIT_AUTHOR_NAME=\"Rebase Author\" &&\n \tGIT_AUTHOR_EMAIL=\"rebase.author@example.com\" &&\n@@ -171,12 +174,12 @@ test_expect_success 'skipping fixup -C after fixup gives correct message' '\n '\n \n test_expect_success 'sequence of fixup, fixup -C & squash --signoff works' '\n-\tgit checkout --detach branch &&\n+\tgit checkout --detach B3 &&\n \tFAKE_LINES=\"1 fixup 2 fixup_-C 3 fixup_-C 4 squash 5 fixup_-C 6\" \\\n \t\tFAKE_COMMIT_AMEND=squashed \\\n \t\tFAKE_MESSAGE_COPY=actual-squash-message \\\n \t\tgit -c commit.status=false rebase -ik --signoff A &&\n-\tgit diff-tree --exit-code --patch HEAD branch -- &&\n+\tgit diff-tree --exit-code --patch HEAD B3 -- &&\n \ttest_cmp_rev HEAD^ A &&\n \ttest_i18ncmp \"$TEST_DIRECTORY/t3437/expected-squash-message\" \\\n \t\tactual-squash-message\n@@ -184,7 +187,7 @@ test_expect_success 'sequence of fixup, fixup -C & squash --signoff works' '\n \n test_expect_success 'first fixup -C commented out in sequence fixup fixup -C fixup -C' '\n \ttest_when_finished \"test_might_fail git rebase --abort\" &&\n-\tgit checkout branch && git checkout --detach branch~2 &&\n+\tgit checkout --detach B2~ &&\n \tgit log -1 --pretty=format:%b >expected-message &&\n \tFAKE_LINES=\"1 fixup 2 fixup_-C 3 fixup_-C 4\" git rebase -i A &&\n \ttest_cmp_rev HEAD^ A &&\n@@ -194,12 +197,11 @@ test_expect_success 'first fixup -C commented out in sequence fixup fixup -C fix\n test_expect_success 'multiple fixup -c opens editor once' '\n \ttest_when_finished \"test_might_fail git rebase --abort\" &&\n \tgit checkout --detach A3 &&\n-\tbase=$(git rev-parse HEAD~4) &&\n \tFAKE_COMMIT_MESSAGE=\"Modified-A3\" \\\n \t\tFAKE_LINES=\"1 fixup_-C 2 fixup_-c 3 fixup_-c 4\" \\\n \t\tEXPECT_HEADER_COUNT=4 \\\n-\t\tgit rebase -i $base &&\n-\ttest_cmp_rev $base HEAD^ &&\n+\t\tgit rebase -i A &&\n+\ttest_cmp_rev HEAD^ A &&\n \tget_author HEAD >actual-author &&\n \ttest_cmp expected-author actual-author &&\n \ttest 1 = $(git show | grep Modified-A3 | wc -l)\n@@ -217,12 +219,12 @@ test_expect_success 'sequence squash, fixup & fixup -c gives combined message' '\n '\n \n test_expect_success 'fixup -C works upon --autosquash with amend!' '\n-\tgit checkout --detach branch &&\n+\tgit checkout --detach B3 &&\n \tFAKE_COMMIT_AMEND=squashed \\\n \t\tFAKE_MESSAGE_COPY=actual-squash-message \\\n \t\tgit -c commit.status=false rebase -ik --autosquash \\\n \t\t\t\t\t\t--signoff A &&\n-\tgit diff-tree --exit-code --patch HEAD branch -- &&\n+\tgit diff-tree --exit-code --patch HEAD B3 -- &&\n \ttest_cmp_rev HEAD^ A &&\n \ttest_i18ncmp \"$TEST_DIRECTORY/t3437/expected-squash-message\" \\\n \t\tactual-squash-message\n-- \n2.29.0.rc1\n\n"},{"id":"416624","messageId":"20210210113650.19715-11-charvi077@gmail.com","threadId":"55117","inReplyTo":"20210207181439.1178-1-charvi077@gmail.com","subject":"[PATCH v3 10/11] t/t3437: fixup the test 'multiple fixup -c opens editor once'","fromName":"Charvi Mendiratta","fromEmail":"charvi077@gmail.com","sentAt":"2021-02-10T11:36:50Z","receivedAt":"2021-02-10T11:45:01Z","isPatch":true,"sender":{"key":"charvi077@gmail.com","avatar":"https://avatars.githubusercontent.com/u/32788121?v=4"},"body":"In the test, FAKE_COMMIT_MESSAGE replaces the commit message each\ntime it is invoked so there will be only one instance of \"Modified-A3\"\nno matter how many times we invoke the editor. Let's fix this and use\nFAKE_COMMIT_AMEND instead so that it adds \"Modified-A3\" once for each\ntime the editor is invoked.\n\nThis patch also removes the check for counting the number of\n\"Modified-A3\" lines and instead compares the whole message to check\nthat the commenting code works correctly for 'fixup -c' as well as\n'fixup -C'.\n\nMentored-by: Christian Couder <chriscool@tuxfamily.org>\nMentored-by: Phillip Wood <phillip.wood@dunelm.org.uk>\nHelped-by: Eric Sunshine <sunshine@sunshineco.com>\nSigned-off-by: Charvi Mendiratta <charvi077@gmail.com>\n---\n t/t3437-rebase-fixup-options.sh | 6 ++++--\n 1 file changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t3437-rebase-fixup-options.sh b/t/t3437-rebase-fixup-options.sh\nindex 6e981fa487..a5a20354e3 100755\n--- a/t/t3437-rebase-fixup-options.sh\n+++ b/t/t3437-rebase-fixup-options.sh\n@@ -197,14 +197,16 @@ test_expect_success 'first fixup -C commented out in sequence fixup fixup -C fix\n test_expect_success 'multiple fixup -c opens editor once' '\n \ttest_when_finished \"test_might_fail git rebase --abort\" &&\n \tgit checkout --detach A3 &&\n-\tFAKE_COMMIT_MESSAGE=\"Modified-A3\" \\\n+\tgit log -1 --pretty=format:%B >expected-message &&\n+\ttest_write_lines \"\" \"Modified-A3\" >>expected-message &&\n+\tFAKE_COMMIT_AMEND=\"Modified-A3\" \\\n \t\tFAKE_LINES=\"1 fixup_-C 2 fixup_-c 3 fixup_-c 4\" \\\n \t\tEXPECT_HEADER_COUNT=4 \\\n \t\tgit rebase -i A &&\n \ttest_cmp_rev HEAD^ A &&\n \tget_author HEAD >actual-author &&\n \ttest_cmp expected-author actual-author &&\n-\ttest 1 = $(git show | grep Modified-A3 | wc -l)\n+\ttest_commit_message HEAD expected-message\n '\n \n test_expect_success 'sequence squash, fixup & fixup -c gives combined message' '\n-- \n2.29.0.rc1\n\n"},{"id":"416625","messageId":"20210210113650.19715-12-charvi077@gmail.com","threadId":"55117","inReplyTo":"20210207181439.1178-1-charvi077@gmail.com","subject":"[PATCH v3 11/11] doc/rebase -i: fix typo in the documentation of 'fixup' command","fromName":"Charvi Mendiratta","fromEmail":"charvi077@gmail.com","sentAt":"2021-02-10T11:36:51Z","receivedAt":"2021-02-10T11:45:37Z","isPatch":true,"sender":{"key":"charvi077@gmail.com","avatar":"https://avatars.githubusercontent.com/u/32788121?v=4"},"body":"Mentored-by: Christian Couder <chriscool@tuxfamily.org>\nMentored-by: Phillip Wood <phillip.wood@dunelm.org.uk>\nHelped-by: Eric Sunshine <sunshine@sunshineco.com>\nSigned-off-by: Charvi Mendiratta <charvi077@gmail.com>\n---\n Documentation/git-rebase.txt | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt\nindex a6903419c4..8bfa5a9272 100644\n--- a/Documentation/git-rebase.txt\n+++ b/Documentation/git-rebase.txt\n@@ -894,7 +894,7 @@ is used.  In that case the suggested commit message is only the message\n of the \"fixup -c\" commit, and an editor is opened allowing you to edit\n the message.  The contents (patch) of the \"fixup -c\" commit are still\n incorporated into the folded commit. If there is more than one \"fixup -c\"\n-commit, the message from the last last one is used.  You can also use\n+commit, the message from the final one is used.  You can also use\n \"fixup -C\" to get the same behavior as \"fixup -c\" except without opening\n an editor.\n \n-- \n2.29.0.rc1\n\n"},{"id":"416749","messageId":"xmqqeehmy129.fsf@gitster.c.googlers.com","threadId":"55117","inReplyTo":"20210210113650.19715-1-charvi077@gmail.com","subject":"Re: [PATCH v3 00/11][Outreachy] Improve the 'fixup [-C | -c]' in interactive rebase","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-02-11T17:19:26Z","receivedAt":"2021-02-11T17:22:06Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Charvi Mendiratta <charvi077@gmail.com> writes:\n\n> This patch series is build on the top of \"cm/rebase-i\" in the 'next' branch and\n> improves it. It fixup the source code of 'fixup [-C | -c]' command in the\n> sequencer, do some fixes in rebase -i, improves the 'fixup_-C' like commands\n> in lib-rebase.sh, update the test-script 't3437' and fixes a typo in the\n> documentation.\n>\n> Changes from v2 :\n> * Update the rebase-todo help\n> * Remove the changes and resets to fixup_-* command\n> * Update the documentation of FAKE_LINES\n> * Move the changes of \"unnecessary curly braces in test\" to the other patch\n>   (from v2-9/11 to v2-5/11)\n>\n> Thanks all for the suggestions.\n\nThanks.  Looking good.  Unless there is any other nits, let's\ndeclare victory and merge the two topics down to 'next' and then to\n'master' for the next release?\n"},{"id":"416777","messageId":"CAPSFM5fWmTXRHKseqXwZyE6MOVccR2OPSs5kyEu-k1K1p01EPw@mail.gmail.com","threadId":"55117","inReplyTo":"xmqqeehmy129.fsf@gitster.c.googlers.com","subject":"Re: [PATCH v3 00/11][Outreachy] Improve the 'fixup [-C | -c]' in interactive rebase","fromName":"Charvi Mendiratta","fromEmail":"charvi077@gmail.com","sentAt":"2021-02-11T22:26:34Z","receivedAt":"2021-02-11T22:27:46Z","isPatch":true,"sender":{"key":"charvi077@gmail.com","avatar":"https://avatars.githubusercontent.com/u/32788121?v=4"},"body":"Hi Junio,\n\nOn Thu, 11 Feb 2021 at 22:49, Junio C Hamano <gitster@pobox.com> wrote:\n>[...]\n> Thanks.  Looking good.  Unless there is any other nits, let's\n> declare victory and merge the two topics down to 'next' and then to\n> 'master' for the next release?\n\nThanks for confirming. Here in these two topics  `fixup -C` works with\n\"amend!\" commit in interactive rebase and we are still working on some\nimprovements on the new patch series ( to be sent)  that implements\n\"amend! \" commit . So I think to rebase that  work also on this topic,\nto make project history clear and avoid the confusion ( it also\nimproves the same test script in this topic).\n\nSo maybe please wait for that, before merging to master.\n\nThanks and Regards,\nCharvi\n"},{"id":"416779","messageId":"xmqqblcqw7ff.fsf@gitster.c.googlers.com","threadId":"55117","inReplyTo":"CAPSFM5fWmTXRHKseqXwZyE6MOVccR2OPSs5kyEu-k1K1p01EPw@mail.gmail.com","subject":"Re: [PATCH v3 00/11][Outreachy] Improve the 'fixup [-C | -c]' in interactive rebase","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-02-11T22:44:52Z","receivedAt":"2021-02-11T22:45:40Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Charvi Mendiratta <charvi077@gmail.com> writes:\n\n> On Thu, 11 Feb 2021 at 22:49, Junio C Hamano <gitster@pobox.com> wrote:\n>>[...]\n>> Thanks.  Looking good.  Unless there is any other nits, let's\n>> declare victory and merge the two topics down to 'next' and then to\n>> 'master' for the next release?\n>\n> Thanks for confirming. Here in these two topics  `fixup -C` works with\n> \"amend!\" commit in interactive rebase and we are still working on some\n> improvements on the new patch series ( to be sent)  that implements\n> \"amend! \" commit . So I think to rebase that  work also on this topic,\n> to make project history clear and avoid the confusion ( it also\n> improves the same test script in this topic).\n>\n> So maybe please wait for that, before merging to master.\n\nSorry, but I do not quite understand.\n\nAren't you talking about adding even more features to what is\nalready there in the cm/rebase-i plus cm/rebase-i-updates topics?\nOr are you saying that what is in these two topics is still buggy\nand we need fixes to it before we can give them to the general\npublic?\n\nI had an impression that it was the former, and if that is the case,\nthen moving them to 'next' and then to 'master', regardless of the\nfollow-up changes, would be a useful thing to do.  Of course, if it\nis the latter, i.e. these two topics make \"git rebase -i\" worse by\nintroducing an unfinished feature that is not yet usable and/or\nbuggy without further work, yes, it would be prudent to wait merging\nthe cm/rebase-i-updates topic to 'next' and replace it with a fixed\nversion.\n\nBut then you'd be stopping me from merging the \"updates\" one to\n'next', not to 'master'.\n\n"},{"id":"416781","messageId":"CAPSFM5d2FMU+ofJMPbNW0MhuEUpgurYJNHyHHSjq4h1rknHd8w@mail.gmail.com","threadId":"55117","inReplyTo":"xmqqblcqw7ff.fsf@gitster.c.googlers.com","subject":"Re: [PATCH v3 00/11][Outreachy] Improve the 'fixup [-C | -c]' in interactive rebase","fromName":"Charvi Mendiratta","fromEmail":"charvi077@gmail.com","sentAt":"2021-02-12T00:19:57Z","receivedAt":"2021-02-12T00:21:22Z","isPatch":true,"sender":{"key":"charvi077@gmail.com","avatar":"https://avatars.githubusercontent.com/u/32788121?v=4"},"body":"On Fri, 12 Feb 2021 at 04:14, Junio C Hamano <gitster@pobox.com> wrote:\n\n> Sorry, but I do not quite understand.\n>\n\nI thought to rebase the \"[WIP] Implementation of amend! commit\"\nthat adds option to `git commit --fixup` , as discussed\nearlier[1] onto cm/rebase-i.\nBecause cm/rebase-i branch includes the working of the\n\"amend!\" commit upon --autosquash and also in sequencer with\ncommand `fixup -C`. But..\n\n> Aren't you talking about adding even more features to what is\n> already there in the cm/rebase-i plus cm/rebase-i-updates topics?\n\n..Yes, it's correct ...\n\n> Or are you saying that what is in these two topics is still buggy\n> and we need fixes to it before we can give them to the general\n> public?\n>\n> I had an impression that it was the former, and if that is the case,\n> then moving them to 'next' and then to 'master', regardless of the\n> follow-up changes, would be a useful thing to do.\n\n...Okay, I agree and will do it in this way.\n\nThanks and Regards,\nCharvi\n\n[1] https://lore.kernel.org/git/CAPSFM5f+cm87N5TO3V+rJvWyrcazybNb_Zu_bJZ+sBH4N4iyow@mail.gmail.com/\n"}]}