{"thread":{"id":"63463","subject":"[PATCH] sequencer: make it clearer that commit descriptions are just comments","startedAt":"2025-05-15T02:20:30Z","lastAt":"2025-05-16T16:26:30Z","messageCount":11,"participants":["Elijah Newren via GitGitGadget","Reto","Phillip Wood","Junio C Hamano","Ben Knoble","Elijah Newren"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"518081","messageId":"pull.1923.git.1747275627422.gitgitgadget@gmail.com","threadId":"63463","inReplyTo":null,"subject":"[PATCH] sequencer: make it clearer that commit descriptions are just comments","fromName":"Elijah Newren via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2025-05-15T02:20:27Z","receivedAt":"2025-05-15T02:20:30Z","isPatch":true,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"From: Elijah Newren <newren@gmail.com>\n\nEvery once in a while, users report that editing the commit summaries\nin the todo list does not get reflected in the rebase operation,\nsuggesting that users are (a) only using one-line commit messages, and\n(b) not understanding that the commit summaries are merely helpful\ncomments to help them find the right hashes.\n\nIt may be difficult to correct users' poor commit messages, but we can\nat least try to make it clearer that the commit summaries are not\ndirectives of some sort by inserting a comment character.  Hopefully\nthat leads to them looking a little further and noticing the hints at\nthe bottom to use 'reword' or 'edit' directives.\n\nYes, this change may look funny at first since it hardcodes '#' rather\nthan using comment_line_str.  However:\n\n  * comment_line_str exists to allow disambiguation between lines in\n    a commit message and lines that are instructions to users editing\n    the commit message.  No such disambiguation is needed for these\n    comments that occur on the same line after existing directives\n  * the exact \"comment\" character(s) on regular pick lines used aren't\n    actually important; I could have used anything, including completely\n    random variable length text for each line and it'd work because we\n    ignore everything after 'pick' and the hash.\n  * The whole point of this change is to signal to users that they\n    should NOT be editing any part of the line after the hash (and if\n    they do so, their edits will be ignored), while the whole point of\n    comment_line_str is to allow highly flexible editing.  So making\n    it more general by using comment_line_str actually feels\n    counterproductive.\n  * The character for merge directives absolutely must be '#'; that\n    has been deeply hardcoded for a long time (see below), and will\n    break if some other comment character is used instead.  In a\n    desire to have pick and merge directives be similar, I use the\n    same comment character for both.\n  * Perhaps merge directives could be fixed to not be inflexible about\n    the comment character used, if someone feels highly motivated, but\n    I think that should be done in a separate follow-on patch.\n\nHere are (some of?) the locations where '#' has already been hardcoded\nfor a long time for merges:\n\n  1) In check_label_or_ref_arg():\n\tcase TODO_LABEL:\n\t\t/*\n\t\t * '#' is not a valid label as the merge command uses it to\n\t\t * separate merge parents from the commit subject.\n\t\t */\n\n  2) In do_merge():\n\n\t/*\n\t * For octopus merges, the arg starts with the list of revisions to be\n\t * merged. The list is optionally followed by '#' and the oneline.\n\t */\n\tmerge_arg_len = oneline_offset = arg_len;\n\tfor (p = arg; p - arg < arg_len; p += strspn(p, \" \\t\\n\")) {\n\t\tif (!*p)\n\t\t\tbreak;\n\t\tif (*p == '#' && (!p[1] || isspace(p[1]))) {\n\n  3) In label_oid():\n\n\t\tif ((buf->len == the_hash_algo->hexsz &&\n\t\t     !get_oid_hex(label, &dummy)) ||\n\t\t    (buf->len == 1 && *label == '#') ||\n\t\t    hashmap_get_from_hash(&state->labels,\n\t\t\t\t\t  strihash(label), label)) {\n\t\t\t/*\n\t\t\t * If the label already exists, or if the label is a\n\t\t\t * valid full OID, or the label is a '#' (which we use\n\t\t\t * as a separator between merge heads and oneline), we\n\t\t\t * append a dash and a number to make it unique.\n\t\t\t */\n\nSigned-off-by: Elijah Newren <newren@gmail.com>\n---\n    sequencer: make it clearer that commit descriptions are just comments\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-1923%2Fnewren%2Fsequencer-todo-commit-msgs-are-comments-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1923/newren/sequencer-todo-commit-msgs-are-comments-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/1923\n\n sequencer.c                   | 16 +++++--\n t/t3404-rebase-interactive.sh | 54 +++++++++++-----------\n t/t3415-rebase-autosquash.sh  | 14 +++---\n t/t3430-rebase-merges.sh      | 10 ++--\n t/t5520-pull.sh               |  2 +-\n t/t7512-status-help.sh        | 86 +++++++++++++++++------------------\n 6 files changed, 94 insertions(+), 88 deletions(-)\n\ndiff --git a/sequencer.c b/sequencer.c\nindex b5c4043757e..2735966544b 100644\n--- a/sequencer.c\n+++ b/sequencer.c\n@@ -5901,11 +5901,11 @@ static int make_script_with_merges(struct pretty_print_context *pp,\n \n \t\t/* Create a label from the commit message */\n \t\tstrbuf_reset(&label_from_message);\n-\t\tif (skip_prefix(oneline.buf, \"Merge \", &p1) &&\n+\t\tif (skip_prefix(oneline.buf, \"# Merge \", &p1) &&\n \t\t    (p1 = strchr(p1, '\\'')) &&\n \t\t    (p2 = strchr(++p1, '\\'')))\n \t\t\tstrbuf_add(&label_from_message, p1, p2 - p1);\n-\t\telse if (skip_prefix(oneline.buf, \"Merge pull request \",\n+\t\telse if (skip_prefix(oneline.buf, \"# Merge pull request \",\n \t\t\t\t     &p1) &&\n \t\t\t (p1 = strstr(p1, \" from \")))\n \t\t\tstrbuf_addstr(&label_from_message, p1 + strlen(\" from \"));\n@@ -5940,7 +5940,7 @@ static int make_script_with_merges(struct pretty_print_context *pp,\n \n \t\t\tstrbuf_addstr(&buf, label_oid(oid, label, &state));\n \t\t}\n-\t\tstrbuf_addf(&buf, \" # %s\", oneline.buf);\n+\t\tstrbuf_addf(&buf, \" %s\", oneline.buf);\n \n \t\tFLEX_ALLOC_STR(entry, string, buf.buf);\n \t\toidcpy(&entry->entry.oid, &commit->object.oid);\n@@ -6022,7 +6022,7 @@ static int make_script_with_merges(struct pretty_print_context *pp,\n \t\t\telse {\n \t\t\t\tstrbuf_reset(&oneline);\n \t\t\t\tpretty_print_commit(pp, commit, &oneline);\n-\t\t\t\tstrbuf_addf(out, \"%s %s # %s\\n\",\n+\t\t\t\tstrbuf_addf(out, \"%s %s %s\\n\",\n \t\t\t\t\t    cmd_reset, to, oneline.buf);\n \t\t\t}\n \t\t}\n@@ -6090,8 +6090,14 @@ int sequencer_make_script(struct repository *r, struct strbuf *out, int argc,\n \tgit_config_get_string(\"rebase.instructionFormat\", &format);\n \tif (!format || !*format) {\n \t\tfree(format);\n-\t\tformat = xstrdup(\"%s\");\n+\t\tformat = xstrdup(\"# %s\");\n \t}\n+\tif (*format != '#') {\n+\t\tchar *temp = format;\n+\t\tformat = xstrfmt(\"# %s\", temp);\n+\t\tfree(temp);\n+\t}\n+\n \tget_commit_format(format, &revs);\n \tfree(format);\n \tpp.fmt = revs.commit_format;\ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex 2aee9789a2f..6bac217ed35 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -1468,7 +1468,7 @@ test_expect_success 'rebase -i respects rebase.missingCommitsCheck = warn' '\n \tcat >expect <<-EOF &&\n \tWarning: some commits may have been dropped accidentally.\n \tDropped commits (newer to older):\n-\t - $(git rev-list --pretty=oneline --abbrev-commit -1 primary)\n+\t - $(git log --format=\"%h # %s\" -1 primary)\n \tTo avoid this message, use \"drop\" to explicitly remove a commit.\n \tEOF\n \ttest_config rebase.missingCommitsCheck warn &&\n@@ -1486,8 +1486,8 @@ test_expect_success 'rebase -i respects rebase.missingCommitsCheck = error' '\n \tcat >expect <<-EOF &&\n \tWarning: some commits may have been dropped accidentally.\n \tDropped commits (newer to older):\n-\t - $(git rev-list --pretty=oneline --abbrev-commit -1 primary)\n-\t - $(git rev-list --pretty=oneline --abbrev-commit -1 primary~2)\n+\t - $(git log --format=\"%h # %s\" -1 primary)\n+\t - $(git log --format=\"%h # %s\" -1 primary~2)\n \tTo avoid this message, use \"drop\" to explicitly remove a commit.\n \n \tUse '\\''git config rebase.missingCommitsCheck'\\'' to change the level of warnings.\n@@ -1530,11 +1530,11 @@ test_expect_success 'rebase --edit-todo respects rebase.missingCommitsCheck = ig\n test_expect_success 'rebase --edit-todo respects rebase.missingCommitsCheck = warn' '\n \tcat >expect <<-EOF &&\n \terror: invalid command '\\''pickled'\\''\n-\terror: invalid line 1: pickled $(git rev-list --pretty=oneline --abbrev-commit -1 primary~4)\n+\terror: invalid line 1: pickled $(git log --format=\"%h # %s\" -1 primary~4)\n \tWarning: some commits may have been dropped accidentally.\n \tDropped commits (newer to older):\n-\t - $(git rev-list --pretty=oneline --abbrev-commit -1 primary)\n-\t - $(git rev-list --pretty=oneline --abbrev-commit -1 primary~4)\n+\t - $(git log --format=\"%h # %s\" -1 primary)\n+\t - $(git log --format=\"%h # %s\" -1 primary~4)\n \tTo avoid this message, use \"drop\" to explicitly remove a commit.\n \tEOF\n \thead -n5 expect >expect.2 &&\n@@ -1565,11 +1565,11 @@ test_expect_success 'rebase --edit-todo respects rebase.missingCommitsCheck = wa\n test_expect_success 'rebase --edit-todo respects rebase.missingCommitsCheck = error' '\n \tcat >expect <<-EOF &&\n \terror: invalid command '\\''pickled'\\''\n-\terror: invalid line 1: pickled $(git rev-list --pretty=oneline --abbrev-commit -1 primary~4)\n+\terror: invalid line 1: pickled $(git log --format=\"%h # %s\" -1 primary~4)\n \tWarning: some commits may have been dropped accidentally.\n \tDropped commits (newer to older):\n-\t - $(git rev-list --pretty=oneline --abbrev-commit -1 primary)\n-\t - $(git rev-list --pretty=oneline --abbrev-commit -1 primary~4)\n+\t - $(git log --format=\"%h # %s\" -1 primary)\n+\t - $(git log --format=\"%h # %s\" -1 primary~4)\n \tTo avoid this message, use \"drop\" to explicitly remove a commit.\n \n \tUse '\\''git config rebase.missingCommitsCheck'\\'' to change the level of warnings.\n@@ -1642,11 +1642,11 @@ test_expect_success 'respects rebase.abbreviateCommands with fixup, squash and e\n \ttest_commit \"fixup! first\" file2.txt \"first line again\" first_fixup &&\n \ttest_commit \"squash! second\" file1.txt \"another line here\" second_squash &&\n \tcat >expected <<-EOF &&\n-\tp $(git rev-list --abbrev-commit -1 first) first\n-\tf $(git rev-list --abbrev-commit -1 first_fixup) fixup! first\n+\tp $(git rev-list --abbrev-commit -1 first) # first\n+\tf $(git rev-list --abbrev-commit -1 first_fixup) # fixup! first\n \tx git show HEAD\n-\tp $(git rev-list --abbrev-commit -1 second) second\n-\ts $(git rev-list --abbrev-commit -1 second_squash) squash! second\n+\tp $(git rev-list --abbrev-commit -1 second) # second\n+\ts $(git rev-list --abbrev-commit -1 second_squash) # squash! second\n \tx git show HEAD\n \tEOF\n \tgit checkout abbrevcmd &&\n@@ -1665,7 +1665,7 @@ test_expect_success 'static check of bad command' '\n \t\tset_fake_editor &&\n \t\ttest_must_fail env FAKE_LINES=\"1 2 3 bad 4 5\" \\\n \t\tgit rebase -i --root 2>actual &&\n-\t\ttest_grep \"pickled $(git rev-list --oneline -1 primary~1)\" \\\n+\t\ttest_grep \"pickled $(git log --format=\"%h # %s\" -1 primary~1)\" \\\n \t\t\t\tactual &&\n \t\ttest_grep \"You can fix this with .git rebase --edit-todo..\" \\\n \t\t\t\tactual &&\n@@ -1865,15 +1865,15 @@ test_expect_success '--update-refs adds label and update-ref commands' '\n \t\tset_cat_todo_editor &&\n \n \t\tcat >expect <<-EOF &&\n-\t\tpick $(git log -1 --format=%h J) J\n-\t\tfixup $(git log -1 --format=%h update-refs) fixup! J # empty\n+\t\tpick $(git log -1 --format=%h J) # J\n+\t\tfixup $(git log -1 --format=%h update-refs) # fixup! J # empty\n \t\tupdate-ref refs/heads/second\n \t\tupdate-ref refs/heads/first\n-\t\tpick $(git log -1 --format=%h K) K\n-\t\tpick $(git log -1 --format=%h L) L\n-\t\tfixup $(git log -1 --format=%h is-not-reordered) fixup! L # empty\n+\t\tpick $(git log -1 --format=%h K) # K\n+\t\tpick $(git log -1 --format=%h L) # L\n+\t\tfixup $(git log -1 --format=%h is-not-reordered) # fixup! L # empty\n \t\tupdate-ref refs/heads/third\n-\t\tpick $(git log -1 --format=%h M) M\n+\t\tpick $(git log -1 --format=%h M) # M\n \t\tupdate-ref refs/heads/no-conflict-branch\n \t\tupdate-ref refs/heads/is-not-reordered\n \t\tupdate-ref refs/heads/shared-tip\n@@ -1905,19 +1905,19 @@ test_expect_success '--update-refs adds commands with --rebase-merges' '\n \t\tcat >expect <<-EOF &&\n \t\tlabel onto\n \t\treset onto\n-\t\tpick $(git log -1 --format=%h branch2~1) F\n-\t\tpick $(git log -1 --format=%h branch2) I\n+\t\tpick $(git log -1 --format=%h branch2~1) # F\n+\t\tpick $(git log -1 --format=%h branch2) # I\n \t\tupdate-ref refs/heads/branch2\n \t\tlabel branch2\n \t\treset onto\n-\t\tpick $(git log -1 --format=%h refs/heads/second) J\n+\t\tpick $(git log -1 --format=%h refs/heads/second) # J\n \t\tupdate-ref refs/heads/second\n \t\tupdate-ref refs/heads/first\n-\t\tpick $(git log -1 --format=%h refs/heads/third~1) K\n-\t\tpick $(git log -1 --format=%h refs/heads/third) L\n-\t\tfixup $(git log -1 --format=%h update-refs-with-merge) fixup! L # empty\n+\t\tpick $(git log -1 --format=%h refs/heads/third~1) # K\n+\t\tpick $(git log -1 --format=%h refs/heads/third) # L\n+\t\tfixup $(git log -1 --format=%h update-refs-with-merge) # fixup! L # empty\n \t\tupdate-ref refs/heads/third\n-\t\tpick $(git log -1 --format=%h HEAD~2) M\n+\t\tpick $(git log -1 --format=%h HEAD~2) # M\n \t\tupdate-ref refs/heads/no-conflict-branch\n \t\tmerge -C $(git log -1 --format=%h HEAD~1) branch2 # merge\n \t\tupdate-ref refs/heads/merge-branch\ndiff --git a/t/t3415-rebase-autosquash.sh b/t/t3415-rebase-autosquash.sh\nindex fcc40d6fe1f..26b42a526a1 100755\n--- a/t/t3415-rebase-autosquash.sh\n+++ b/t/t3415-rebase-autosquash.sh\n@@ -257,8 +257,8 @@ test_expect_success 'auto squash of fixup commit that matches branch name which\n \tGIT_SEQUENCE_EDITOR=\"cat >tmp\" git rebase --autosquash -i HEAD^^ &&\n \tsed -ne \"/^[^#]/{s/[0-9a-f]\\{7,\\}/HASH/g;p;}\" tmp >actual &&\n \tcat <<-EOF >expect &&\n-\tpick HASH second commit\n-\tpick HASH fixup! self-cycle # empty\n+\tpick HASH # second commit\n+\tpick HASH # fixup! self-cycle # empty\n \tEOF\n \ttest_cmp expect actual\n '\n@@ -311,10 +311,10 @@ test_auto_fixup_fixup () {\n \t\tparent2=$(git rev-parse --short HEAD^^) &&\n \t\tparent3=$(git rev-parse --short HEAD^^^) &&\n \t\tcat >expected <<-EOF &&\n-\t\tpick $parent3 first commit\n-\t\t$1 $parent1 $1! first\n-\t\t$1 $head $1! $2! first\n-\t\tpick $parent2 second commit\n+\t\tpick $parent3 # first commit\n+\t\t$1 $parent1 # $1! first\n+\t\t$1 $head # $1! $2! first\n+\t\tpick $parent2 # second commit\n \t\tEOF\n \t\ttest_cmp expected actual\n \t) &&\n@@ -389,7 +389,7 @@ test_expect_success 'autosquash with empty custom instructionFormat' '\n \t\tset_cat_todo_editor &&\n \t\ttest_must_fail git -c rebase.instructionFormat= \\\n \t\t\trebase --autosquash  --force-rebase -i HEAD^ >actual &&\n-\t\tgit log -1 --format=\"pick %h %s\" >expect &&\n+\t\tgit log -1 --format=\"pick %h # %s\" >expect &&\n \t\ttest_cmp expect actual\n \t)\n '\ndiff --git a/t/t3430-rebase-merges.sh b/t/t3430-rebase-merges.sh\nindex b84d68c4b96..5f8fa05420c 100755\n--- a/t/t3430-rebase-merges.sh\n+++ b/t/t3430-rebase-merges.sh\n@@ -106,18 +106,18 @@ test_expect_success 'generate correct todo list' '\n \tlabel onto\n \n \treset onto\n-\tpick $b B\n+\tpick $b # B\n \tlabel first\n \n \treset onto\n-\tpick $c C\n+\tpick $c # C\n \tlabel branch-point\n-\tpick $f F\n-\tpick $g G\n+\tpick $f # F\n+\tpick $g # G\n \tlabel second\n \n \treset branch-point # C\n-\tpick $d D\n+\tpick $d # D\n \tmerge -C $e first # E\n \tmerge -C $h second # H\n \ndiff --git a/t/t5520-pull.sh b/t/t5520-pull.sh\nindex 47534f1062d..52a5e4c016b 100755\n--- a/t/t5520-pull.sh\n+++ b/t/t5520-pull.sh\n@@ -813,7 +813,7 @@ test_expect_success 'git pull --rebase does not reapply old patches' '\n \t\tcd dst &&\n \t\ttest_must_fail git pull --rebase &&\n \t\tcat .git/rebase-merge/done .git/rebase-merge/git-rebase-todo >work &&\n-\t\tgrep -v -e \\# -e ^$ work >patches &&\n+\t\tsed -e s/#.*// work | grep -v ^$ >patches &&\n \t\ttest_line_count = 1 patches &&\n \t\trm -f work\n \t)\ndiff --git a/t/t7512-status-help.sh b/t/t7512-status-help.sh\nindex 802f8f704c6..25e8e9711f8 100755\n--- a/t/t7512-status-help.sh\n+++ b/t/t7512-status-help.sh\n@@ -139,7 +139,7 @@ test_expect_success 'status during rebase -i when conflicts unresolved' '\n \tcat >expected <<EOF &&\n interactive rebase in progress; onto $ONTO\n Last command done (1 command done):\n-   pick $LAST_COMMIT one_second\n+   pick $LAST_COMMIT # one_second\n No commands remaining.\n You are currently rebasing branch '\\''rebase_i_conflicts_second'\\'' on '\\''$ONTO'\\''.\n   (fix conflicts and then run \"git rebase --continue\")\n@@ -168,7 +168,7 @@ test_expect_success 'status during rebase -i after resolving conflicts' '\n \tcat >expected <<EOF &&\n interactive rebase in progress; onto $ONTO\n Last command done (1 command done):\n-   pick $LAST_COMMIT one_second\n+   pick $LAST_COMMIT # one_second\n No commands remaining.\n You are currently rebasing branch '\\''rebase_i_conflicts_second'\\'' on '\\''$ONTO'\\''.\n   (all conflicts fixed: run \"git rebase --continue\")\n@@ -200,8 +200,8 @@ test_expect_success 'status when rebasing -i in edit mode' '\n \tcat >expected <<EOF &&\n interactive rebase in progress; onto $ONTO\n Last commands done (2 commands done):\n-   pick $COMMIT2 two_rebase_i\n-   edit $COMMIT3 three_rebase_i\n+   pick $COMMIT2 # two_rebase_i\n+   edit $COMMIT3 # three_rebase_i\n No commands remaining.\n You are currently editing a commit while rebasing branch '\\''rebase_i_edit'\\'' on '\\''$ONTO'\\''.\n   (use \"git commit --amend\" to amend the current commit)\n@@ -233,10 +233,10 @@ test_expect_success 'status when splitting a commit' '\n \tcat >expected <<EOF &&\n interactive rebase in progress; onto $ONTO\n Last commands done (2 commands done):\n-   pick $COMMIT2 two_split\n-   edit $COMMIT3 three_split\n+   pick $COMMIT2 # two_split\n+   edit $COMMIT3 # three_split\n Next command to do (1 remaining command):\n-   pick $COMMIT4 four_split\n+   pick $COMMIT4 # four_split\n   (use \"git rebase --edit-todo\" to view and edit)\n You are currently splitting a commit while rebasing branch '\\''split_commit'\\'' on '\\''$ONTO'\\''.\n   (Once your working directory is clean, run \"git rebase --continue\")\n@@ -271,8 +271,8 @@ test_expect_success 'status after editing the last commit with --amend during a\n \tcat >expected <<EOF &&\n interactive rebase in progress; onto $ONTO\n Last commands done (3 commands done):\n-   pick $COMMIT3 three_amend\n-   edit $COMMIT4 four_amend\n+   pick $COMMIT3 # three_amend\n+   edit $COMMIT4 # four_amend\n   (see more in file .git/rebase-merge/done)\n No commands remaining.\n You are currently editing a commit while rebasing branch '\\''amend_last'\\'' on '\\''$ONTO'\\''.\n@@ -309,10 +309,10 @@ test_expect_success 'status: (continue first edit) second edit' '\n \tcat >expected <<EOF &&\n interactive rebase in progress; onto $ONTO\n Last commands done (2 commands done):\n-   edit $COMMIT2 two_edits\n-   edit $COMMIT3 three_edits\n+   edit $COMMIT2 # two_edits\n+   edit $COMMIT3 # three_edits\n Next command to do (1 remaining command):\n-   pick $COMMIT4 four_edits\n+   pick $COMMIT4 # four_edits\n   (use \"git rebase --edit-todo\" to view and edit)\n You are currently editing a commit while rebasing branch '\\''several_edits'\\'' on '\\''$ONTO'\\''.\n   (use \"git commit --amend\" to amend the current commit)\n@@ -340,10 +340,10 @@ test_expect_success 'status: (continue first edit) second edit and split' '\n \tcat >expected <<EOF &&\n interactive rebase in progress; onto $ONTO\n Last commands done (2 commands done):\n-   edit $COMMIT2 two_edits\n-   edit $COMMIT3 three_edits\n+   edit $COMMIT2 # two_edits\n+   edit $COMMIT3 # three_edits\n Next command to do (1 remaining command):\n-   pick $COMMIT4 four_edits\n+   pick $COMMIT4 # four_edits\n   (use \"git rebase --edit-todo\" to view and edit)\n You are currently splitting a commit while rebasing branch '\\''several_edits'\\'' on '\\''$ONTO'\\''.\n   (Once your working directory is clean, run \"git rebase --continue\")\n@@ -375,10 +375,10 @@ test_expect_success 'status: (continue first edit) second edit and amend' '\n \tcat >expected <<EOF &&\n interactive rebase in progress; onto $ONTO\n Last commands done (2 commands done):\n-   edit $COMMIT2 two_edits\n-   edit $COMMIT3 three_edits\n+   edit $COMMIT2 # two_edits\n+   edit $COMMIT3 # three_edits\n Next command to do (1 remaining command):\n-   pick $COMMIT4 four_edits\n+   pick $COMMIT4 # four_edits\n   (use \"git rebase --edit-todo\" to view and edit)\n You are currently editing a commit while rebasing branch '\\''several_edits'\\'' on '\\''$ONTO'\\''.\n   (use \"git commit --amend\" to amend the current commit)\n@@ -406,10 +406,10 @@ test_expect_success 'status: (amend first edit) second edit' '\n \tcat >expected <<EOF &&\n interactive rebase in progress; onto $ONTO\n Last commands done (2 commands done):\n-   edit $COMMIT2 two_edits\n-   edit $COMMIT3 three_edits\n+   edit $COMMIT2 # two_edits\n+   edit $COMMIT3 # three_edits\n Next command to do (1 remaining command):\n-   pick $COMMIT4 four_edits\n+   pick $COMMIT4 # four_edits\n   (use \"git rebase --edit-todo\" to view and edit)\n You are currently editing a commit while rebasing branch '\\''several_edits'\\'' on '\\''$ONTO'\\''.\n   (use \"git commit --amend\" to amend the current commit)\n@@ -438,10 +438,10 @@ test_expect_success 'status: (amend first edit) second edit and split' '\n \tcat >expected <<EOF &&\n interactive rebase in progress; onto $ONTO\n Last commands done (2 commands done):\n-   edit $COMMIT2 two_edits\n-   edit $COMMIT3 three_edits\n+   edit $COMMIT2 # two_edits\n+   edit $COMMIT3 # three_edits\n Next command to do (1 remaining command):\n-   pick $COMMIT4 four_edits\n+   pick $COMMIT4 # four_edits\n   (use \"git rebase --edit-todo\" to view and edit)\n You are currently splitting a commit while rebasing branch '\\''several_edits'\\'' on '\\''$ONTO'\\''.\n   (Once your working directory is clean, run \"git rebase --continue\")\n@@ -474,10 +474,10 @@ test_expect_success 'status: (amend first edit) second edit and amend' '\n \tcat >expected <<EOF &&\n interactive rebase in progress; onto $ONTO\n Last commands done (2 commands done):\n-   edit $COMMIT2 two_edits\n-   edit $COMMIT3 three_edits\n+   edit $COMMIT2 # two_edits\n+   edit $COMMIT3 # three_edits\n Next command to do (1 remaining command):\n-   pick $COMMIT4 four_edits\n+   pick $COMMIT4 # four_edits\n   (use \"git rebase --edit-todo\" to view and edit)\n You are currently editing a commit while rebasing branch '\\''several_edits'\\'' on '\\''$ONTO'\\''.\n   (use \"git commit --amend\" to amend the current commit)\n@@ -507,10 +507,10 @@ test_expect_success 'status: (split first edit) second edit' '\n \tcat >expected <<EOF &&\n interactive rebase in progress; onto $ONTO\n Last commands done (2 commands done):\n-   edit $COMMIT2 two_edits\n-   edit $COMMIT3 three_edits\n+   edit $COMMIT2 # two_edits\n+   edit $COMMIT3 # three_edits\n Next command to do (1 remaining command):\n-   pick $COMMIT4 four_edits\n+   pick $COMMIT4 # four_edits\n   (use \"git rebase --edit-todo\" to view and edit)\n You are currently editing a commit while rebasing branch '\\''several_edits'\\'' on '\\''$ONTO'\\''.\n   (use \"git commit --amend\" to amend the current commit)\n@@ -541,10 +541,10 @@ test_expect_success 'status: (split first edit) second edit and split' '\n \tcat >expected <<EOF &&\n interactive rebase in progress; onto $ONTO\n Last commands done (2 commands done):\n-   edit $COMMIT2 two_edits\n-   edit $COMMIT3 three_edits\n+   edit $COMMIT2 # two_edits\n+   edit $COMMIT3 # three_edits\n Next command to do (1 remaining command):\n-   pick $COMMIT4 four_edits\n+   pick $COMMIT4 # four_edits\n   (use \"git rebase --edit-todo\" to view and edit)\n You are currently splitting a commit while rebasing branch '\\''several_edits'\\'' on '\\''$ONTO'\\''.\n   (Once your working directory is clean, run \"git rebase --continue\")\n@@ -579,10 +579,10 @@ test_expect_success 'status: (split first edit) second edit and amend' '\n \tcat >expected <<EOF &&\n interactive rebase in progress; onto $ONTO\n Last commands done (2 commands done):\n-   edit $COMMIT2 two_edits\n-   edit $COMMIT3 three_edits\n+   edit $COMMIT2 # two_edits\n+   edit $COMMIT3 # three_edits\n Next command to do (1 remaining command):\n-   pick $COMMIT4 four_edits\n+   pick $COMMIT4 # four_edits\n   (use \"git rebase --edit-todo\" to view and edit)\n You are currently editing a commit while rebasing branch '\\''several_edits'\\'' on '\\''$ONTO'\\''.\n   (use \"git commit --amend\" to amend the current commit)\n@@ -997,11 +997,11 @@ test_expect_success 'status: two commands done with some white lines in done fil\n \tcat >expected <<EOF &&\n interactive rebase in progress; onto $ONTO\n Last commands done (2 commands done):\n-   pick $COMMIT2 two_commit\n+   pick $COMMIT2 # two_commit\n    exec exit 15\n Next commands to do (2 remaining commands):\n-   pick $COMMIT3 three_commit\n-   pick $COMMIT4 four_commit\n+   pick $COMMIT3 # three_commit\n+   pick $COMMIT4 # four_commit\n   (use \"git rebase --edit-todo\" to view and edit)\n You are currently editing a commit while rebasing branch '\\''several_commits'\\'' on '\\''$ONTO'\\''.\n   (use \"git commit --amend\" to amend the current commit)\n@@ -1025,12 +1025,12 @@ test_expect_success 'status: two remaining commands with some white lines in tod\n \tcat >expected <<EOF &&\n interactive rebase in progress; onto $ONTO\n Last commands done (3 commands done):\n-   pick $COMMIT2 two_commit\n+   pick $COMMIT2 # two_commit\n    exec exit 15\n   (see more in file .git/rebase-merge/done)\n Next commands to do (2 remaining commands):\n-   pick $COMMIT3 three_commit\n-   pick $COMMIT4 four_commit\n+   pick $COMMIT3 # three_commit\n+   pick $COMMIT4 # four_commit\n   (use \"git rebase --edit-todo\" to view and edit)\n You are currently editing a commit while rebasing branch '\\''several_commits'\\'' on '\\''$ONTO'\\''.\n   (use \"git commit --amend\" to amend the current commit)\n@@ -1050,7 +1050,7 @@ test_expect_success 'status: handle not-yet-started rebase -i gracefully' '\n On branch several_commits\n No commands done.\n Next command to do (1 remaining command):\n-   pick $COMMIT four_commit\n+   pick $COMMIT # four_commit\n   (use \"git rebase --edit-todo\" to view and edit)\n You are currently editing a commit while rebasing branch '\\''several_commits'\\'' on '\\''$ONTO'\\''.\n   (use \"git commit --amend\" to amend the current commit)\n\nbase-commit: 1a8a4971cc6c179c4dd711f4a7f5d7178f4b3ab7\n-- \ngitgitgadget\n"},{"id":"518082","messageId":"5voz3jolpff7wbs5yg7jvz5dt7omcikhna7j7646veagr63quv@kkxhzxxf4uf2","threadId":"63463","inReplyTo":"pull.1923.git.1747275627422.gitgitgadget@gmail.com","subject":"Re: [PATCH] sequencer: make it clearer that commit descriptions are just comments","fromName":"Reto","fromEmail":"reto@slightlybroken.com","sentAt":"2025-05-15T04:42:41Z","receivedAt":"2025-05-15T04:48:26Z","isPatch":true,"sender":{"key":"reto@slightlybroken.com","avatar":null},"body":"On Thu, May 15, 2025 at 02:20:27AM +0000, Elijah Newren via GitGitGadget wrote:\n> Every once in a while, users report that editing the commit summaries\n> in the todo list does not get reflected in the rebase operation,\n> suggesting that users are (a) only using one-line commit messages, and\n> (b) not understanding that the commit summaries are merely helpful\n> comments to help them find the right hashes.\n\nAs with everything in git, you can learn that this is the case.\nYou could as well just add a explanatory comment to the footer.\n\n> It may be difficult to correct users' poor commit messages, but we can\n> at least try to make it clearer that the commit summaries are not\n> directives of some sort by inserting a comment character.  Hopefully\n> that leads to them looking a little further and noticing the hints at\n> the bottom to use 'reword' or 'edit' directives.\n\nFor fancy things/editors that recognize comments, this will *dim* the commit\nmessages, to light grey or such.\nThis is decidedly not what I'd like to happen at least. The commit messages\nthere are my primary way of navigating the commit, given that I'm not learning\nthe commit shas by hard ;)\n\nWhile I appreciate the motivation, I don't think the comment string is a\ngood approach here.\n\nCheers,\nReto\n"},{"id":"518091","messageId":"40c32d33-b170-4319-ba1b-b93dcb2b23cf@crinan.ddns.net","threadId":"63463","inReplyTo":"5voz3jolpff7wbs5yg7jvz5dt7omcikhna7j7646veagr63quv@kkxhzxxf4uf2","subject":"Re: [PATCH] sequencer: make it clearer that commit descriptions are just comments","fromName":"Phillip Wood","fromEmail":"phillip.wood123@gmail.com","sentAt":"2025-05-15T10:16:19Z","receivedAt":"2025-05-15T10:16:21Z","isPatch":true,"sender":{"key":"phillip.wood@dunelm.org.uk","avatar":null},"body":"Hi Reto\n\nOn 15/05/2025 05:42, Reto wrote:\n> On Thu, May 15, 2025 at 02:20:27AM +0000, Elijah Newren via GitGitGadget wrote:\n> \n>> It may be difficult to correct users' poor commit messages, but we can\n>> at least try to make it clearer that the commit summaries are not\n>> directives of some sort by inserting a comment character.  Hopefully\n>> that leads to them looking a little further and noticing the hints at\n>> the bottom to use 'reword' or 'edit' directives.\n> \n> For fancy things/editors that recognize comments, this will *dim* the commit\n> messages, to light grey or such.\n> This is decidedly not what I'd like to happen at least. The commit messages\n> there are my primary way of navigating the commit, given that I'm not learning\n> the commit shas by hard ;)\n\nAs the commit message makes clear we already insert a '#' between the \nparents and subject line of a merge command. We also append '# empty' to \nempty commits. If there are editors that erroneously treat a '#' \nanywhere in the line as a comment they're already dimming things they \nshouldn't. A line in the todo list is only a comment if it starts with \ncore.commentString which defaults to '#'. Editors that unconditionally \ntreat '#' as the start of a comment are buggy.\n\n> While I appreciate the motivation, I don't think the comment string is a\n> good approach here.\n\nAs the commit message points out strictly speaking we're not using the \ncomment string we using a fixed single character.\n\nBest Wishes\n\nPhillip\n\n"},{"id":"518092","messageId":"177e43a6-6086-4e20-8ba3-6b84e7025fc2@gmail.com","threadId":"63463","inReplyTo":"40c32d33-b170-4319-ba1b-b93dcb2b23cf@crinan.ddns.net","subject":"Re: [PATCH] sequencer: make it clearer that commit descriptions are just comments","fromName":"Phillip Wood","fromEmail":"phillip.wood123@gmail.com","sentAt":"2025-05-15T10:19:38Z","receivedAt":"2025-05-15T10:19:41Z","isPatch":true,"sender":{"key":"phillip.wood@dunelm.org.uk","avatar":null},"body":"Sorry I forgot to Cc the original author in the message below.\n\nOn 15/05/2025 11:16, Phillip Wood wrote:\n> Hi Reto\n> \n> On 15/05/2025 05:42, Reto wrote:\n>> On Thu, May 15, 2025 at 02:20:27AM +0000, Elijah Newren via \n>> GitGitGadget wrote:\n>>\n>>> It may be difficult to correct users' poor commit messages, but we can\n>>> at least try to make it clearer that the commit summaries are not\n>>> directives of some sort by inserting a comment character.  Hopefully\n>>> that leads to them looking a little further and noticing the hints at\n>>> the bottom to use 'reword' or 'edit' directives.\n>>\n>> For fancy things/editors that recognize comments, this will *dim* the \n>> commit\n>> messages, to light grey or such.\n>> This is decidedly not what I'd like to happen at least. The commit \n>> messages\n>> there are my primary way of navigating the commit, given that I'm not \n>> learning\n>> the commit shas by hard ;)\n> \n> As the commit message makes clear we already insert a '#' between the \n> parents and subject line of a merge command. We also append '# empty' to \n> empty commits. If there are editors that erroneously treat a '#' \n> anywhere in the line as a comment they're already dimming things they \n> shouldn't. A line in the todo list is only a comment if it starts with \n> core.commentString which defaults to '#'. Editors that unconditionally \n> treat '#' as the start of a comment are buggy.\n> \n>> While I appreciate the motivation, I don't think the comment string is a\n>> good approach here.\n> \n> As the commit message points out strictly speaking we're not using the \n> comment string we using a fixed single character.\n> \n> Best Wishes\n> \n> Phillip\n> \n\n"},{"id":"518121","messageId":"f1de4a91-2d64-457d-9272-3ccb56393825@gmail.com","threadId":"63463","inReplyTo":"pull.1923.git.1747275627422.gitgitgadget@gmail.com","subject":"Re: [PATCH] sequencer: make it clearer that commit descriptions are just comments","fromName":"Phillip Wood","fromEmail":"phillip.wood123@gmail.com","sentAt":"2025-05-15T13:02:59Z","receivedAt":"2025-05-15T13:03:13Z","isPatch":true,"sender":{"key":"phillip.wood@dunelm.org.uk","avatar":null},"body":"Hi Elijah\n\nOn 15/05/2025 03:20, Elijah Newren via GitGitGadget wrote:\n> From: Elijah Newren <newren@gmail.com>\n> \n> Every once in a while, users report that editing the commit summaries\n> in the todo list does not get reflected in the rebase operation,\n> suggesting that users are (a) only using one-line commit messages, and\n> (b) not understanding that the commit summaries are merely helpful\n> comments to help them find the right hashes.\n> \n> It may be difficult to correct users' poor commit messages, but we can\n> at least try to make it clearer that the commit summaries are not\n> directives of some sort by inserting a comment character.  Hopefully\n> that leads to them looking a little further and noticing the hints at\n> the bottom to use 'reword' or 'edit' directives.\n> \n> Yes, this change may look funny at first since it hardcodes '#' rather\n> than using comment_line_str.  However:\n> \n>    * comment_line_str exists to allow disambiguation between lines in\n>      a commit message and lines that are instructions to users editing\n>      the commit message.  No such disambiguation is needed for these\n>      comments that occur on the same line after existing directives\n>    * the exact \"comment\" character(s) on regular pick lines used aren't\n>      actually important; I could have used anything, including completely\n>      random variable length text for each line and it'd work because we\n>      ignore everything after 'pick' and the hash.\n>    * The whole point of this change is to signal to users that they\n>      should NOT be editing any part of the line after the hash (and if\n>      they do so, their edits will be ignored), while the whole point of\n>      comment_line_str is to allow highly flexible editing.  So making\n>      it more general by using comment_line_str actually feels\n>      counterproductive.\n>    * The character for merge directives absolutely must be '#'; that\n>      has been deeply hardcoded for a long time (see below), and will\n>      break if some other comment character is used instead.  In a\n>      desire to have pick and merge directives be similar, I use the\n>      same comment character for both.\n>    * Perhaps merge directives could be fixed to not be inflexible about\n>      the comment character used, if someone feels highly motivated, but\n>      I think that should be done in a separate follow-on patch.\n> \n> Here are (some of?) the locations where '#' has already been hardcoded\n> for a long time for merges:\n> \n>    1) In check_label_or_ref_arg():\n> \tcase TODO_LABEL:\n> \t\t/*\n> \t\t * '#' is not a valid label as the merge command uses it to\n> \t\t * separate merge parents from the commit subject.\n> \t\t */\n> \n>    2) In do_merge():\n> \n> \t/*\n> \t * For octopus merges, the arg starts with the list of revisions to be\n> \t * merged. The list is optionally followed by '#' and the oneline.\n> \t */\n> \tmerge_arg_len = oneline_offset = arg_len;\n> \tfor (p = arg; p - arg < arg_len; p += strspn(p, \" \\t\\n\")) {\n> \t\tif (!*p)\n> \t\t\tbreak;\n> \t\tif (*p == '#' && (!p[1] || isspace(p[1]))) {\n> \n>    3) In label_oid():\n> \n> \t\tif ((buf->len == the_hash_algo->hexsz &&\n> \t\t     !get_oid_hex(label, &dummy)) ||\n> \t\t    (buf->len == 1 && *label == '#') ||\n> \t\t    hashmap_get_from_hash(&state->labels,\n> \t\t\t\t\t  strihash(label), label)) {\n> \t\t\t/*\n> \t\t\t * If the label already exists, or if the label is a\n> \t\t\t * valid full OID, or the label is a '#' (which we use\n> \t\t\t * as a separator between merge heads and oneline), we\n> \t\t\t * append a dash and a number to make it unique.\n> \t\t\t */\n\nThanks for the comprehensive commit message. I think this change is a \nvery good idea. The code changes all look good to me. I've left one \ncomment on the tests below though I should admit that I could feel my \neyes glazing over by the time I got to the end of all the test changes. \nThe test changes are pretty much all mechanical though so I'm reasonably \nconfidant that the tests would fail if there was something wrong with \nthe conversion.\n\n> diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh\n> index 47534f1062d..52a5e4c016b 100755\n> --- a/t/t5520-pull.sh\n> +++ b/t/t5520-pull.sh\n> @@ -813,7 +813,7 @@ test_expect_success 'git pull --rebase does not reapply old patches' '\n>   \t\tcd dst &&\n>   \t\ttest_must_fail git pull --rebase &&\n>   \t\tcat .git/rebase-merge/done .git/rebase-merge/git-rebase-todo >work &&\n> -\t\tgrep -v -e \\# -e ^$ work >patches &&\n> +\t\tsed -e s/#.*// work | grep -v ^$ >patches &&\n\nI think we could just use 'sed -n \"!/^#/p work >patches &&\" here\n\nThanks\n\nPhillip\n"},{"id":"518139","messageId":"xmqqzffe2cyd.fsf@gitster.g","threadId":"63463","inReplyTo":"pull.1923.git.1747275627422.gitgitgadget@gmail.com","subject":"Re: [PATCH] sequencer: make it clearer that commit descriptions are just comments","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-05-15T13:58:02Z","receivedAt":"2025-05-15T13:58:04Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Elijah Newren via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n\n> suggesting that users are (a) only using one-line commit messages, and\n> (b) not understanding that the commit summaries are merely helpful\n> comments to help them find the right hashes.\n>\n> It may be difficult to correct users' poor commit messages, but we can\n> at least try to make it clearer that the commit summaries are not\n> directives of some sort by inserting a comment character.  Hopefully\n> that leads to them looking a little further and noticing the hints at\n> the bottom to use 'reword' or 'edit' directives.\n\nCute and clever.\n\n>  Last commands done (2 commands done):\n> -   pick $COMMIT2 two_split\n> -   edit $COMMIT3 three_split\n> +   pick $COMMIT2 # two_split\n> +   edit $COMMIT3 # three_split\n>  Next command to do (1 remaining command):\n> -   pick $COMMIT4 four_split\n> +   pick $COMMIT4 # four_split\n>    (use \"git rebase --edit-todo\" to view and edit)\n\nThese show the intentions quite well.  I think all places the\naddition of '#' is done at the output layer, and the matching of\ncommits for the purpose of --autosquash should be done solely using\nthe internal representation without '#', this change should not\nbreak anything, I would think, that we internally have.\n\nBreaking custom todo-editors the users may have is a different\nstory, but if they are somehow matching against the first line of\nthe commit log message when there prominently is a short-but-unique\ncommit object name, they are simply crazy and not worth worrying\nabout, I would say ;-)\n\n\n"},{"id":"518145","messageId":"xmqqv7q13m15.fsf@gitster.g","threadId":"63463","inReplyTo":"f1de4a91-2d64-457d-9272-3ccb56393825@gmail.com","subject":"Re: [PATCH] sequencer: make it clearer that commit descriptions are just comments","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-05-15T15:56:38Z","receivedAt":"2025-05-15T15:56:41Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Phillip Wood <phillip.wood123@gmail.com> writes:\n\n>> -\t\tgrep -v -e \\# -e ^$ work >patches &&\n>> +\t\tsed -e s/#.*// work | grep -v ^$ >patches &&\n>\n> I think we could just use 'sed -n \"!/^#/p work >patches &&\" here\n\nOr even \"sed -e '/^#/d' -e '/^$/d'\" ?\n"},{"id":"518241","messageId":"ABFDED43-3AC7-455E-9736-A8D9AC0F3A40@gmail.com","threadId":"63463","inReplyTo":"xmqqv7q13m15.fsf@gitster.g","subject":"Re: [PATCH] sequencer: make it clearer that commit descriptions are just comments","fromName":"Ben Knoble","fromEmail":"ben.knoble@gmail.com","sentAt":"2025-05-16T12:04:25Z","receivedAt":"2025-05-16T14:07:14Z","isPatch":true,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"\n\n> Le 15 mai 2025 à 11:56, Junio C Hamano <gitster@pobox.com> a écrit :\n> \n> Phillip Wood <phillip.wood123@gmail.com> writes:\n> \n>>> -        grep -v -e \\# -e ^$ work >patches &&\n>>> +        sed -e s/#.*// work | grep -v ^$ >patches &&\n>> \n>> I think we could just use 'sed -n \"!/^#/p work >patches &&\" here\n> \n> Or even \"sed -e '/^#/d' -e '/^$/d'\" ?\n\nI’m probably missing something obvious, but why step away from \"grep -v -e ^\\# -e ^$\"? A one character change from the original ;) If we must go with Sed, I’d prefer Junio’s construct (combining, with obvious semantics via \"d\") over the sed|grep pipeline. "},{"id":"518252","messageId":"CABPp-BFKrgB5_rMX=i0t1Dvj2XwEoCS71+QAFY=hcTnyDnOr7Q@mail.gmail.com","threadId":"63463","inReplyTo":"ABFDED43-3AC7-455E-9736-A8D9AC0F3A40@gmail.com","subject":"Re: [PATCH] sequencer: make it clearer that commit descriptions are just comments","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2025-05-16T15:22:44Z","receivedAt":"2025-05-16T15:22:58Z","isPatch":true,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"On Fri, May 16, 2025 at 7:07 AM Ben Knoble <ben.knoble@gmail.com> wrote:\n>\n> > Le 15 mai 2025 à 11:56, Junio C Hamano <gitster@pobox.com> a écrit :\n> >\n> > Phillip Wood <phillip.wood123@gmail.com> writes:\n> >\n> >>> -        grep -v -e \\# -e ^$ work >patches &&\n> >>> +        sed -e s/#.*// work | grep -v ^$ >patches &&\n> >>\n> >> I think we could just use 'sed -n \"!/^#/p work >patches &&\" here\n> >\n> > Or even \"sed -e '/^#/d' -e '/^$/d'\" ?\n>\n> I’m probably missing something obvious, but why step away from \"grep -v -e ^\\# -e ^$\"? A one character change from the original ;) If we must go with Sed, I’d prefer Junio’s construct (combining, with obvious semantics via \"d\") over the sed|grep pipeline.\n\n:-)  I made this exact change to make it be a one-character\nmodification of the original, and pushed it up yesterday\n(https://github.com/gitgitgadget/git/pull/1923); I just hadn't\n/submit'ted it to the list yet.  I agree that every suggestion folks\nhave made so far is better than my original proposal, but I kind of\nprefer this latest suggestion of just making a one-character\nmodification.  So, unless folks object, I'll indeed go with this one.\n"},{"id":"518261","messageId":"xmqqikm0wmpl.fsf@gitster.g","threadId":"63463","inReplyTo":"ABFDED43-3AC7-455E-9736-A8D9AC0F3A40@gmail.com","subject":"Re: [PATCH] sequencer: make it clearer that commit descriptions are just comments","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-05-16T16:21:26Z","receivedAt":"2025-05-16T16:21:28Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ben Knoble <ben.knoble@gmail.com> writes:\n\n>> Le 15 mai 2025 à 11:56, Junio C Hamano <gitster@pobox.com> a écrit :\n>> \n>> Phillip Wood <phillip.wood123@gmail.com> writes:\n>> \n>>>> -        grep -v -e \\# -e ^$ work >patches &&\n>>>> +        sed -e s/#.*// work | grep -v ^$ >patches &&\n>>> \n>>> I think we could just use 'sed -n \"!/^#/p work >patches &&\" here\n>> \n>> Or even \"sed -e '/^#/d' -e '/^$/d'\" ?\n>\n> I’m probably missing something obvious, but why step away from \"grep -v -e ^\\# -e ^$\"? A one character change from the original ;) If we must go with Sed, I’d prefer Junio’s construct (combining, with obvious semantics via \"d\") over the sed|grep pipeline. \n\nMine was a spinal reflex against piping sed and grep; I do not see a\nreason why \"grep -v\" with two patterns like you gave should not\nwork---that is a good way to remove the pipe, too.\n\nThanks.\n"},{"id":"518262","messageId":"pull.1923.v2.git.1747412786573.gitgitgadget@gmail.com","threadId":"63463","inReplyTo":"pull.1923.git.1747275627422.gitgitgadget@gmail.com","subject":"[PATCH v2] sequencer: make it clearer that commit descriptions are just comments","fromName":"Elijah Newren via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2025-05-16T16:26:26Z","receivedAt":"2025-05-16T16:26:30Z","isPatch":true,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"From: Elijah Newren <newren@gmail.com>\n\nEvery once in a while, users report that editing the commit summaries\nin the todo list does not get reflected in the rebase operation,\nsuggesting that users are (a) only using one-line commit messages, and\n(b) not understanding that the commit summaries are merely helpful\ncomments to help them find the right hashes.\n\nIt may be difficult to correct users' poor commit messages, but we can\nat least try to make it clearer that the commit summaries are not\ndirectives of some sort by inserting a comment character.  Hopefully\nthat leads to them looking a little further and noticing the hints at\nthe bottom to use 'reword' or 'edit' directives.\n\nYes, this change may look funny at first since it hardcodes '#' rather\nthan using comment_line_str.  However:\n\n  * comment_line_str exists to allow disambiguation between lines in\n    a commit message and lines that are instructions to users editing\n    the commit message.  No such disambiguation is needed for these\n    comments that occur on the same line after existing directives\n  * the exact \"comment\" character(s) on regular pick lines used aren't\n    actually important; I could have used anything, including completely\n    random variable length text for each line and it'd work because we\n    ignore everything after 'pick' and the hash.\n  * The whole point of this change is to signal to users that they\n    should NOT be editing any part of the line after the hash (and if\n    they do so, their edits will be ignored), while the whole point of\n    comment_line_str is to allow highly flexible editing.  So making\n    it more general by using comment_line_str actually feels\n    counterproductive.\n  * The character for merge directives absolutely must be '#'; that\n    has been deeply hardcoded for a long time (see below), and will\n    break if some other comment character is used instead.  In a\n    desire to have pick and merge directives be similar, I use the\n    same comment character for both.\n  * Perhaps merge directives could be fixed to not be inflexible about\n    the comment character used, if someone feels highly motivated, but\n    I think that should be done in a separate follow-on patch.\n\nHere are (some of?) the locations where '#' has already been hardcoded\nfor a long time for merges:\n\n  1) In check_label_or_ref_arg():\n\tcase TODO_LABEL:\n\t\t/*\n\t\t * '#' is not a valid label as the merge command uses it to\n\t\t * separate merge parents from the commit subject.\n\t\t */\n\n  2) In do_merge():\n\n\t/*\n\t * For octopus merges, the arg starts with the list of revisions to be\n\t * merged. The list is optionally followed by '#' and the oneline.\n\t */\n\tmerge_arg_len = oneline_offset = arg_len;\n\tfor (p = arg; p - arg < arg_len; p += strspn(p, \" \\t\\n\")) {\n\t\tif (!*p)\n\t\t\tbreak;\n\t\tif (*p == '#' && (!p[1] || isspace(p[1]))) {\n\n  3) In label_oid():\n\n\t\tif ((buf->len == the_hash_algo->hexsz &&\n\t\t     !get_oid_hex(label, &dummy)) ||\n\t\t    (buf->len == 1 && *label == '#') ||\n\t\t    hashmap_get_from_hash(&state->labels,\n\t\t\t\t\t  strihash(label), label)) {\n\t\t\t/*\n\t\t\t * If the label already exists, or if the label is a\n\t\t\t * valid full OID, or the label is a '#' (which we use\n\t\t\t * as a separator between merge heads and oneline), we\n\t\t\t * append a dash and a number to make it unique.\n\t\t\t */\n\nSigned-off-by: Elijah Newren <newren@gmail.com>\n---\n    sequencer: make it clearer that commit descriptions are just comments\n    \n    Changes since v1:\n    \n     * Simplified the change to t5520 down to a single character change\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-1923%2Fnewren%2Fsequencer-todo-commit-msgs-are-comments-v2\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1923/newren/sequencer-todo-commit-msgs-are-comments-v2\nPull-Request: https://github.com/gitgitgadget/git/pull/1923\n\nRange-diff vs v1:\n\n 1:  e5f3d7059e4 ! 1:  5d290203d62 sequencer: make it clearer that commit descriptions are just comments\n     @@ t/t5520-pull.sh: test_expect_success 'git pull --rebase does not reapply old pat\n       \t\ttest_must_fail git pull --rebase &&\n       \t\tcat .git/rebase-merge/done .git/rebase-merge/git-rebase-todo >work &&\n      -\t\tgrep -v -e \\# -e ^$ work >patches &&\n     -+\t\tsed -e s/#.*// work | grep -v ^$ >patches &&\n     ++\t\tgrep -v -e ^\\# -e ^$ work >patches &&\n       \t\ttest_line_count = 1 patches &&\n       \t\trm -f work\n       \t)\n\n\n sequencer.c                   | 16 +++++--\n t/t3404-rebase-interactive.sh | 54 +++++++++++-----------\n t/t3415-rebase-autosquash.sh  | 14 +++---\n t/t3430-rebase-merges.sh      | 10 ++--\n t/t5520-pull.sh               |  2 +-\n t/t7512-status-help.sh        | 86 +++++++++++++++++------------------\n 6 files changed, 94 insertions(+), 88 deletions(-)\n\ndiff --git a/sequencer.c b/sequencer.c\nindex b5c4043757e..2735966544b 100644\n--- a/sequencer.c\n+++ b/sequencer.c\n@@ -5901,11 +5901,11 @@ static int make_script_with_merges(struct pretty_print_context *pp,\n \n \t\t/* Create a label from the commit message */\n \t\tstrbuf_reset(&label_from_message);\n-\t\tif (skip_prefix(oneline.buf, \"Merge \", &p1) &&\n+\t\tif (skip_prefix(oneline.buf, \"# Merge \", &p1) &&\n \t\t    (p1 = strchr(p1, '\\'')) &&\n \t\t    (p2 = strchr(++p1, '\\'')))\n \t\t\tstrbuf_add(&label_from_message, p1, p2 - p1);\n-\t\telse if (skip_prefix(oneline.buf, \"Merge pull request \",\n+\t\telse if (skip_prefix(oneline.buf, \"# Merge pull request \",\n \t\t\t\t     &p1) &&\n \t\t\t (p1 = strstr(p1, \" from \")))\n \t\t\tstrbuf_addstr(&label_from_message, p1 + strlen(\" from \"));\n@@ -5940,7 +5940,7 @@ static int make_script_with_merges(struct pretty_print_context *pp,\n \n \t\t\tstrbuf_addstr(&buf, label_oid(oid, label, &state));\n \t\t}\n-\t\tstrbuf_addf(&buf, \" # %s\", oneline.buf);\n+\t\tstrbuf_addf(&buf, \" %s\", oneline.buf);\n \n \t\tFLEX_ALLOC_STR(entry, string, buf.buf);\n \t\toidcpy(&entry->entry.oid, &commit->object.oid);\n@@ -6022,7 +6022,7 @@ static int make_script_with_merges(struct pretty_print_context *pp,\n \t\t\telse {\n \t\t\t\tstrbuf_reset(&oneline);\n \t\t\t\tpretty_print_commit(pp, commit, &oneline);\n-\t\t\t\tstrbuf_addf(out, \"%s %s # %s\\n\",\n+\t\t\t\tstrbuf_addf(out, \"%s %s %s\\n\",\n \t\t\t\t\t    cmd_reset, to, oneline.buf);\n \t\t\t}\n \t\t}\n@@ -6090,8 +6090,14 @@ int sequencer_make_script(struct repository *r, struct strbuf *out, int argc,\n \tgit_config_get_string(\"rebase.instructionFormat\", &format);\n \tif (!format || !*format) {\n \t\tfree(format);\n-\t\tformat = xstrdup(\"%s\");\n+\t\tformat = xstrdup(\"# %s\");\n \t}\n+\tif (*format != '#') {\n+\t\tchar *temp = format;\n+\t\tformat = xstrfmt(\"# %s\", temp);\n+\t\tfree(temp);\n+\t}\n+\n \tget_commit_format(format, &revs);\n \tfree(format);\n \tpp.fmt = revs.commit_format;\ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex 2aee9789a2f..6bac217ed35 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -1468,7 +1468,7 @@ test_expect_success 'rebase -i respects rebase.missingCommitsCheck = warn' '\n \tcat >expect <<-EOF &&\n \tWarning: some commits may have been dropped accidentally.\n \tDropped commits (newer to older):\n-\t - $(git rev-list --pretty=oneline --abbrev-commit -1 primary)\n+\t - $(git log --format=\"%h # %s\" -1 primary)\n \tTo avoid this message, use \"drop\" to explicitly remove a commit.\n \tEOF\n \ttest_config rebase.missingCommitsCheck warn &&\n@@ -1486,8 +1486,8 @@ test_expect_success 'rebase -i respects rebase.missingCommitsCheck = error' '\n \tcat >expect <<-EOF &&\n \tWarning: some commits may have been dropped accidentally.\n \tDropped commits (newer to older):\n-\t - $(git rev-list --pretty=oneline --abbrev-commit -1 primary)\n-\t - $(git rev-list --pretty=oneline --abbrev-commit -1 primary~2)\n+\t - $(git log --format=\"%h # %s\" -1 primary)\n+\t - $(git log --format=\"%h # %s\" -1 primary~2)\n \tTo avoid this message, use \"drop\" to explicitly remove a commit.\n \n \tUse '\\''git config rebase.missingCommitsCheck'\\'' to change the level of warnings.\n@@ -1530,11 +1530,11 @@ test_expect_success 'rebase --edit-todo respects rebase.missingCommitsCheck = ig\n test_expect_success 'rebase --edit-todo respects rebase.missingCommitsCheck = warn' '\n \tcat >expect <<-EOF &&\n \terror: invalid command '\\''pickled'\\''\n-\terror: invalid line 1: pickled $(git rev-list --pretty=oneline --abbrev-commit -1 primary~4)\n+\terror: invalid line 1: pickled $(git log --format=\"%h # %s\" -1 primary~4)\n \tWarning: some commits may have been dropped accidentally.\n \tDropped commits (newer to older):\n-\t - $(git rev-list --pretty=oneline --abbrev-commit -1 primary)\n-\t - $(git rev-list --pretty=oneline --abbrev-commit -1 primary~4)\n+\t - $(git log --format=\"%h # %s\" -1 primary)\n+\t - $(git log --format=\"%h # %s\" -1 primary~4)\n \tTo avoid this message, use \"drop\" to explicitly remove a commit.\n \tEOF\n \thead -n5 expect >expect.2 &&\n@@ -1565,11 +1565,11 @@ test_expect_success 'rebase --edit-todo respects rebase.missingCommitsCheck = wa\n test_expect_success 'rebase --edit-todo respects rebase.missingCommitsCheck = error' '\n \tcat >expect <<-EOF &&\n \terror: invalid command '\\''pickled'\\''\n-\terror: invalid line 1: pickled $(git rev-list --pretty=oneline --abbrev-commit -1 primary~4)\n+\terror: invalid line 1: pickled $(git log --format=\"%h # %s\" -1 primary~4)\n \tWarning: some commits may have been dropped accidentally.\n \tDropped commits (newer to older):\n-\t - $(git rev-list --pretty=oneline --abbrev-commit -1 primary)\n-\t - $(git rev-list --pretty=oneline --abbrev-commit -1 primary~4)\n+\t - $(git log --format=\"%h # %s\" -1 primary)\n+\t - $(git log --format=\"%h # %s\" -1 primary~4)\n \tTo avoid this message, use \"drop\" to explicitly remove a commit.\n \n \tUse '\\''git config rebase.missingCommitsCheck'\\'' to change the level of warnings.\n@@ -1642,11 +1642,11 @@ test_expect_success 'respects rebase.abbreviateCommands with fixup, squash and e\n \ttest_commit \"fixup! first\" file2.txt \"first line again\" first_fixup &&\n \ttest_commit \"squash! second\" file1.txt \"another line here\" second_squash &&\n \tcat >expected <<-EOF &&\n-\tp $(git rev-list --abbrev-commit -1 first) first\n-\tf $(git rev-list --abbrev-commit -1 first_fixup) fixup! first\n+\tp $(git rev-list --abbrev-commit -1 first) # first\n+\tf $(git rev-list --abbrev-commit -1 first_fixup) # fixup! first\n \tx git show HEAD\n-\tp $(git rev-list --abbrev-commit -1 second) second\n-\ts $(git rev-list --abbrev-commit -1 second_squash) squash! second\n+\tp $(git rev-list --abbrev-commit -1 second) # second\n+\ts $(git rev-list --abbrev-commit -1 second_squash) # squash! second\n \tx git show HEAD\n \tEOF\n \tgit checkout abbrevcmd &&\n@@ -1665,7 +1665,7 @@ test_expect_success 'static check of bad command' '\n \t\tset_fake_editor &&\n \t\ttest_must_fail env FAKE_LINES=\"1 2 3 bad 4 5\" \\\n \t\tgit rebase -i --root 2>actual &&\n-\t\ttest_grep \"pickled $(git rev-list --oneline -1 primary~1)\" \\\n+\t\ttest_grep \"pickled $(git log --format=\"%h # %s\" -1 primary~1)\" \\\n \t\t\t\tactual &&\n \t\ttest_grep \"You can fix this with .git rebase --edit-todo..\" \\\n \t\t\t\tactual &&\n@@ -1865,15 +1865,15 @@ test_expect_success '--update-refs adds label and update-ref commands' '\n \t\tset_cat_todo_editor &&\n \n \t\tcat >expect <<-EOF &&\n-\t\tpick $(git log -1 --format=%h J) J\n-\t\tfixup $(git log -1 --format=%h update-refs) fixup! J # empty\n+\t\tpick $(git log -1 --format=%h J) # J\n+\t\tfixup $(git log -1 --format=%h update-refs) # fixup! J # empty\n \t\tupdate-ref refs/heads/second\n \t\tupdate-ref refs/heads/first\n-\t\tpick $(git log -1 --format=%h K) K\n-\t\tpick $(git log -1 --format=%h L) L\n-\t\tfixup $(git log -1 --format=%h is-not-reordered) fixup! L # empty\n+\t\tpick $(git log -1 --format=%h K) # K\n+\t\tpick $(git log -1 --format=%h L) # L\n+\t\tfixup $(git log -1 --format=%h is-not-reordered) # fixup! L # empty\n \t\tupdate-ref refs/heads/third\n-\t\tpick $(git log -1 --format=%h M) M\n+\t\tpick $(git log -1 --format=%h M) # M\n \t\tupdate-ref refs/heads/no-conflict-branch\n \t\tupdate-ref refs/heads/is-not-reordered\n \t\tupdate-ref refs/heads/shared-tip\n@@ -1905,19 +1905,19 @@ test_expect_success '--update-refs adds commands with --rebase-merges' '\n \t\tcat >expect <<-EOF &&\n \t\tlabel onto\n \t\treset onto\n-\t\tpick $(git log -1 --format=%h branch2~1) F\n-\t\tpick $(git log -1 --format=%h branch2) I\n+\t\tpick $(git log -1 --format=%h branch2~1) # F\n+\t\tpick $(git log -1 --format=%h branch2) # I\n \t\tupdate-ref refs/heads/branch2\n \t\tlabel branch2\n \t\treset onto\n-\t\tpick $(git log -1 --format=%h refs/heads/second) J\n+\t\tpick $(git log -1 --format=%h refs/heads/second) # J\n \t\tupdate-ref refs/heads/second\n \t\tupdate-ref refs/heads/first\n-\t\tpick $(git log -1 --format=%h refs/heads/third~1) K\n-\t\tpick $(git log -1 --format=%h refs/heads/third) L\n-\t\tfixup $(git log -1 --format=%h update-refs-with-merge) fixup! L # empty\n+\t\tpick $(git log -1 --format=%h refs/heads/third~1) # K\n+\t\tpick $(git log -1 --format=%h refs/heads/third) # L\n+\t\tfixup $(git log -1 --format=%h update-refs-with-merge) # fixup! L # empty\n \t\tupdate-ref refs/heads/third\n-\t\tpick $(git log -1 --format=%h HEAD~2) M\n+\t\tpick $(git log -1 --format=%h HEAD~2) # M\n \t\tupdate-ref refs/heads/no-conflict-branch\n \t\tmerge -C $(git log -1 --format=%h HEAD~1) branch2 # merge\n \t\tupdate-ref refs/heads/merge-branch\ndiff --git a/t/t3415-rebase-autosquash.sh b/t/t3415-rebase-autosquash.sh\nindex fcc40d6fe1f..26b42a526a1 100755\n--- a/t/t3415-rebase-autosquash.sh\n+++ b/t/t3415-rebase-autosquash.sh\n@@ -257,8 +257,8 @@ test_expect_success 'auto squash of fixup commit that matches branch name which\n \tGIT_SEQUENCE_EDITOR=\"cat >tmp\" git rebase --autosquash -i HEAD^^ &&\n \tsed -ne \"/^[^#]/{s/[0-9a-f]\\{7,\\}/HASH/g;p;}\" tmp >actual &&\n \tcat <<-EOF >expect &&\n-\tpick HASH second commit\n-\tpick HASH fixup! self-cycle # empty\n+\tpick HASH # second commit\n+\tpick HASH # fixup! self-cycle # empty\n \tEOF\n \ttest_cmp expect actual\n '\n@@ -311,10 +311,10 @@ test_auto_fixup_fixup () {\n \t\tparent2=$(git rev-parse --short HEAD^^) &&\n \t\tparent3=$(git rev-parse --short HEAD^^^) &&\n \t\tcat >expected <<-EOF &&\n-\t\tpick $parent3 first commit\n-\t\t$1 $parent1 $1! first\n-\t\t$1 $head $1! $2! first\n-\t\tpick $parent2 second commit\n+\t\tpick $parent3 # first commit\n+\t\t$1 $parent1 # $1! first\n+\t\t$1 $head # $1! $2! first\n+\t\tpick $parent2 # second commit\n \t\tEOF\n \t\ttest_cmp expected actual\n \t) &&\n@@ -389,7 +389,7 @@ test_expect_success 'autosquash with empty custom instructionFormat' '\n \t\tset_cat_todo_editor &&\n \t\ttest_must_fail git -c rebase.instructionFormat= \\\n \t\t\trebase --autosquash  --force-rebase -i HEAD^ >actual &&\n-\t\tgit log -1 --format=\"pick %h %s\" >expect &&\n+\t\tgit log -1 --format=\"pick %h # %s\" >expect &&\n \t\ttest_cmp expect actual\n \t)\n '\ndiff --git a/t/t3430-rebase-merges.sh b/t/t3430-rebase-merges.sh\nindex b84d68c4b96..5f8fa05420c 100755\n--- a/t/t3430-rebase-merges.sh\n+++ b/t/t3430-rebase-merges.sh\n@@ -106,18 +106,18 @@ test_expect_success 'generate correct todo list' '\n \tlabel onto\n \n \treset onto\n-\tpick $b B\n+\tpick $b # B\n \tlabel first\n \n \treset onto\n-\tpick $c C\n+\tpick $c # C\n \tlabel branch-point\n-\tpick $f F\n-\tpick $g G\n+\tpick $f # F\n+\tpick $g # G\n \tlabel second\n \n \treset branch-point # C\n-\tpick $d D\n+\tpick $d # D\n \tmerge -C $e first # E\n \tmerge -C $h second # H\n \ndiff --git a/t/t5520-pull.sh b/t/t5520-pull.sh\nindex 47534f1062d..63c9a8f04b1 100755\n--- a/t/t5520-pull.sh\n+++ b/t/t5520-pull.sh\n@@ -813,7 +813,7 @@ test_expect_success 'git pull --rebase does not reapply old patches' '\n \t\tcd dst &&\n \t\ttest_must_fail git pull --rebase &&\n \t\tcat .git/rebase-merge/done .git/rebase-merge/git-rebase-todo >work &&\n-\t\tgrep -v -e \\# -e ^$ work >patches &&\n+\t\tgrep -v -e ^\\# -e ^$ work >patches &&\n \t\ttest_line_count = 1 patches &&\n \t\trm -f work\n \t)\ndiff --git a/t/t7512-status-help.sh b/t/t7512-status-help.sh\nindex 802f8f704c6..25e8e9711f8 100755\n--- a/t/t7512-status-help.sh\n+++ b/t/t7512-status-help.sh\n@@ -139,7 +139,7 @@ test_expect_success 'status during rebase -i when conflicts unresolved' '\n \tcat >expected <<EOF &&\n interactive rebase in progress; onto $ONTO\n Last command done (1 command done):\n-   pick $LAST_COMMIT one_second\n+   pick $LAST_COMMIT # one_second\n No commands remaining.\n You are currently rebasing branch '\\''rebase_i_conflicts_second'\\'' on '\\''$ONTO'\\''.\n   (fix conflicts and then run \"git rebase --continue\")\n@@ -168,7 +168,7 @@ test_expect_success 'status during rebase -i after resolving conflicts' '\n \tcat >expected <<EOF &&\n interactive rebase in progress; onto $ONTO\n Last command done (1 command done):\n-   pick $LAST_COMMIT one_second\n+   pick $LAST_COMMIT # one_second\n No commands remaining.\n You are currently rebasing branch '\\''rebase_i_conflicts_second'\\'' on '\\''$ONTO'\\''.\n   (all conflicts fixed: run \"git rebase --continue\")\n@@ -200,8 +200,8 @@ test_expect_success 'status when rebasing -i in edit mode' '\n \tcat >expected <<EOF &&\n interactive rebase in progress; onto $ONTO\n Last commands done (2 commands done):\n-   pick $COMMIT2 two_rebase_i\n-   edit $COMMIT3 three_rebase_i\n+   pick $COMMIT2 # two_rebase_i\n+   edit $COMMIT3 # three_rebase_i\n No commands remaining.\n You are currently editing a commit while rebasing branch '\\''rebase_i_edit'\\'' on '\\''$ONTO'\\''.\n   (use \"git commit --amend\" to amend the current commit)\n@@ -233,10 +233,10 @@ test_expect_success 'status when splitting a commit' '\n \tcat >expected <<EOF &&\n interactive rebase in progress; onto $ONTO\n Last commands done (2 commands done):\n-   pick $COMMIT2 two_split\n-   edit $COMMIT3 three_split\n+   pick $COMMIT2 # two_split\n+   edit $COMMIT3 # three_split\n Next command to do (1 remaining command):\n-   pick $COMMIT4 four_split\n+   pick $COMMIT4 # four_split\n   (use \"git rebase --edit-todo\" to view and edit)\n You are currently splitting a commit while rebasing branch '\\''split_commit'\\'' on '\\''$ONTO'\\''.\n   (Once your working directory is clean, run \"git rebase --continue\")\n@@ -271,8 +271,8 @@ test_expect_success 'status after editing the last commit with --amend during a\n \tcat >expected <<EOF &&\n interactive rebase in progress; onto $ONTO\n Last commands done (3 commands done):\n-   pick $COMMIT3 three_amend\n-   edit $COMMIT4 four_amend\n+   pick $COMMIT3 # three_amend\n+   edit $COMMIT4 # four_amend\n   (see more in file .git/rebase-merge/done)\n No commands remaining.\n You are currently editing a commit while rebasing branch '\\''amend_last'\\'' on '\\''$ONTO'\\''.\n@@ -309,10 +309,10 @@ test_expect_success 'status: (continue first edit) second edit' '\n \tcat >expected <<EOF &&\n interactive rebase in progress; onto $ONTO\n Last commands done (2 commands done):\n-   edit $COMMIT2 two_edits\n-   edit $COMMIT3 three_edits\n+   edit $COMMIT2 # two_edits\n+   edit $COMMIT3 # three_edits\n Next command to do (1 remaining command):\n-   pick $COMMIT4 four_edits\n+   pick $COMMIT4 # four_edits\n   (use \"git rebase --edit-todo\" to view and edit)\n You are currently editing a commit while rebasing branch '\\''several_edits'\\'' on '\\''$ONTO'\\''.\n   (use \"git commit --amend\" to amend the current commit)\n@@ -340,10 +340,10 @@ test_expect_success 'status: (continue first edit) second edit and split' '\n \tcat >expected <<EOF &&\n interactive rebase in progress; onto $ONTO\n Last commands done (2 commands done):\n-   edit $COMMIT2 two_edits\n-   edit $COMMIT3 three_edits\n+   edit $COMMIT2 # two_edits\n+   edit $COMMIT3 # three_edits\n Next command to do (1 remaining command):\n-   pick $COMMIT4 four_edits\n+   pick $COMMIT4 # four_edits\n   (use \"git rebase --edit-todo\" to view and edit)\n You are currently splitting a commit while rebasing branch '\\''several_edits'\\'' on '\\''$ONTO'\\''.\n   (Once your working directory is clean, run \"git rebase --continue\")\n@@ -375,10 +375,10 @@ test_expect_success 'status: (continue first edit) second edit and amend' '\n \tcat >expected <<EOF &&\n interactive rebase in progress; onto $ONTO\n Last commands done (2 commands done):\n-   edit $COMMIT2 two_edits\n-   edit $COMMIT3 three_edits\n+   edit $COMMIT2 # two_edits\n+   edit $COMMIT3 # three_edits\n Next command to do (1 remaining command):\n-   pick $COMMIT4 four_edits\n+   pick $COMMIT4 # four_edits\n   (use \"git rebase --edit-todo\" to view and edit)\n You are currently editing a commit while rebasing branch '\\''several_edits'\\'' on '\\''$ONTO'\\''.\n   (use \"git commit --amend\" to amend the current commit)\n@@ -406,10 +406,10 @@ test_expect_success 'status: (amend first edit) second edit' '\n \tcat >expected <<EOF &&\n interactive rebase in progress; onto $ONTO\n Last commands done (2 commands done):\n-   edit $COMMIT2 two_edits\n-   edit $COMMIT3 three_edits\n+   edit $COMMIT2 # two_edits\n+   edit $COMMIT3 # three_edits\n Next command to do (1 remaining command):\n-   pick $COMMIT4 four_edits\n+   pick $COMMIT4 # four_edits\n   (use \"git rebase --edit-todo\" to view and edit)\n You are currently editing a commit while rebasing branch '\\''several_edits'\\'' on '\\''$ONTO'\\''.\n   (use \"git commit --amend\" to amend the current commit)\n@@ -438,10 +438,10 @@ test_expect_success 'status: (amend first edit) second edit and split' '\n \tcat >expected <<EOF &&\n interactive rebase in progress; onto $ONTO\n Last commands done (2 commands done):\n-   edit $COMMIT2 two_edits\n-   edit $COMMIT3 three_edits\n+   edit $COMMIT2 # two_edits\n+   edit $COMMIT3 # three_edits\n Next command to do (1 remaining command):\n-   pick $COMMIT4 four_edits\n+   pick $COMMIT4 # four_edits\n   (use \"git rebase --edit-todo\" to view and edit)\n You are currently splitting a commit while rebasing branch '\\''several_edits'\\'' on '\\''$ONTO'\\''.\n   (Once your working directory is clean, run \"git rebase --continue\")\n@@ -474,10 +474,10 @@ test_expect_success 'status: (amend first edit) second edit and amend' '\n \tcat >expected <<EOF &&\n interactive rebase in progress; onto $ONTO\n Last commands done (2 commands done):\n-   edit $COMMIT2 two_edits\n-   edit $COMMIT3 three_edits\n+   edit $COMMIT2 # two_edits\n+   edit $COMMIT3 # three_edits\n Next command to do (1 remaining command):\n-   pick $COMMIT4 four_edits\n+   pick $COMMIT4 # four_edits\n   (use \"git rebase --edit-todo\" to view and edit)\n You are currently editing a commit while rebasing branch '\\''several_edits'\\'' on '\\''$ONTO'\\''.\n   (use \"git commit --amend\" to amend the current commit)\n@@ -507,10 +507,10 @@ test_expect_success 'status: (split first edit) second edit' '\n \tcat >expected <<EOF &&\n interactive rebase in progress; onto $ONTO\n Last commands done (2 commands done):\n-   edit $COMMIT2 two_edits\n-   edit $COMMIT3 three_edits\n+   edit $COMMIT2 # two_edits\n+   edit $COMMIT3 # three_edits\n Next command to do (1 remaining command):\n-   pick $COMMIT4 four_edits\n+   pick $COMMIT4 # four_edits\n   (use \"git rebase --edit-todo\" to view and edit)\n You are currently editing a commit while rebasing branch '\\''several_edits'\\'' on '\\''$ONTO'\\''.\n   (use \"git commit --amend\" to amend the current commit)\n@@ -541,10 +541,10 @@ test_expect_success 'status: (split first edit) second edit and split' '\n \tcat >expected <<EOF &&\n interactive rebase in progress; onto $ONTO\n Last commands done (2 commands done):\n-   edit $COMMIT2 two_edits\n-   edit $COMMIT3 three_edits\n+   edit $COMMIT2 # two_edits\n+   edit $COMMIT3 # three_edits\n Next command to do (1 remaining command):\n-   pick $COMMIT4 four_edits\n+   pick $COMMIT4 # four_edits\n   (use \"git rebase --edit-todo\" to view and edit)\n You are currently splitting a commit while rebasing branch '\\''several_edits'\\'' on '\\''$ONTO'\\''.\n   (Once your working directory is clean, run \"git rebase --continue\")\n@@ -579,10 +579,10 @@ test_expect_success 'status: (split first edit) second edit and amend' '\n \tcat >expected <<EOF &&\n interactive rebase in progress; onto $ONTO\n Last commands done (2 commands done):\n-   edit $COMMIT2 two_edits\n-   edit $COMMIT3 three_edits\n+   edit $COMMIT2 # two_edits\n+   edit $COMMIT3 # three_edits\n Next command to do (1 remaining command):\n-   pick $COMMIT4 four_edits\n+   pick $COMMIT4 # four_edits\n   (use \"git rebase --edit-todo\" to view and edit)\n You are currently editing a commit while rebasing branch '\\''several_edits'\\'' on '\\''$ONTO'\\''.\n   (use \"git commit --amend\" to amend the current commit)\n@@ -997,11 +997,11 @@ test_expect_success 'status: two commands done with some white lines in done fil\n \tcat >expected <<EOF &&\n interactive rebase in progress; onto $ONTO\n Last commands done (2 commands done):\n-   pick $COMMIT2 two_commit\n+   pick $COMMIT2 # two_commit\n    exec exit 15\n Next commands to do (2 remaining commands):\n-   pick $COMMIT3 three_commit\n-   pick $COMMIT4 four_commit\n+   pick $COMMIT3 # three_commit\n+   pick $COMMIT4 # four_commit\n   (use \"git rebase --edit-todo\" to view and edit)\n You are currently editing a commit while rebasing branch '\\''several_commits'\\'' on '\\''$ONTO'\\''.\n   (use \"git commit --amend\" to amend the current commit)\n@@ -1025,12 +1025,12 @@ test_expect_success 'status: two remaining commands with some white lines in tod\n \tcat >expected <<EOF &&\n interactive rebase in progress; onto $ONTO\n Last commands done (3 commands done):\n-   pick $COMMIT2 two_commit\n+   pick $COMMIT2 # two_commit\n    exec exit 15\n   (see more in file .git/rebase-merge/done)\n Next commands to do (2 remaining commands):\n-   pick $COMMIT3 three_commit\n-   pick $COMMIT4 four_commit\n+   pick $COMMIT3 # three_commit\n+   pick $COMMIT4 # four_commit\n   (use \"git rebase --edit-todo\" to view and edit)\n You are currently editing a commit while rebasing branch '\\''several_commits'\\'' on '\\''$ONTO'\\''.\n   (use \"git commit --amend\" to amend the current commit)\n@@ -1050,7 +1050,7 @@ test_expect_success 'status: handle not-yet-started rebase -i gracefully' '\n On branch several_commits\n No commands done.\n Next command to do (1 remaining command):\n-   pick $COMMIT four_commit\n+   pick $COMMIT # four_commit\n   (use \"git rebase --edit-todo\" to view and edit)\n You are currently editing a commit while rebasing branch '\\''several_commits'\\'' on '\\''$ONTO'\\''.\n   (use \"git commit --amend\" to amend the current commit)\n\nbase-commit: 1a8a4971cc6c179c4dd711f4a7f5d7178f4b3ab7\n-- \ngitgitgadget\n"}]}