{"thread":{"id":"24300","subject":"[PATCH 0/2] rebase-i minifixes","startedAt":"2010-07-06T06:27:09Z","lastAt":"2010-07-06T18:57:06Z","messageCount":4,"participants":["Junio C Hamano","Jonathan Nieder"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"144879","messageId":"1278397631-20658-1-git-send-email-gitster@pobox.com","threadId":"24300","inReplyTo":null,"subject":"[PATCH 0/2] rebase-i minifixes","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-07-06T06:27:09Z","receivedAt":"2010-07-06T06:27:09Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"The first one is just a (long overdue) style fix.  The second one changes\n\"read\" to \"read -r\" to work around commit log messages that have backslash\ncharacters in them, the issue reported by Joshua ben Jore\n\nJunio C Hamano (2):\n  rebase-i: style fix\n  rebase-i: do not get fooled by a log message ending with backslash\n\n git-rebase--interactive.sh    |   19 ++++++++++---------\n t/t3404-rebase-interactive.sh |   18 ++++++++++++++++++\n 2 files changed, 28 insertions(+), 9 deletions(-)\n\n-- \n1.7.2.rc1.209.g3868f\n"},{"id":"144880","messageId":"1278397631-20658-2-git-send-email-gitster@pobox.com","threadId":"24300","inReplyTo":"1278397631-20658-1-git-send-email-gitster@pobox.com","subject":"[PATCH 1/2] rebase-i: style fix","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-07-06T06:27:10Z","receivedAt":"2010-07-06T06:27:10Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Case arms should align with \"case\" and \"esac\".\n\nDo not cat a file into a pipeline; just make the downstream command\nread from the file.\n\nHaving a while statement as a downstream of a pipe is fine, but\nthe loop should begin on its own line.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n git-rebase--interactive.sh |   11 ++++++-----\n 1 files changed, 6 insertions(+), 5 deletions(-)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex 6b86abc..ed57552 100755\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -263,10 +263,10 @@ pick_one_preserving_merges () {\n \tthen\n \t\tif test \"$fast_forward\" = t\n \t\tthen\n-\t\t\tcat \"$DOTEST\"/current-commit | while read current_commit\n+\t\t\twhile read current_commit\n \t\t\tdo\n \t\t\t\tgit rev-parse HEAD > \"$REWRITTEN\"/$current_commit\n-\t\t\tdone\n+\t\t\tdone <\"$DOTEST\"/current-commit\n \t\t\trm \"$DOTEST\"/current-commit ||\n \t\t\tdie \"Cannot write current commit's replacement sha1\"\n \t\tfi\n@@ -440,9 +440,9 @@ record_in_rewritten() {\n \techo \"$oldsha1\" >> \"$REWRITTEN_PENDING\"\n \n \tcase \"$(peek_next_command)\" in\n-\t    squash|s|fixup|f)\n+\tsquash|s|fixup|f)\n \t\t;;\n-\t    *)\n+\t*)\n \t\tflush_rewritten_pending\n \t\t;;\n \tesac\n@@ -890,7 +890,8 @@ first and then run 'git rebase --continue' again.\"\n \t\tgit rev-list $MERGES_OPTION --pretty=oneline --abbrev-commit \\\n \t\t\t--abbrev=7 --reverse --left-right --topo-order \\\n \t\t\t$REVISIONS | \\\n-\t\t\tsed -n \"s/^>//p\" | while read shortsha1 rest\n+\t\t\tsed -n \"s/^>//p\" |\n+\t\twhile read shortsha1 rest\n \t\tdo\n \t\t\tif test t != \"$PRESERVE_MERGES\"\n \t\t\tthen\n-- \n1.7.2.rc1.209.g3868f\n"},{"id":"144881","messageId":"1278397631-20658-3-git-send-email-gitster@pobox.com","threadId":"24300","inReplyTo":"1278397631-20658-1-git-send-email-gitster@pobox.com","subject":"[PATCH 2/2] rebase-i: do not get fooled by a log message ending with backslash","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-07-06T06:27:11Z","receivedAt":"2010-07-06T06:27:11Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Signed-off-by: Junio C Hamano <gitster@pobox.com>\n---\n git-rebase--interactive.sh    |   10 +++++-----\n t/t3404-rebase-interactive.sh |   18 ++++++++++++++++++\n 2 files changed, 23 insertions(+), 5 deletions(-)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex ed57552..31e6860 100755\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -450,7 +450,7 @@ record_in_rewritten() {\n \n do_next () {\n \trm -f \"$MSG\" \"$AUTHOR_SCRIPT\" \"$AMEND\" || exit\n-\tread command sha1 rest < \"$TODO\"\n+\tread -r command sha1 rest < \"$TODO\"\n \tcase \"$command\" in\n \t'#'*|''|noop)\n \t\tmark_action_done\n@@ -591,7 +591,7 @@ do_rest () {\n # skip picking commits whose parents are unchanged\n skip_unnecessary_picks () {\n \tfd=3\n-\twhile read command sha1 rest\n+\twhile read -r command sha1 rest\n \tdo\n \t\t# fd=3 means we skip the command\n \t\tcase \"$fd,$command,$(git rev-parse --verify --quiet $sha1^)\" in\n@@ -644,13 +644,13 @@ rearrange_squash () {\n \ttest -s \"$1.sq\" || return\n \n \tused=\n-\twhile read pick sha1 message\n+\twhile read -r pick sha1 message\n \tdo\n \t\tcase \" $used\" in\n \t\t*\" $sha1 \"*) continue ;;\n \t\tesac\n \t\techo \"$pick $sha1 $message\"\n-\t\twhile read squash action msg\n+\t\twhile read -r squash action msg\n \t\tdo\n \t\t\tcase \"$message\" in\n \t\t\t\"$msg\"*)\n@@ -891,7 +891,7 @@ first and then run 'git rebase --continue' again.\"\n \t\t\t--abbrev=7 --reverse --left-right --topo-order \\\n \t\t\t$REVISIONS | \\\n \t\t\tsed -n \"s/^>//p\" |\n-\t\twhile read shortsha1 rest\n+\t\twhile read -r shortsha1 rest\n \t\tdo\n \t\t\tif test t != \"$PRESERVE_MERGES\"\n \t\t\tthen\ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex ee9a1b2..47ca88f 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -630,4 +630,22 @@ test_expect_success 'always cherry-pick with --no-ff' '\n \ttest_cmp empty out\n '\n \n+test_expect_success 'set up commits with funny messages' '\n+\tgit checkout -b funny A &&\n+\techo >>file1 &&\n+\ttest_tick &&\n+\tgit commit -a -m \"end with slash\\\\\" &&\n+\techo >>file1 &&\n+\ttest_tick &&\n+\tgit commit -a -m \"another commit\"\n+'\n+\n+test_expect_success 'rebase-i history with funny messages' '\n+\tgit rev-list A..funny >expect &&\n+\ttest_tick &&\n+\tFAKE_LINES=\"1 2\" git rebase -i A &&\n+\tgit rev-list A.. >actual &&\n+\ttest_cmp expect actual\n+'\n+\n test_done\n-- \n1.7.2.rc1.209.g3868f\n"},{"id":"144947","messageId":"20100706185706.GA7296@burratino","threadId":"24300","inReplyTo":"1278397631-20658-3-git-send-email-gitster@pobox.com","subject":"Re: [PATCH 2/2] rebase-i: do not get fooled by a log message ending with backslash","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-07-06T18:57:06Z","receivedAt":"2010-07-06T18:57:06Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Junio C Hamano wrote:\n\n> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n\nPosix mandates the -r option to replace the less convenient ‘line’\nutility.  read -r is part of SVR4.2[1] so any vaguely Posix-ish sh\nshould have it (i.e., not Solaris /bin/sh, but that’s okay).\n\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\n\n(Not tested, since I don’t have access to any non-Linux installations\nnowadays.)\n\n[1] http://www.in-ulm.de/~mascheck/bourne/\n"}]}