{"thread":{"id":"7078","subject":"[PATCH/RFC] cherry-pick: Suggest a better method to retain authorship","startedAt":"2007-03-04T13:26:05Z","lastAt":"2007-03-04T13:26:05Z","messageCount":1,"participants":["Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"36238","messageId":"Pine.LNX.4.63.0703041425280.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"7078","inReplyTo":null,"subject":"[PATCH/RFC] cherry-pick: Suggest a better method to retain authorship","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-03-04T13:26:05Z","receivedAt":"2007-03-04T13:26:05Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nWhen a cherry-pick failed, we used to recommend setting environment\nvariables to retain the authorship. It is much easier, though, to use\nthe \"-c\" flag of git-commit.\n\nPrint this message also when merge-recursive fails (the code used to\nexit(1) in that case, never reaching the proper failure path).\n\nSigned-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n---\n builtin-revert.c |   19 ++++++-------------\n 1 files changed, 6 insertions(+), 13 deletions(-)\n\ndiff --git a/builtin-revert.c b/builtin-revert.c\nindex bc3cfcb..382fe0c 100644\n--- a/builtin-revert.c\n+++ b/builtin-revert.c\n@@ -323,9 +323,8 @@ static int revert_or_cherry_pick(int argc, const char **argv)\n \n \tif (merge_recursive(sha1_to_hex(base->object.sha1),\n \t\t\t\tsha1_to_hex(head), \"HEAD\",\n-\t\t\t\tsha1_to_hex(next->object.sha1), oneline))\n-\t\texit(1);\n-\tif (write_tree(head, 0, NULL)) {\n+\t\t\t\tsha1_to_hex(next->object.sha1), oneline) ||\n+\t\t\twrite_tree(head, 0, NULL)) {\n \t\tconst char *target = git_path(\"MERGE_MSG\");\n \t\tadd_to_msg(\"\\nConflicts:\\n\\n\");\n \t\tread_cache();\n@@ -350,16 +349,10 @@ static int revert_or_cherry_pick(int argc, const char **argv)\n \t\t\t\"mark the corrected paths with 'git-add <paths>'\\n\"\n \t\t\t\"and commit the result.\\n\", me);\n \t\tif (action == CHERRY_PICK) {\n-\t\t\tfprintf(stderr, \"You may choose to use the following \"\n-\t\t\t\t\"when making the commit:\\n\"\n-\t\t\t\t\"GIT_AUTHOR_NAME=\\\"%s\\\"\\n\",\n-\t\t\t\tgetenv(\"GIT_AUTHOR_NAME\"));\n-\t\t\tfprintf(stderr, \"GIT_AUTHOR_EMAIL=\\\"%s\\\"\\n\",\n-\t\t\t\tgetenv(\"GIT_AUTHOR_EMAIL\"));\n-\t\t\tfprintf(stderr, \"GIT_AUTHOR_DATE=\\\"%s\\\"\\n\"\n-\t\t\t\t\"export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL \"\n-\t\t\t\t\"GIT_AUTHOR_DATE\\n\",\n-\t\t\t\tgetenv(\"GIT_AUTHOR_DATE\"));\n+\t\t\tfprintf(stderr, \"When commiting, use the option \"\n+\t\t\t\t\"'-c %s' to retain authorship and message.\\n\",\n+\t\t\t\tfind_unique_abbrev(commit->object.sha1,\n+\t\t\t\t\tDEFAULT_ABBREV));\n \t\t}\n \t\texit(1);\n \t}\n-- \n1.5.0.2.2531.g5a43-dirty\n"}]}