{"thread":{"id":"4869","subject":"git-fmt-merge-message problem..","startedAt":"2006-07-13T04:38:05Z","lastAt":"2006-07-13T08:03:26Z","messageCount":6,"participants":["Linus Torvalds","Junio C Hamano","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"23735","messageId":"Pine.LNX.4.64.0607122133250.5623@g5.osdl.org","threadId":"4869","inReplyTo":null,"subject":"git-fmt-merge-message problem..","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2006-07-13T04:38:05Z","receivedAt":"2006-07-13T04:38:05Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\nNot a huge one, but it's ugly.\n\nWhen I did a \"git pull repo\", the merge messages _used_ to look like this:\n\n    Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6\n    \n    * master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:\n      [NEIGH]: Fix IP-over-ATM and ARP interaction.\n      [TG3]: ethtool always report port is TP.\n\nor (if I specified a branch):\n\n    Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ro\n    \n    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infini\n      IB/mthca: FMR ioremap fix\n      IPoIB: Free child interfaces properly\n      IB/mthca: Fix race in reference counting\n      IB/srp: Fix tracking of pending requests during error handling\n      IB: Fix display of 4-bit port counters in sysfs\n\nbut now they look like this:\n\n    Merge commit master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 of HEAD\n    \n    * HEAD:\n      [NET]: fix __sk_stream_mem_reclaim\n      [Bluetooth] Fix deadlock in the L2CAP layer\n      [Bluetooth] Let BT_HIDP depend on INPUT\n      [Bluetooth] Avoid NULL pointer dereference with tty->driver\n      [Bluetooth] Remaining transitions to use kzalloc()\n      [WAN]: converting generic HDLC to use netif_dormant*()\n      [IPV4]: Fix error handling for fib_insert_node call\n      [NETROM] lockdep: fix false positive\n      ....\n\nwhich makes no sense AT ALL. It's doesn't even parse. \"Merge commit <repo> \nof <branch>\"? Whaa? That's just insane.\n\nAlso, the \" * HEAD\" is just ugly. It was better before.\n\nDscho? Can you please make git fmt-merge-message print out something \nsensible again? It doesn't have to match the old behaviour 100%, but the \ncurrent one is just ugly and senseless.\n\n\t\t\tLinus\n"},{"id":"23740","messageId":"7vlkqyw0om.fsf@assigned-by-dhcp.cox.net","threadId":"4869","inReplyTo":"Pine.LNX.4.64.0607122133250.5623@g5.osdl.org","subject":"Re: git-fmt-merge-message problem..","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-07-13T05:09:29Z","receivedAt":"2006-07-13T05:09:29Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Linus Torvalds <torvalds@osdl.org> writes:\n\n> which makes no sense AT ALL. It's doesn't even parse. \"Merge commit <repo> \n> of <branch>\"? Whaa? That's just insane.\n>\n> Also, the \" * HEAD\" is just ugly. It was better before.\n\nYes, this is a simple mistranslation from Perl to C.  A patch\nwill follow shortly.\n"},{"id":"23741","messageId":"7vhd1mw05a.fsf@assigned-by-dhcp.cox.net","threadId":"4869","inReplyTo":"7vlkqyw0om.fsf@assigned-by-dhcp.cox.net","subject":"Re: git-fmt-merge-message problem..","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-07-13T05:21:05Z","receivedAt":"2006-07-13T05:21:05Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <junkio@cox.net> writes:\n\n> Linus Torvalds <torvalds@osdl.org> writes:\n>\n>> which makes no sense AT ALL. It's doesn't even parse. \"Merge commit <repo> \n>> of <branch>\"? Whaa? That's just insane.\n>>\n>> Also, the \" * HEAD\" is just ugly. It was better before.\n>\n> Yes, this is a simple mistranslation from Perl to C.  A patch\n> will follow shortly.\n\n-- >8 --\n[PATCH] fmt-merge-msg fix\n\nThe new C version mistranslated the original Perl version in the\ncase to pull from the HEAD.  This made it to say nonsense like\nthis:\n\n\tMerge commit ...url... of HEAD\n\n        * HEAD:\n        ...\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n builtin-fmt-merge-msg.c |   16 ++++++++++------\n 1 files changed, 10 insertions(+), 6 deletions(-)\n\ndiff --git a/builtin-fmt-merge-msg.c b/builtin-fmt-merge-msg.c\nindex 6527482..fe0ef44 100644\n--- a/builtin-fmt-merge-msg.c\n+++ b/builtin-fmt-merge-msg.c\n@@ -76,6 +76,7 @@ static int handle_line(char *line)\n \tunsigned char *sha1;\n \tchar *src, *origin;\n \tstruct src_data *src_data;\n+\tint pulling_head = 0;\n \n \tif (len < 43 || line[40] != '\\t')\n \t\treturn 1;\n@@ -101,8 +102,11 @@ static int handle_line(char *line)\n \tif (src) {\n \t\t*src = 0;\n \t\tsrc += 4;\n-\t} else\n-\t\tsrc = \"HEAD\";\n+\t\tpulling_head = 0;\n+\t} else {\n+\t\tsrc = line;\n+\t\tpulling_head = 1;\n+\t}\n \n \ti = find_in_list(&srcs, src);\n \tif (i < 0) {\n@@ -112,7 +116,10 @@ static int handle_line(char *line)\n \t}\n \tsrc_data = srcs.payload[i];\n \n-\tif (!strncmp(line, \"branch \", 7)) {\n+\tif (pulling_head) {\n+\t\torigin = strdup(src);\n+\t\tsrc_data->head_status |= 1;\n+\t} else if (!strncmp(line, \"branch \", 7)) {\n \t\torigin = strdup(line + 7);\n \t\tappend_to_list(&src_data->branch, origin, NULL);\n \t\tsrc_data->head_status |= 2;\n@@ -124,9 +131,6 @@ static int handle_line(char *line)\n \t\torigin = strdup(line + 14);\n \t\tappend_to_list(&src_data->r_branch, origin, NULL);\n \t\tsrc_data->head_status |= 2;\n-\t} else if (!strcmp(line, \"HEAD\")) {\n-\t\torigin = strdup(src);\n-\t\tsrc_data->head_status |= 1;\n \t} else {\n \t\torigin = strdup(src);\n \t\tappend_to_list(&src_data->generic, strdup(line), NULL);\n"},{"id":"23742","messageId":"Pine.LNX.4.64.0607122222310.5623@g5.osdl.org","threadId":"4869","inReplyTo":"7vlkqyw0om.fsf@assigned-by-dhcp.cox.net","subject":"Re: git-fmt-merge-message problem..","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2006-07-13T05:29:14Z","receivedAt":"2006-07-13T05:29:14Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Wed, 12 Jul 2006, Junio C Hamano wrote:\n> \n> Yes, this is a simple mistranslation from Perl to C.  A patch\n> will follow shortly.\n\nOn a similar vein, how about this?\n\nI always end up editing the revert sentence by hand to make grammatical \nsense.\n\nI think we always talk about \"commit xyz\".\n\nWe never talk about \"xyz commit\", except when we end up talking about a \ncommit as a branch head (notably, I would say \"the HEAD commit\", or \npossibly \"the top-of-master commit\", but here $commit is a SHA1 name, not \nanything else).\n\nHmm?\n\n\t\tLinus\n\n---\n\ndiff --git a/git-revert.sh b/git-revert.sh\nindex de8b5f0..2bf35d1 100755\n--- a/git-revert.sh\n+++ b/git-revert.sh\n@@ -84,7 +84,7 @@ revert)\n \t\ts/^[^ ]* /Revert \"/\n \t\ts/$/\"/'\n \techo\n-\techo \"This reverts $commit commit.\"\n+\techo \"This reverts commit $commit.\"\n \ttest \"$rev\" = \"$commit\" ||\n \techo \"(original 'git revert' arguments: $@)\"\n \tbase=$commit next=$prev\n"},{"id":"23744","messageId":"7vr70qukdz.fsf@assigned-by-dhcp.cox.net","threadId":"4869","inReplyTo":"Pine.LNX.4.64.0607122222310.5623@g5.osdl.org","subject":"Re: git-fmt-merge-message problem..","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-07-13T05:46:48Z","receivedAt":"2006-07-13T05:46:48Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Linus Torvalds <torvalds@osdl.org> writes:\n\n> On Wed, 12 Jul 2006, Junio C Hamano wrote:\n>> \n>> Yes, this is a simple mistranslation from Perl to C.  A patch\n>> will follow shortly.\n>\n> On a similar vein, how about this?\n>\n> I always end up editing the revert sentence by hand to make grammatical \n> sense.\n>\n> I think we always talk about \"commit xyz\".\n>\n> We never talk about \"xyz commit\", except when we end up talking about a \n> commit as a branch head (notably, I would say \"the HEAD commit\", or \n> possibly \"the top-of-master commit\", but here $commit is a SHA1 name, not \n> anything else).\n>\n> Hmm?\n\nMakes sense.  Sign-off ;-)?\n\nI wonder if we would want to abbreviate this, though.\n"},{"id":"23750","messageId":"Pine.LNX.4.63.0607130958250.29667@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"4869","inReplyTo":"Pine.LNX.4.64.0607122133250.5623@g5.osdl.org","subject":"Re: git-fmt-merge-message problem..","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-07-13T08:03:26Z","receivedAt":"2006-07-13T08:03:26Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 12 Jul 2006, Linus Torvalds wrote:\n\n> Dscho? Can you please make git fmt-merge-message print out something \n> sensible again?\n\nSorry for the breakage. I saw Junio already patched and pushed.\n\nCiao,\nDscho\n"}]}