{"thread":{"id":"24404","subject":"[PATCH 4/4] revert: improve success message by adding abbreviated commit sha1","startedAt":"2010-07-13T23:28:15Z","lastAt":"2010-07-17T20:17:02Z","messageCount":3,"participants":["Christian Couder","Jonathan Nieder"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"145613","messageId":"20100713232816.7738.78221.chriscool@tuxfamily.org","threadId":"24404","inReplyTo":null,"subject":"[PATCH 4/4] revert: improve success message by adding abbreviated commit sha1","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2010-07-13T23:28:15Z","receivedAt":"2010-07-13T23:28:15Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Instead of \"Finished one cherry-pick.\" or \"Finished one\nrevert.\", we now print \"Finished cherry-pick commit\n<abbreviated sha1>.\" or \"Finished revert commit\n<abbreviated sha1>.\" which is more informative especially\nwhen cherry-picking or reverting many commits.\n\nIn case of failure the message is now \"Automatic\ncherry-pick commit <abbreviated sha1> failed.\" instead of\n\"Automatic cherry-pick failed.\".\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n builtin/revert.c                    |    5 +++--\n t/t3508-cherry-pick-many-commits.sh |   12 ++++++------\n 2 files changed, 9 insertions(+), 8 deletions(-)\n\ndiff --git a/builtin/revert.c b/builtin/revert.c\nindex ec931bd..36479f9 100644\n--- a/builtin/revert.c\n+++ b/builtin/revert.c\n@@ -492,7 +492,8 @@ static int do_pick_commit(void)\n \t\t}\n \t}\n \n-\tstrbuf_addstr(&mebuf, me);\n+\tstrbuf_addf(&mebuf, \"%s commit %s\", me,\n+\t\t    find_unique_abbrev(commit->object.sha1, DEFAULT_ABBREV));\n \n \tif (!strategy || !strcmp(strategy, \"recursive\") || action == REVERT) {\n \t\tres = do_recursive_merge(base, next, base_label, next_label,\n@@ -521,7 +522,7 @@ static int do_pick_commit(void)\n \t\tif (!no_commit)\n \t\t\tres = run_git_commit(defmsg);\n \t\tif (!res)\n-\t\t\tfprintf(stderr, \"Finished one %s.\\n\", mebuf.buf);\n+\t\t\tfprintf(stderr, \"Finished %s.\\n\", mebuf.buf);\n \t}\n \n \tstrbuf_release(&mebuf);\ndiff --git a/t/t3508-cherry-pick-many-commits.sh b/t/t3508-cherry-pick-many-commits.sh\nindex 6555f92..1bd3ca1 100755\n--- a/t/t3508-cherry-pick-many-commits.sh\n+++ b/t/t3508-cherry-pick-many-commits.sh\n@@ -24,9 +24,9 @@ test_expect_success setup '\n \n test_expect_success 'cherry-pick first..fourth works' '\n \tcat <<-EOF > expected &&\n-\tFinished one cherry-pick.\n-\tFinished one cherry-pick.\n-\tFinished one cherry-pick.\n+\tFinished cherry-pick commit $(git rev-parse --short second).\n+\tFinished cherry-pick commit $(git rev-parse --short third).\n+\tFinished cherry-pick commit $(git rev-parse --short fourth).\n \tEOF\n \n \tgit checkout -f master &&\n@@ -41,9 +41,9 @@ test_expect_success 'cherry-pick first..fourth works' '\n \n test_expect_success 'cherry-pick --strategy resolve first..fourth works' '\n \tcat <<-EOF > expected &&\n-\tFinished one cherry-pick with strategy resolve.\n-\tFinished one cherry-pick with strategy resolve.\n-\tFinished one cherry-pick with strategy resolve.\n+\tFinished cherry-pick commit $(git rev-parse --short second) with strategy resolve.\n+\tFinished cherry-pick commit $(git rev-parse --short third) with strategy resolve.\n+\tFinished cherry-pick commit $(git rev-parse --short fourth) with strategy resolve.\n \tEOF\n \n \tgit checkout -f master &&\n-- \n1.7.2.rc1.215.g2dff2.dirty\n"},{"id":"145668","messageId":"20100715225141.GB7253@burratino","threadId":"24404","inReplyTo":"20100713232816.7738.78221.chriscool@tuxfamily.org","subject":"Re: [PATCH 4/4] revert: improve success message by adding abbreviated commit sha1","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-07-15T22:51:41Z","receivedAt":"2010-07-15T22:51:41Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Christian Couder wrote:\n\n> --- a/t/t3508-cherry-pick-many-commits.sh\n> +++ b/t/t3508-cherry-pick-many-commits.sh\n> @@ -24,9 +24,9 @@ test_expect_success setup '\n>  \n>  test_expect_success 'cherry-pick first..fourth works' '\n>  \tcat <<-EOF > expected &&\n> -\tFinished one cherry-pick.\n> -\tFinished one cherry-pick.\n> -\tFinished one cherry-pick.\n> +\tFinished cherry-pick commit $(git rev-parse --short second).\n> +\tFinished cherry-pick commit $(git rev-parse --short third).\n> +\tFinished cherry-pick commit $(git rev-parse --short fourth).\n\nIf the redirections are changed to <<-\\EOF before, then they would\nneed to be changed back to <<-EOF here.\n\n> Instead of \"Finished one cherry-pick.\" or \"Finished one\n> revert.\", we now print \"Finished cherry-pick commit\n> <abbreviated sha1>.\"\n\n“Finished cherry-pick of commit f67ab8.” sounds more better to my ear.\n\n\tFinished cherry-pick of foo.\n\tFinished cherry-pick of bar.\n\tFinished cherry-pick of baz.\n\tetc\n\nis a lot saner than\n\n\tFinished one cherry-pick.\n\tFinished one cherry-pick.\n\tFinisehd one cherry-pick.\n\tetc\n\nThanks for making it happen.\n\ndiff --git a/builtin/revert.c b/builtin/revert.c\nindex 36479f9..e261fb2 100644\n--- a/builtin/revert.c\n+++ b/builtin/revert.c\n@@ -492,7 +492,7 @@ static int do_pick_commit(void)\n \t\t}\n \t}\n \n-\tstrbuf_addf(&mebuf, \"%s commit %s\", me,\n+\tstrbuf_addf(&mebuf, \"%s of commit %s\", me,\n \t\t    find_unique_abbrev(commit->object.sha1, DEFAULT_ABBREV));\n \n \tif (!strategy || !strcmp(strategy, \"recursive\") || action == REVERT) {\ndiff --git a/t/t3508-cherry-pick-many-commits.sh b/t/t3508-cherry-pick-many-commits.sh\nindex 1bd3ca1..5af5905 100755\n--- a/t/t3508-cherry-pick-many-commits.sh\n+++ b/t/t3508-cherry-pick-many-commits.sh\n@@ -24,9 +24,9 @@ test_expect_success setup '\n \n test_expect_success 'cherry-pick first..fourth works' '\n \tcat <<-EOF > expected &&\n-\tFinished cherry-pick commit $(git rev-parse --short second).\n-\tFinished cherry-pick commit $(git rev-parse --short third).\n-\tFinished cherry-pick commit $(git rev-parse --short fourth).\n+\tFinished cherry-pick of commit $(git rev-parse --short second).\n+\tFinished cherry-pick of commit $(git rev-parse --short third).\n+\tFinished cherry-pick of commit $(git rev-parse --short fourth).\n \tEOF\n \n \tgit checkout -f master &&\n@@ -41,9 +41,9 @@ test_expect_success 'cherry-pick first..fourth works' '\n \n test_expect_success 'cherry-pick --strategy resolve first..fourth works' '\n \tcat <<-EOF > expected &&\n-\tFinished cherry-pick commit $(git rev-parse --short second) with strategy resolve.\n-\tFinished cherry-pick commit $(git rev-parse --short third) with strategy resolve.\n-\tFinished cherry-pick commit $(git rev-parse --short fourth) with strategy resolve.\n+\tFinished cherry-pick of commit $(git rev-parse --short second) with strategy resolve.\n+\tFinished cherry-pick of commit $(git rev-parse --short third) with strategy resolve.\n+\tFinished cherry-pick of commit $(git rev-parse --short fourth) with strategy resolve.\n \tEOF\n \n \tgit checkout -f master &&\n-- \n"},{"id":"145738","messageId":"201007172217.02500.chriscool@tuxfamily.org","threadId":"24404","inReplyTo":"20100715225141.GB7253@burratino","subject":"Re: [PATCH 4/4] revert: improve success message by adding abbreviated commit sha1","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2010-07-17T20:17:02Z","receivedAt":"2010-07-17T20:17:02Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Friday 16 July 2010 00:51:41 Jonathan Nieder wrote:\n> Christian Couder wrote:\n> > Instead of \"Finished one cherry-pick.\" or \"Finished one\n> > revert.\", we now print \"Finished cherry-pick commit\n> > <abbreviated sha1>.\"\n> \n> “Finished cherry-pick of commit f67ab8.” sounds more better to my ear.\n> \n> \tFinished cherry-pick of foo.\n> \tFinished cherry-pick of bar.\n> \tFinished cherry-pick of baz.\n> \tetc\n> \n> is a lot saner than\n> \n> \tFinished one cherry-pick.\n> \tFinished one cherry-pick.\n> \tFinisehd one cherry-pick.\n> \tetc\n> \n> Thanks for making it happen.\n\nThanks for your review and your patches to improve my patches!\nAnd thanks to Junio for picking up everything!\n\nBest regards,\nChristian.\n"}]}