{"thread":{"id":"21470","subject":"[PATCH] commit -c/-C/--amend: reset timestamp and authorship to committer with --reset-author","startedAt":"2009-11-03T21:09:11Z","lastAt":"2009-11-04T02:55:56Z","messageCount":6,"participants":["Erick Mattos","Nanako Shiraishi","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"126675","messageId":"1257282551-9999-1-git-send-email-erick.mattos@gmail.com","threadId":"21470","inReplyTo":null,"subject":"[PATCH] commit -c/-C/--amend: reset timestamp and authorship to committer with --reset-author","fromName":"Erick Mattos","fromEmail":"erick.mattos@gmail.com","sentAt":"2009-11-03T21:09:11Z","receivedAt":"2009-11-03T21:09:11Z","isPatch":true,"sender":{"key":"erick.mattos@gmail.com","avatar":"https://avatars.githubusercontent.com/u/134001?v=4"},"body":"When we use one of the options above we are normally trying to do mainly\ntwo things: using the source as a template or recreating a commit with\ncorrections.\n\nWhen they are used, the authorship and timestamp recorded in the newly\ncreated commit are always taken from the original commit.  And they\nshould not when we are using it as a template or when our change to the\ncode is so significant that we should take over the authorship (with the\nblame for bugs we introduce, of course).\n\nThe new --reset-author option is meant to solve this need by\nregenerating the timestamp and setting as the new author the committer\nor the one specified by --author option.\n\nSigned-off-by: Erick Mattos <erick.mattos@gmail.com>\n---\n Documentation/git-commit.txt |    7 +++-\n builtin-commit.c             |    9 +++-\n t/t7509-commit.sh            |   94 ++++++++++++++++++++++++++++++++++++++++++\n 3 files changed, 106 insertions(+), 4 deletions(-)\n create mode 100755 t/t7509-commit.sh\n\ndiff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt\nindex 0578a40..f89db9a 100644\n--- a/Documentation/git-commit.txt\n+++ b/Documentation/git-commit.txt\n@@ -9,7 +9,7 @@ SYNOPSIS\n --------\n [verse]\n 'git commit' [-a | --interactive] [-s] [-v] [-u<mode>] [--amend] [--dry-run]\n-\t   [(-c | -C) <commit>] [-F <file> | -m <msg>]\n+\t   [(-c | -C) <commit>] [-F <file> | -m <msg>] [--reset-author]\n \t   [--allow-empty] [--no-verify] [-e] [--author=<author>]\n \t   [--cleanup=<mode>] [--] [[-i | -o ]<file>...]\n \n@@ -69,6 +69,11 @@ OPTIONS\n \tLike '-C', but with '-c' the editor is invoked, so that\n \tthe user can further edit the commit message.\n \n+--reset-author::\n+\tWhen used with -C/-c/--amend options, declare that the\n+\tauthorship of the resulting commit now belongs of the committer.\n+\tThis also renews the author timestamp.\n+\n -F <file>::\n --file=<file>::\n \tTake the commit message from the given file.  Use '-' to\ndiff --git a/builtin-commit.c b/builtin-commit.c\nindex beddf01..6b51a1b 100644\n--- a/builtin-commit.c\n+++ b/builtin-commit.c\n@@ -51,7 +51,7 @@ static const char *template_file;\n static char *edit_message, *use_message;\n static char *author_name, *author_email, *author_date;\n static int all, edit_flag, also, interactive, only, amend, signoff;\n-static int quiet, verbose, no_verify, allow_empty, dry_run;\n+static int quiet, verbose, no_verify, allow_empty, dry_run, renew_authorship;\n static char *untracked_files_arg;\n /*\n  * The default commit message cleanup mode will remove the lines\n@@ -91,8 +91,9 @@ static struct option builtin_commit_options[] = {\n \tOPT_FILENAME('F', \"file\", &logfile, \"read log from file\"),\n \tOPT_STRING(0, \"author\", &force_author, \"AUTHOR\", \"override author for commit\"),\n \tOPT_CALLBACK('m', \"message\", &message, \"MESSAGE\", \"specify commit message\", opt_parse_m),\n-\tOPT_STRING('c', \"reedit-message\", &edit_message, \"COMMIT\", \"reuse and edit message from specified commit \"),\n+\tOPT_STRING('c', \"reedit-message\", &edit_message, \"COMMIT\", \"reuse and edit message from specified commit\"),\n \tOPT_STRING('C', \"reuse-message\", &use_message, \"COMMIT\", \"reuse message from specified commit\"),\n+\tOPT_BOOLEAN(0, \"reset-author\", &renew_authorship, \"reset timestamp and authorship to committer\"),\n \tOPT_BOOLEAN('s', \"signoff\", &signoff, \"add Signed-off-by:\"),\n \tOPT_FILENAME('t', \"template\", &template_file, \"use specified template file\"),\n \tOPT_BOOLEAN('e', \"edit\", &edit_flag, \"force edit of commit\"),\n@@ -381,7 +382,7 @@ static void determine_author_info(void)\n \temail = getenv(\"GIT_AUTHOR_EMAIL\");\n \tdate = getenv(\"GIT_AUTHOR_DATE\");\n \n-\tif (use_message) {\n+\tif (use_message && !renew_authorship) {\n \t\tconst char *a, *lb, *rb, *eol;\n \n \t\ta = strstr(use_message_buffer, \"\\nauthor \");\n@@ -780,6 +781,8 @@ static int parse_and_validate_options(int argc, const char *argv[],\n \t\tuse_message = edit_message;\n \tif (amend && !use_message)\n \t\tuse_message = \"HEAD\";\n+\tif (!use_message && renew_authorship)\n+\t\tdie(\"Option --reset-author is used only with -C/-c/--amend.\");\n \tif (use_message) {\n \t\tunsigned char sha1[20];\n \t\tstatic char utf8[] = \"UTF-8\";\ndiff --git a/t/t7509-commit.sh b/t/t7509-commit.sh\nnew file mode 100755\nindex 0000000..7290242\n--- /dev/null\n+++ b/t/t7509-commit.sh\n@@ -0,0 +1,94 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2009 Erick Mattos\n+#\n+\n+test_description='git commit\n+\n+Tests for --reset-author option on a commit.'\n+\n+. ./test-lib.sh\n+\n+TEST_FILE=foo\n+\n+test_expect_success '-C without --reset-author uses the author from the old commit' '\n+\techo \"initial\" > \"$TEST_FILE\" &&\n+\tgit add \"$TEST_FILE\" &&\n+\tgit commit -m \"Initial Commit\" --author \"Frigate <flying@over.world>\" &&\n+\ttest_tick &&\n+\techo \"Test 1\" >> \"$TEST_FILE\" &&\n+\tgit add \"$TEST_FILE\" &&\n+\tgit commit -C HEAD &&\n+\tgit cat-file -p HEAD^ | sed -e \"/^parent/d\" -e \"/^tree/d\" \\\n+\t\t-e \"/^committer/d\" > commit_1 &&\n+\tgit cat-file -p HEAD | sed -e \"/^parent/d\" -e \"/^tree/d\" \\\n+\t\t-e \"/^committer/d\" > commit_2 &&\n+\ttest_cmp commit_1 commit_2\n+'\n+\n+test_expect_success '-C with --reset-author makes me the author' '\n+\ttest_tick &&\n+\techo \"Test 2\" >> \"$TEST_FILE\" &&\n+\tgit add \"$TEST_FILE\" &&\n+\tgit commit -C HEAD^ --reset-author &&\n+\tgit cat-file -p HEAD^ | grep \"^author\" > commit_1 &&\n+\tgit cat-file -p HEAD | grep \"^author\" > commit_2 &&\n+\ttest \"$(cat commit_1 | sed \"s/.*> //\")\" !=\\\n+\t\t\"$(cat commit_2 | sed \"s/.*> //\")\" &&\n+\ttest \"$(cat commit_2 | sed -e \"s/author //\" -e \"s/>.*/>/\")\" =\\\n+\t\t\"$GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>\"\n+'\n+\n+test_expect_success '-c without --reset-author uses the author from the old commit' '\n+\techo \"Initial\" > \"$TEST_FILE\" &&\n+\tgit add \"$TEST_FILE\" &&\n+\tgit commit -m \"Initial Commit\" --author \"Frigate <flying@over.world>\" &&\n+\ttest_tick &&\n+\techo \"Test 3\" >> \"$TEST_FILE\" &&\n+\tgit add \"$TEST_FILE\" &&\n+\tEDITOR=: VISUAL=: git commit -c HEAD\n+\tgit cat-file -p HEAD^ | grep \"^author\" > commit_1 &&\n+\tgit cat-file -p HEAD | grep \"^author\" > commit_2 &&\n+\ttest_cmp commit_1 commit_2\n+'\n+\n+test_expect_success '-c with --reset-author makes me the author' '\n+\ttest_tick &&\n+\techo \"Test 4\" >> \"$TEST_FILE\" &&\n+\tgit add \"$TEST_FILE\" &&\n+\tEDITOR=: VISUAL=: git commit -c HEAD^ --reset-author\n+\tgit cat-file -p HEAD^ | grep \"^author\" > commit_1 &&\n+\tgit cat-file -p HEAD | grep \"^author\" > commit_2 &&\n+\ttest \"$(cat commit_1 | sed \"s/.*> //\")\" !=\\\n+\t\t\"$(cat commit_2 | sed \"s/.*> //\")\" &&\n+\ttest \"$(cat commit_2 | sed -e \"s/author //\" -e \"s/>.*/>/\")\" =\\\n+\t\t\"$GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>\"\n+'\n+\n+test_expect_success '--amend without --reset-author uses the author from the old commit' '\n+\techo \"Initial\" > \"$TEST_FILE\" &&\n+\tgit add \"$TEST_FILE\" &&\n+\tgit commit -m \"Initial Commit\" --author \"Frigate <flying@over.world>\" &&\n+\techo \"Test 5\" >> \"$TEST_FILE\" &&\n+\tgit add \"$TEST_FILE\" &&\n+\tgit commit -m \"--amend test\" &&\n+\tgit cat-file -p HEAD | grep \"^author\" > commit_1 &&\n+\ttest_tick &&\n+\tgit commit -m \"Changed\" --amend &&\n+\tgit cat-file -p HEAD | grep \"^author\" > commit_2 &&\n+\ttest_cmp commit_1 commit_2\n+'\n+\n+test_expect_success '--amend with --reset-author makes me the author' '\n+\ttest_tick &&\n+\techo \"Test 6\" >> \"$TEST_FILE\" &&\n+\tgit add \"$TEST_FILE\" &&\n+\tgit commit -m \"Changed again\" --amend --reset-author &&\n+\tgit cat-file -p HEAD | grep \"^author\" > commit_1 &&\n+\ttest \"$(cat commit_1 | sed \"s/.*> //\")\" !=\\\n+\t\t\"$(cat commit_2 | sed \"s/.*> //\")\" &&\n+\ttest \"$(cat commit_2 | sed -e \"s/author //\" -e \"s/>.*/>/\")\" =\\\n+\t\t\"$GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>\"\n+'\n+\n+test_done\n-- \n1.6.5.2.144.g1babf\n"},{"id":"126685","messageId":"20091104073822.6117@nanako3.lavabit.com","threadId":"21470","inReplyTo":"1257282551-9999-1-git-send-email-erick.mattos@gmail.com","subject":"Re: [PATCH] commit -c/-C/--amend: reset timestamp and authorship to committer with --reset-author","fromName":"Nanako Shiraishi","fromEmail":"nanako3@lavabit.com","sentAt":"2009-11-03T22:38:22Z","receivedAt":"2009-11-03T22:38:22Z","isPatch":true,"sender":{"key":"nanako3@lavabit.com","avatar":"https://gravatar.com/avatar/3777b9e201c5883a62b1a6fdf7c53f2d712d1d80989146063ea861e33aad72a8?d=mp&s=160"},"body":"Quoting Erick Mattos <erick.mattos@gmail.com>\n\n> When we use one of the options above we are normally trying to do mainly\n> two things: using the source as a template or recreating a commit with\n> corrections.\n>\n> When they are used, the authorship and timestamp recorded in the newly\n> created commit are always taken from the original commit.  And they\n> should not when we are using it as a template or when our change to the\n> code is so significant that we should take over the authorship (with the\n> blame for bugs we introduce, of course).\n>\n> The new --reset-author option is meant to solve this need by\n> regenerating the timestamp and setting as the new author the committer\n> or the one specified by --author option.\n>\n> Signed-off-by: Erick Mattos <erick.mattos@gmail.com>\n> ---\n\nIf you are sending an update to a previous patch (I am comparing\nthis patch with the \"show by example\" patch Junio sent on 11/02 \nhttp://article.gmane.org/gmane.comp.version-control.git/131893), \nit is a common courtesy to summarize what you changed relative \nto the base version after the three dashes line, so that people \nwill know which part can be skipped while reviewing your patch.\n\nI was originally puzzled by Junio's \"mine\" because I thought \n\"what does taking over the authorship have to do with digging \ndiamonds out of earth?\". \"reset-author\" makes it very clear,\nand I think it is a much better name for the option.\n\nYour first paragraph mentions \"one of the options\", but subject \nmentions four (-c, -C, --amend and --reset-author) and you want \nonly the first three of them.\n\nThe second paragraph of gmane/131893 says \"borrow the commit log \nmessage\" instead of repeating \"a template\". It has the effect of \nclarifying that only the message part is borrowed but not the \nauthorship information.\n\nI think gmane/131893 has much better description than your first \ntwo paragraphs for the these reasons.\n\n> diff --git a/t/t7509-commit.sh b/t/t7509-commit.sh\n> new file mode 100755\n> index 0000000..7290242\n> --- /dev/null\n> +++ b/t/t7509-commit.sh\n\nI have to say that the test script is much worse than what \ngmane/131893 had.\n\nThe old test made sure that -C copied the message, with or \nwithout the --mine option. But this test only checks the \nauthor line (and it doesn't even make sure that \"^author\" \nmatches only in the header). The messages are unchecked, \nand it will let a bug when someone breaks --reset-author \nlogic in the future in such a way that it corrupts the \nmessage by mistake go unnoticed.\n\nAlso the old test was much more readable because it used \nshell functions to avoid repeating cat-file and pipe to sed \nscript. It also tagged the initial commit, which had a nice \neffect that a failure in any intermediate test will not change \nwhich earlier commit is reused (eg. yours say \"-C HEAD^\" but \nold test said \"-C Initial\").\n\nIt looks silly to create an \"Initial Commit\" in the middle \nof history, too (^_^).\n\nI think it is much better to replace \"--mine\" in gmane/131893 \nwith \"--reset-author\" and make no other change to the test.\n\n-- \nNanako Shiraishi\nhttp://ivory.ap.teacup.com/nanako3/\n"},{"id":"126689","messageId":"55bacdd30911031551k1bfd3151t940864e4793f5a37@mail.gmail.com","threadId":"21470","inReplyTo":"20091104073822.6117@nanako3.lavabit.com","subject":"Re: [PATCH] commit -c/-C/--amend: reset timestamp and authorship to committer with --reset-author","fromName":"Erick Mattos","fromEmail":"erick.mattos@gmail.com","sentAt":"2009-11-03T23:51:43Z","receivedAt":"2009-11-03T23:51:43Z","isPatch":true,"sender":{"key":"erick.mattos@gmail.com","avatar":"https://avatars.githubusercontent.com/u/134001?v=4"},"body":"2009/11/3 Nanako Shiraishi <nanako3@lavabit.com>:\n> If you are sending an update to a previous patch (I am comparing\n> this patch with the \"show by example\" patch Junio sent on 11/02\n> http://article.gmane.org/gmane.comp.version-control.git/131893),\n> it is a common courtesy to summarize what you changed relative\n> to the base version after the three dashes line, so that people\n> will know which part can be skipped while reviewing your patch.\n\nI got your point.  I will try to improve that.\n\nI have been talking to Junio during the weekend and with a lot of\nemails sent to each other.  It happens that when he sent gmane/131893\n(I had to find out what that code meant because I was using\n[marc.info]! :-) ) I had already sent another patch with the\nsuggestions he made in a previous email.\nSo his message was late.  While I was waiting for his acknowledgment I\nstarted thinking he could be lost on those e-mails so I sent the one\nyou are replying to make it the last on the queue.\n\n> I have to say that the test script is much worse than what\n> gmane/131893 had.\n>\n> The old test made sure that -C copied the message, with or\n> without the --mine option. But this test only checks the\n> author line (and it doesn't even make sure that \"^author\"\n> matches only in the header). The messages are unchecked,\n> and it will let a bug when someone breaks --reset-author\n> logic in the future in such a way that it corrupts the\n> message by mistake go unnoticed.\n\nI think you misunderstood something here:\n* On his patch (which he sent before seeing mine), while testing -C,\non first check, he is checking author_header only.\n* While testing -C on mine I compare both messages without \"parent\",\n\"tree\" and \"committer\".  Whole!\n\nAfter check one I did concentrate only on author data.  But on mine I\nseparate the tests between timestamp and author (name and email),\nmaking sure the author was set to the actual committer and that the\ntimestamp was behaving as expected.\n\nI am not saying mine is better.  What I am saying is that I expected\nhim to notice and change/improve THIS patch.  Not the other.\n\nThe new option only touches on getting new author or copying the\noriginal so that is why I made the first check in whole and the others\nonly by author.  If people think that this operation is so uncertain,\nthen everything should be compared: parent, author and message on all\ntests.\n\nIt is not a problem for me adding more code to the test even if I\nconsider it unnecessary.  I am doing this only to give a pay-back for\nall the good service this free software gave to me so I am very\npatient to all demands.  I will be letting this effort go only at the\nreal end.  No matter how long it takes.\n\n> Also the old test was much more readable because it used\n> shell functions to avoid repeating cat-file and pipe to sed\n> script. It also tagged the initial commit, which had a nice\n> effect that a failure in any intermediate test will not change\n> which earlier commit is reused (eg. yours say \"-C HEAD^\" but\n> old test said \"-C Initial\").\n\nI am so used to scripts that I really haven't thought it difficult to\nread but I can do some cosmetic too if it is important.  As I said\nearly, I was waiting for Junio's jugdement over my later patch.\n\n> It looks silly to create an \"Initial Commit\" in the middle\n> of history, too (^_^).\n\nThis is something more laborious but which I thought was important to\nlet murphy's law act on a real case.  We never do an amend on an\ninitial commit so I only did the tests on a later one.\n\n> I think it is much better to replace \"--mine\" in gmane/131893\n> with \"--reset-author\" and make no other change to the test.\n\nLet's see Junio's opinion...  We have changed names a lot since start.  ;-)\n\n> --\n> Nanako Shiraishi\n> http://ivory.ap.teacup.com/nanako3/\n>\n>\n\nThank you very much for all your comments.  I really appreciate about\nbeing noticed by you people.  It is nice for a newcomer!\n"},{"id":"126696","messageId":"7vd43znldw.fsf@alter.siamese.dyndns.org","threadId":"21470","inReplyTo":"20091104073822.6117@nanako3.lavabit.com","subject":"Re: [PATCH] commit -c/-C/--amend: reset timestamp and authorship to committer with --reset-author","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-11-04T01:12:27Z","receivedAt":"2009-11-04T01:12:27Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nanako Shiraishi <nanako3@lavabit.com> writes:\n\n> I think it is much better to replace \"--mine\" in gmane/131893 \n> with \"--reset-author\" and make no other change to the test.\n\nHeh, I would not claim my tests were perfect, even though I agree with\nmost of the suggestions and comments, including the parts I did not quote\nthat are not about the test script.\n\nMy first test did not check the message contents, but all the other ones\n(except the last one that we expect the command to fail) check output from\nboth author_header and message_body, so that not just \"--mine affects the\nauthorship\" but also \"--mine does not mangle the message contents\" are\nchecked.\n\nOne thing you did not mention was that I made sure that the command failed\nwhen given both --mine and --author options; I think Erick's last round\nfails to test this condition.\n\n    Side note.  When writing tests for their shiny new toy, people often\n    forget to test \"the other side\".\n\n    It is just human nature.  It is more fun to demonstrate what your new\n    feature does, than making sure that the new feature does not kick in\n    when it is not supposed to, nor it does not change what it is not\n    supposed to change.\n\n    Negative tests are not particularly hard to write.  The harder part is\n    to force the habit of writing them on yourself.  Right after designing\n    and implementing a new feature, the list of things it is supposed to\n    do and when it is supposed to kick in are pretty clear in your mind,\n    and that is what makes writing positive tests psychologically a lot\n    easier.\n\n    On the other hand, it takes concious effort to list what it is _not_\n    supposed to do or when it is _not_ supposed to kick in.  That is why\n    people often fail to write negative tests.\n\nI think in addition to the obvious \"s/--mine/--reset-author/g\"\nreplacements, we would need this patch on top of mine.\n\n t/t7509-commit.sh |    4 ++++\n 1 files changed, 4 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t7509-commit.sh b/t/t7509-commit.sh\nindex ec13cea..1dad228 100755\n--- a/t/t7509-commit.sh\n+++ b/t/t7509-commit.sh\n@@ -28,6 +28,10 @@ test_expect_success '-C option copies authorship and message' '\n \tgit commit -a -C Initial &&\n \tauthor_header Initial >expect &&\n \tauthor_header HEAD >actual &&\n+\ttest_cmp expect actual &&\n+\n+\tmessage_body Initial >expect &&\n+\tmessage_body HEAD >actual &&\n \ttest_cmp expect actual\n '\n \n"},{"id":"126699","messageId":"7v639rnkvt.fsf@alter.siamese.dyndns.org","threadId":"21470","inReplyTo":"55bacdd30911031551k1bfd3151t940864e4793f5a37@mail.gmail.com","subject":"Re: [PATCH] commit -c/-C/--amend: reset timestamp and authorship to committer with --reset-author","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-11-04T01:23:18Z","receivedAt":"2009-11-04T01:23:18Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Erick Mattos <erick.mattos@gmail.com> writes:\n\n> ... I had already sent another patch with the\n> suggestions he made in a previous email.\n\nThat happens in real life with people working in different timezones.\n\n> The new option only touches on getting new author or copying the\n> original so that is why I made the first check in whole and the others\n> only by author.  If people think that this operation is so uncertain,\n> then everything should be compared: parent, author and message on all\n> tests.\n\nYou probably have misunderstood why we write tests; it is not about making\nsure _your_ implementation is Ok.  If that were the case, using knowledge\nof implementation details to short-circuit the tests would perfectly be\nacceptable.\n\nWe write tests so that long after you get bored and stop visiting the git\nproject mailing-list, if somebody _else_ changes the program and its\nbehaviour gets changed in a way _you_ did not expect, such a mistake can\nbe caught, even if you are not monitoring the mailing list to actively\ncatch such a bad change to go into the system.  So we prefer to test both\nsides of the coin without saying \"this option only affects this codepath\n(currently) so it never can break this part, it is not worth checking this\nand that (right now)\" when it is not too much trouble.  It is a win in the\nlong run.\n\nIn any case, I like --reset-author better than --mine.  I didn't think of\ndiamond-mine, though ;-)\n"},{"id":"126707","messageId":"55bacdd30911031855k6b38557bte14c858775d39da6@mail.gmail.com","threadId":"21470","inReplyTo":"7v639rnkvt.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] commit -c/-C/--amend: reset timestamp and authorship to committer with --reset-author","fromName":"Erick Mattos","fromEmail":"erick.mattos@gmail.com","sentAt":"2009-11-04T02:55:56Z","receivedAt":"2009-11-04T02:55:56Z","isPatch":true,"sender":{"key":"erick.mattos@gmail.com","avatar":"https://avatars.githubusercontent.com/u/134001?v=4"},"body":"2009/11/3 Junio C Hamano <gitster@pobox.com>:\n> Erick Mattos <erick.mattos@gmail.com> writes:\n>\n>> ... I had already sent another patch with the\n>> suggestions he made in a previous email.\n>\n> That happens in real life with people working in different timezones.\n\n6 hours between you and me!\n\n>> The new option only touches on getting new author or copying the\n>> original so that is why I made the first check in whole and the others\n>> only by author.  If people think that this operation is so uncertain,\n>> then everything should be compared: parent, author and message on all\n>> tests.\n>\n> You probably have misunderstood why we write tests; it is not about making\n> sure _your_ implementation is Ok.  If that were the case, using knowledge\n> of implementation details to short-circuit the tests would perfectly be\n> acceptable.\n>\n> We write tests so that long after you get bored and stop visiting the git\n> project mailing-list, if somebody _else_ changes the program and its\n> behaviour gets changed in a way _you_ did not expect, such a mistake can\n> be caught, even if you are not monitoring the mailing list to actively\n> catch such a bad change to go into the system.  So we prefer to test both\n> sides of the coin without saying \"this option only affects this codepath\n> (currently) so it never can break this part, it is not worth checking this\n> and that (right now)\" when it is not too much trouble.  It is a win in the\n> long run.\n\nI really did not get the reason before the other guy argued...  :-S\n\n> In any case, I like --reset-author better than --mine.  I didn't think of\n> diamond-mine, though ;-)\n>\n\nSo that's it!  Diamond...  me neither!  :-D\n\nI am going to send you another patch in a few minutes.  I hope this\ntime will be almost there.\n\nRegards\n"}]}