{"thread":{"id":"7367","subject":"\"git revert\" message changes...","startedAt":"2007-03-23T15:07:51Z","lastAt":"2007-03-24T12:34:12Z","messageCount":6,"participants":["Linus Torvalds","Johannes Schindelin","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"37816","messageId":"Pine.LNX.4.64.0703230805450.6730@woody.linux-foundation.org","threadId":"7367","inReplyTo":null,"subject":"\"git revert\" message changes...","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2007-03-23T15:07:51Z","receivedAt":"2007-03-23T15:07:51Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\nCan we please revert the \"revert\" changes to the default message?\n\nNot only did it make the one-line description much less readable by \nputting the shortened SHA1 in there (and removing the quotes), it also \nmissed the empty line between the header and the body.\n\nIOW, the old scripted message was much better. The built-in is nice, but \nthe new message format is inferior.\n\nDscho?\n\n\t\tLinus\n"},{"id":"37823","messageId":"Pine.LNX.4.63.0703231705150.4045@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"7367","inReplyTo":"Pine.LNX.4.64.0703230805450.6730@woody.linux-foundation.org","subject":"[PATCH] git-revert: Revert revert message to old behaviour","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-03-23T16:06:11Z","receivedAt":"2007-03-23T16:06:11Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nWhen converting from the shell script, based on a misreading of the\nsed invocation, the builtin included the abbreviated commit name,\nand did _not_ include the quotes around the oneline message.\n\nThis fixes it.\n\nSigned-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n---\n\n\tOn Fri, 23 Mar 2007, Linus Torvalds wrote:\n\t\n\t> \n\t> Can we please revert the \"revert\" changes to the default message?\n\t> \n\t> Dscho?\n\n\tYeah?\n\n builtin-revert.c |    6 ++----\n 1 files changed, 2 insertions(+), 4 deletions(-)\n\ndiff --git a/builtin-revert.c b/builtin-revert.c\nindex f3f3f5c..f4e1e22 100644\n--- a/builtin-revert.c\n+++ b/builtin-revert.c\n@@ -296,11 +296,9 @@ static int revert_or_cherry_pick(int argc, const char **argv)\n \tif (action == REVERT) {\n \t\tbase = commit;\n \t\tnext = commit->parents->item;\n-\t\tadd_to_msg(\"Revert \");\n-\t\tadd_to_msg(find_unique_abbrev(commit->object.sha1,\n-\t\t\t\t\tDEFAULT_ABBREV));\n+\t\tadd_to_msg(\"Revert \\\"\");\n \t\tadd_to_msg(oneline);\n-\t\tadd_to_msg(\"\\nThis reverts commit \");\n+\t\tadd_to_msg(\"\\\"\\nThis reverts commit \");\n \t\tadd_to_msg(sha1_to_hex(commit->object.sha1));\n \t\tadd_to_msg(\".\\n\");\n \t} else {\n-- \n1.5.1.rc1.2356.g2054\n"},{"id":"37827","messageId":"Pine.LNX.4.64.0703230926380.6730@woody.linux-foundation.org","threadId":"7367","inReplyTo":"Pine.LNX.4.63.0703231705150.4045@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] git-revert: Revert revert message to old behaviour","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2007-03-23T16:27:53Z","receivedAt":"2007-03-23T16:27:53Z","isPatch":true,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Fri, 23 Mar 2007, Johannes Schindelin wrote:\n> \n> When converting from the shell script, based on a misreading of the\n> sed invocation, the builtin included the abbreviated commit name,\n> and did _not_ include the quotes around the oneline message.\n> \n> This fixes it.\n\nHow about the empty line in between the message and the \"This reverts \ncommit \"..\n\n> +\t\tadd_to_msg(\"Revert \\\"\");\n>  \t\tadd_to_msg(oneline);\n> -\t\tadd_to_msg(\"\\nThis reverts commit \");\n> +\t\tadd_to_msg(\"\\\"\\nThis reverts commit \");\n\nThis should probably be\n\n\tadd_to_msg(\"\\\"\\n\\nThis reverts commit \");\n\nwith *two* \\n's, no?\n\n\t\tLinus\n"},{"id":"37835","messageId":"Pine.LNX.4.63.0703232013330.4045@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"7367","inReplyTo":"Pine.LNX.4.64.0703230926380.6730@woody.linux-foundation.org","subject":"Re: [PATCH] git-revert: Revert revert message to old behaviour","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-03-23T19:13:52Z","receivedAt":"2007-03-23T19:13:52Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Fri, 23 Mar 2007, Linus Torvalds wrote:\n\n> On Fri, 23 Mar 2007, Johannes Schindelin wrote:\n> > \n> > When converting from the shell script, based on a misreading of the\n> > sed invocation, the builtin included the abbreviated commit name,\n> > and did _not_ include the quotes around the oneline message.\n> > \n> > This fixes it.\n> \n> How about the empty line in between the message and the \"This reverts \n> commit \"..\n> \n> > +\t\tadd_to_msg(\"Revert \\\"\");\n> >  \t\tadd_to_msg(oneline);\n> > -\t\tadd_to_msg(\"\\nThis reverts commit \");\n> > +\t\tadd_to_msg(\"\\\"\\nThis reverts commit \");\n> \n> This should probably be\n> \n> \tadd_to_msg(\"\\\"\\n\\nThis reverts commit \");\n> \n> with *two* \\n's, no?\n\nYes. Sorry.\n\nCiao,\nDscho\n"},{"id":"37867","messageId":"7v648rm0g5.fsf@assigned-by-dhcp.cox.net","threadId":"7367","inReplyTo":"Pine.LNX.4.63.0703232013330.4045@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] git-revert: Revert revert message to old behaviour","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-03-24T09:54:02Z","receivedAt":"2007-03-24T09:54:02Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n>> How about the empty line in between the message and the \"This reverts \n>> commit \"..\n>> \n>> > +\t\tadd_to_msg(\"Revert \\\"\");\n>> >  \t\tadd_to_msg(oneline);\n>> > -\t\tadd_to_msg(\"\\nThis reverts commit \");\n>> > +\t\tadd_to_msg(\"\\\"\\nThis reverts commit \");\n>> \n>> This should probably be\n>> \n>> \tadd_to_msg(\"\\\"\\n\\nThis reverts commit \");\n>> \n>> with *two* \\n's, no?\n>\n> Yes. Sorry.\n\nNot only that.  \n\nThe older one had two, duplicated abbrev, and your fix reduces\nit to once, but we do not want any abbrev there.\n\n-- >8 --\n[PATCH] git-revert: Revert revert message to old behaviour\n\nWhen converting from the shell script, based on a misreading of the\nsed invocation, the builtin included the abbreviated commit name,\nand did _not_ include the quotes around the oneline message.\n\nThis fixes it.\n\n[jc: with a fix for the typo/thinko spotted by Linus, and also\n removing the unwanted abbrev at the beginning.]\n\nSigned-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n builtin-revert.c |   10 +++++-----\n 1 files changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/builtin-revert.c b/builtin-revert.c\nindex f3f3f5c..4ba0ee6 100644\n--- a/builtin-revert.c\n+++ b/builtin-revert.c\n@@ -294,13 +294,13 @@ static int revert_or_cherry_pick(int argc, const char **argv)\n \toneline = get_oneline(message);\n \n \tif (action == REVERT) {\n+\t\tchar *oneline_body = strchr(oneline, ' ');\n+\n \t\tbase = commit;\n \t\tnext = commit->parents->item;\n-\t\tadd_to_msg(\"Revert \");\n-\t\tadd_to_msg(find_unique_abbrev(commit->object.sha1,\n-\t\t\t\t\tDEFAULT_ABBREV));\n-\t\tadd_to_msg(oneline);\n-\t\tadd_to_msg(\"\\nThis reverts commit \");\n+\t\tadd_to_msg(\"Revert \\\"\");\n+\t\tadd_to_msg(oneline_body + 1);\n+\t\tadd_to_msg(\"\\\"\\n\\nThis reverts commit \");\n \t\tadd_to_msg(sha1_to_hex(commit->object.sha1));\n \t\tadd_to_msg(\".\\n\");\n \t} else {\n-- \n1.5.1.rc1.666.g2823\n"},{"id":"37876","messageId":"Pine.LNX.4.63.0703241333580.4045@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"7367","inReplyTo":"7v648rm0g5.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] git-revert: Revert revert message to old behaviour","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-03-24T12:34:12Z","receivedAt":"2007-03-24T12:34:12Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sat, 24 Mar 2007, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> >> How about the empty line in between the message and the \"This reverts \n> >> commit \"..\n> >> \n> >> > +\t\tadd_to_msg(\"Revert \\\"\");\n> >> >  \t\tadd_to_msg(oneline);\n> >> > -\t\tadd_to_msg(\"\\nThis reverts commit \");\n> >> > +\t\tadd_to_msg(\"\\\"\\nThis reverts commit \");\n> >> \n> >> This should probably be\n> >> \n> >> \tadd_to_msg(\"\\\"\\n\\nThis reverts commit \");\n> >> \n> >> with *two* \\n's, no?\n> >\n> > Yes. Sorry.\n> \n> Not only that.  \n> \n> The older one had two, duplicated abbrev, and your fix reduces\n> it to once, but we do not want any abbrev there.\n\nD'oh.\n\nThanks,\nDscho\n"}]}