{"thread":{"id":"38701","subject":"[PATCH 2/2] rebase-interactive: re-word \"item count\" comment","startedAt":"2015-03-04T07:53:04Z","lastAt":"2015-03-04T07:53:05Z","messageCount":2,"participants":["Eric Sunshine"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"256973","messageId":"1425455585-30186-1-git-send-email-sunshine@sunshineco.com","threadId":"38701","inReplyTo":null,"subject":"[PATCH 1/2] rebase-interactive: suppress whitespace preceding item count","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2015-03-04T07:53:04Z","receivedAt":"2015-03-04T07:53:04Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"97f05f43 (Show number of TODO items for interactive rebase, 2014-12-10)\ntaught rebase-interactive to compute an item count with 'wc -l' and\ndisplay it in the instruction list comments:\n\n    # Rebase 46640c6..5568fd5 onto 46640c6 (4 TODO item(s))\n\nOn Mac OS X, however, it renders as:\n\n    # Rebase 46640c6..5568fd5 onto 46640c6 (       4 TODO item(s))\n\nsince 'wc -l' indents its output with leading spaces. Fix this.\n\nSigned-off-by: Eric Sunshine <sunshine@sunshineco.com>\n---\n\nConsistent with existing tests in t3404, the new test uses plain 'grep'\nrather than 'test_i18ngrep'.\n\n git-rebase--interactive.sh    | 1 +\n t/t3404-rebase-interactive.sh | 9 +++++++++\n 2 files changed, 10 insertions(+)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex c96b984..ab98b13 100644\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -1030,6 +1030,7 @@ test -n \"$autosquash\" && rearrange_squash \"$todo\"\n test -n \"$cmd\" && add_exec_commands \"$todo\"\n \n todocount=$(git stripspace --strip-comments <\"$todo\" | wc -l)\n+todocount=${todocount##* }\n \n cat >>\"$todo\" <<EOF\n \ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex a31f7e0..034eb35 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -1046,4 +1046,13 @@ test_expect_success 'respect core.abbrev' '\n \ttest 4 = $(grep -c \"pick [0-9a-f]\\{12,\\}\" todo-list)\n '\n \n+test_expect_success 'todo count' '\n+\twrite_script dump-raw.sh <<-\\EOF &&\n+\t\tcat \"$1\"\n+\tEOF\n+\ttest_set_editor \"$(pwd)/dump-raw.sh\" &&\n+\tgit rebase -i HEAD~4 >actual &&\n+\tgrep \"^# Rebase ..* onto ..* ([0-9]\" actual\n+'\n+\n test_done\n-- \n2.3.1.340.gf490742\n"},{"id":"256972","messageId":"1425455585-30186-2-git-send-email-sunshine@sunshineco.com","threadId":"38701","inReplyTo":"1425455585-30186-1-git-send-email-sunshine@sunshineco.com","subject":"[PATCH 2/2] rebase-interactive: re-word \"item count\" comment","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2015-03-04T07:53:05Z","receivedAt":"2015-03-04T07:53:05Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"97f05f43 (Show number of TODO items for interactive rebase, 2014-12-10)\ntaught rebase-interactive to display an item count in the instruction\nlist comments:\n\n    # Rebase 46640c6..5568fd5 onto 46640c6 (4 TODO item(s))\n    #\n    # Commands:\n    # p, pick = use commit\n    # ...\n\nHowever, with the exception of the --edit-todo option, \"TODO\" is a\none-off term, never presented to the user by rebase-interactive in\nany other context. The item count is in fact the number of commands\n(\"pick\", \"edit\", etc.) remaining on the instruction sheet, and the\ncomment immediately following it talks about \"Commands\". Consequently,\nreplace \"(# TODO item(s))\" with the more accurate and meaningful\n\"(# command(s))\".\n\nSigned-off-by: Eric Sunshine <sunshine@sunshineco.com>\n---\n\nJunio suggested[1] the wording \"# todo items\" in place of \"# commits\"\nfrom the original submission, however, I find \"(# TODO items)\" quite\nclunky to read. \"(# commands)\" feels more natural and streamlined, but\nis also a case of bike-shedding and personal preference, so this patch\ncould easily be dropped.\n\n[1]: http://thread.gmane.org/gmane.comp.version-control.git/259365/focus=261143\n\n git-rebase--interactive.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex ab98b13..f7deeb0 100644\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -1034,7 +1034,7 @@ todocount=${todocount##* }\n \n cat >>\"$todo\" <<EOF\n \n-$comment_char Rebase $shortrevisions onto $shortonto ($todocount TODO item(s))\n+$comment_char Rebase $shortrevisions onto $shortonto ($todocount command(s))\n EOF\n append_todo_help\n git stripspace --comment-lines >>\"$todo\" <<\\EOF\n-- \n2.3.1.340.gf490742\n"}]}