{"thread":{"id":"711","subject":"change of git-diff-tree and symlinks","startedAt":"2005-05-25T11:17:11Z","lastAt":"2005-05-30T03:17:32Z","messageCount":20,"participants":["Kay Sievers","Linus Torvalds","Junio C Hamano","Jochen Roemling","Sebastian Kuzminsky","Petr Baudis"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"3926","messageId":"20050525111711.GA27492@vrfy.org","threadId":"711","inReplyTo":null,"subject":"change of git-diff-tree and symlinks","fromName":"Kay Sievers","fromEmail":"kay.sievers@vrfy.org","sentAt":"2005-05-25T11:17:11Z","receivedAt":"2005-05-25T11:17:11Z","isPatch":false,"sender":{"key":"kay.sievers@vrfy.org","avatar":null},"body":"Hi,\nI'm catching up with gitweb.cgi to parse the changed output. Works fine\nso far and is really much easier to parse. Here is something that does\nnot work anymore. See the difference between:\n\n   http://www.kernel.org/git/?p=linux/hotplug/udev.git;a=commit;h=49cedafaf893bfe348eb7598227f1a11ae24bfd6\n   http://ehlo.org/~kay/gitweb.cgi?p=linux/hotplug/udev.git;a=commit;h=49cedafaf893bfe348eb7598227f1a11ae24bfd6\n\nOn my box is the lates git with the adapted gitweb.cgi. Here is the raw\noutput of the old git-diff-tree:\n  kay@dhcp-188:~/src/udev> /home/kay/src/cogito/git-diff-tree -r 49cedafaf893bfe348eb7598227f1a11ae24bfd6 17f2b1a7e0d10334af7f9622848788add125dea8\n  *120000->100644 blob 2d78258b1a0fe49afabc8c16a352117df5dc338a->2d78258b1a0fe49afabc8c16a352117df5dc338a test/sys/block/cciss!c0d0/device\n  *120000->100644 blob 2d78258b1a0fe49afabc8c16a352117df5dc338a->2d78258b1a0fe49afabc8c16a352117df5dc338a test/sys/block/rd!c0d0/device\n  *120000->100644 blob 2d78258b1a0fe49afabc8c16a352117df5dc338a->2d78258b1a0fe49afabc8c16a352117df5dc338a test/sys/block/sda/device\n  *120000->100644 blob 1c776568bdc9dc750addd0885dded6b008a44460->1c776568bdc9dc750addd0885dded6b008a44460 test/sys/bus/pci/devices/0000:00:09.0\n  *120000->100644 blob e000c77614a23ad57fed284bd007ed7c1cb7872e->e000c77614a23ad57fed284bd007ed7c1cb7872e test/sys/bus/pci/devices/0000:00:1e.0\n  ...\n\nThe new one shows simply nothing.\nShouldn't it print the mode changes like the old one?\n\nKay\n"},{"id":"3937","messageId":"Pine.LNX.4.58.0505251054110.2307@ppc970.osdl.org","threadId":"711","inReplyTo":"20050525111711.GA27492@vrfy.org","subject":"Re: change of git-diff-tree and symlinks","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-05-25T18:08:54Z","receivedAt":"2005-05-25T18:08:54Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Wed, 25 May 2005, Kay Sievers wrote:\n>\n> I'm catching up with gitweb.cgi to parse the changed output. Works fine\n> so far and is really much easier to parse. Here is something that does\n> not work anymore. See the difference between:\n> \n>    http://www.kernel.org/git/?p=linux/hotplug/udev.git;a=commit;h=49cedafaf893bfe348eb7598227f1a11ae24bfd6\n>    http://ehlo.org/~kay/gitweb.cgi?p=linux/hotplug/udev.git;a=commit;h=49cedafaf893bfe348eb7598227f1a11ae24bfd6\n\nYes, the new diff-tree thing doesn't show symlinks.\n\nThe problem seems to be that we just don't have a \"status\" flag for it. I \nthink we should call it \"T\" for \"Type change\" or something, but in the \nmeantime let's just have the rule that instead of ignoring unknown state \nchanges, we always print them out as \"?\" instead.\n\nIe something like this..\n\n(And I'd suggest you make gitweb flexible enough that it does something \nsane if it sees an unknown reason code - let's see what Junio thinks about \nwhat status code we should use for this).\n\n\t\tLinus\n\n----\ndiff --git a/diff.c b/diff.c\n--- a/diff.c\n+++ b/diff.c\n@@ -768,7 +768,7 @@ void diff_flush(int diff_output_style, i\n \tfor (i = 0; i < q->nr; i++) {\n \t\tstruct diff_filepair *p = q->queue[i];\n \t\tif (p->status == 0)\n-\t\t\tcontinue;\n+\t\t\tp->status = '?';\n \t\tswitch (diff_output_style) {\n \t\tcase DIFF_FORMAT_PATCH:\n \t\t\tdiff_flush_patch(p);\n"},{"id":"3940","messageId":"20050525183546.GA4241@vrfy.org","threadId":"711","inReplyTo":"Pine.LNX.4.58.0505251054110.2307@ppc970.osdl.org","subject":"Re: change of git-diff-tree and symlinks","fromName":"Kay Sievers","fromEmail":"kay.sievers@vrfy.org","sentAt":"2005-05-25T18:35:46Z","receivedAt":"2005-05-25T18:35:46Z","isPatch":false,"sender":{"key":"kay.sievers@vrfy.org","avatar":null},"body":"On Wed, May 25, 2005 at 11:08:54AM -0700, Linus Torvalds wrote:\n> \n> \n> On Wed, 25 May 2005, Kay Sievers wrote:\n> >\n> > I'm catching up with gitweb.cgi to parse the changed output. Works fine\n> > so far and is really much easier to parse. Here is something that does\n> > not work anymore. See the difference between:\n> > \n> >    http://www.kernel.org/git/?p=linux/hotplug/udev.git;a=commit;h=49cedafaf893bfe348eb7598227f1a11ae24bfd6\n> >    http://ehlo.org/~kay/gitweb.cgi?p=linux/hotplug/udev.git;a=commit;h=49cedafaf893bfe348eb7598227f1a11ae24bfd6\n> \n> Yes, the new diff-tree thing doesn't show symlinks.\n> \n> The problem seems to be that we just don't have a \"status\" flag for it. I \n> think we should call it \"T\" for \"Type change\" or something, but in the \n> meantime let's just have the rule that instead of ignoring unknown state \n> changes, we always print them out as \"?\" instead.\n> \n> Ie something like this..\n> \n> (And I'd suggest you make gitweb flexible enough that it does something \n> sane if it sees an unknown reason code - let's see what Junio thinks about \n> what status code we should use for this).\n\nOk, works again. Any reason not to mark it as 'M'? It's easyly to\ndistinguish between a content change and a mode change by looking if\nthe sha has changed.\n\nKay\n"},{"id":"3948","messageId":"7vzmujjdq4.fsf@assigned-by-dhcp.cox.net","threadId":"711","inReplyTo":"20050525183546.GA4241@vrfy.org","subject":"Re: change of git-diff-tree and symlinks","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-05-25T19:40:51Z","receivedAt":"2005-05-25T19:40:51Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":">>>>> \"KS\" == Kay Sievers <kay.sievers@vrfy.org> writes:\n\nKS> Ok, works again. Any reason not to mark it as 'M'? It's easyly to\nKS> distinguish between a content change and a mode change by looking if\nKS> the sha has changed.\n\nI'd need some time to think about this in the evening (I'm at\nwork now) but I think Linus did '?' as an interim measure.  I\nsuspect 'M' would work just as well without introducing a new\nclass 'T', but on the other hand having them distinct would be\neasier for people who read diff-raw format, so my knee-jerk\nreaction is that we should use 'T'.  It's the same reasoning to\nhave N, D, and U --- they can be gleaned by looking at mode and\nsha fields and there is no need to mark them any differently but\nsurely marking them the way we do now is much nicer.\n\nMore importantly I need to double check that diffcore stuff\nincluding rename/copy are doing the right thing about type\nchanges.  If some of them are throwing type-change pair away\nunder certain obscure conditions, then tweaking the part Linus\nadded the '?' is too late to remedy the situation.\n\n"},{"id":"3952","messageId":"7vwtpnhsed.fsf_-_@assigned-by-dhcp.cox.net","threadId":"711","inReplyTo":"7vzmujjdq4.fsf@assigned-by-dhcp.cox.net","subject":"[PATCH] Adjust show-files test for dotfiles.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-05-25T22:06:50Z","receivedAt":"2005-05-25T22:06:50Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"The earlier test was relying on the fact that dotfiles do not\nappear in the output to prepare expected test results, which\ninevitably got broken when we started handling dotfiles.  Change\nthe test to be honest about what \"--other\" file it creates.\n\nThe problem was originally pointed out by Mark Allen.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n\nt/t3000-ls-files-others.sh |    7 ++++---\n1 files changed, 4 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t3000-ls-files-others.sh b/t/t3000-ls-files-others.sh\n--- a/t/t3000-ls-files-others.sh\n+++ b/t/t3000-ls-files-others.sh\n@@ -20,8 +20,9 @@ mkdir path2\n date >path2/file2\n test_expect_success \\\n     'git-ls-files --others to show output.' \\\n-    'git-ls-files --others >.output'\n-cat >.expected <<EOF\n+    'git-ls-files --others >output'\n+cat >expected <<EOF\n+output\n path0\n path1\n path2/file2\n@@ -29,5 +30,5 @@ EOF\n \n test_expect_success \\\n     'git-ls-files --others should pick up symlinks.' \\\n-    'diff .output .expected'\n+    'diff output expected'\n test_done\n------------------------------------------------\n\n"},{"id":"3951","messageId":"7vvf57hsdv.fsf_-_@assigned-by-dhcp.cox.net","threadId":"711","inReplyTo":"7vzmujjdq4.fsf@assigned-by-dhcp.cox.net","subject":"[PATCH] Fix type-change handling when assigning the status code to filepairs.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-05-25T22:07:08Z","receivedAt":"2005-05-25T22:07:08Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"The interim single-liner '?' fix resulted delete entries that\nshould not have emitted coming out in the output as an\nunintended side effect; I caught this with the \"rename\" test in\nthe test suite.  This patch instead fixes the code that assigns\nthe status code to each filepair.\n\nI verified this does not break the testcase in udev.git tree Kay\nSievers gave us, by running git-diff-tree on that tree which\nshowed 21 file to symlink changes.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n\n*** Linus, it just struck me that there is nothing inherently\n*** wrong to detect whole subtree renames (diffcore-rename\n*** currently does not attempt to match tree creation against\n*** tree delete to produce tree rename/copy).  This is something\n*** I am _not_ going to do, but it still would be interesting to\n*** keep in mind...\n\ndiff.c     |   36 ++++++++++++++++++++++--------------\ndiffcore.h |    3 +++\n2 files changed, 25 insertions(+), 14 deletions(-)\n\ndiff --git a/diff.c b/diff.c\n--- a/diff.c\n+++ b/diff.c\n@@ -691,27 +691,34 @@ static void diff_resolve_rename_copy(voi\n \n \tfor (i = 0; i < q->nr; i++) {\n \t\tp = q->queue[i];\n-\t\tp->status = 0;\n+\t\tp->status = 0; /* undecided */\n \t\tif (DIFF_PAIR_UNMERGED(p))\n \t\t\tp->status = 'U';\n \t\telse if (!DIFF_FILE_VALID((p)->one))\n \t\t\tp->status = 'N';\n \t\telse if (!DIFF_FILE_VALID((p)->two)) {\n \t\t\t/* Deletion record should be omitted if there\n-\t\t\t * is another entry that is a rename or a copy\n-\t\t\t * and it uses this one as the source.  Then we\n-\t\t\t * can say the other one is a rename.\n+\t\t\t * are rename/copy entries using this one as\n+\t\t\t * the source.  Then we can say one of them\n+\t\t\t * is a rename and the rest are copies.\n \t\t\t */\n+\t\t\tp->status = 'D';\n \t\t\tfor (j = 0; j < q->nr; j++) {\n \t\t\t\tpp = q->queue[j];\n \t\t\t\tif (!strcmp(pp->one->path, p->one->path) &&\n-\t\t\t\t    strcmp(pp->one->path, pp->two->path))\n+\t\t\t\t    strcmp(pp->one->path, pp->two->path)) {\n+\t\t\t\t\tp->status = 'X';\n \t\t\t\t\tbreak;\n+\t\t\t\t}\n \t\t\t}\n-\t\t\tif (j < q->nr)\n-\t\t\t\tcontinue; /* has rename/copy */\n-\t\t\tp->status = 'D';\n \t\t}\n+\t\telse if (DIFF_PAIR_TYPE_CHANGED(p))\n+\t\t\tp->status = 'T';\n+\n+\t\t/* from this point on, we are dealing with a pair\n+\t\t * whose both sides are valid and of the same type, i.e.\n+\t\t * either in-place edit or rename/copy edit.\n+\t\t */\n \t\telse if (strcmp(p->one->path, p->two->path)) {\n \t\t\t/* See if there is somebody else anywhere that\n \t\t\t * will keep the path (either modified or\n@@ -719,7 +726,7 @@ static void diff_resolve_rename_copy(voi\n \t\t\t * not a rename.  In addition, if there is\n \t\t\t * some other rename or copy that comes later\n \t\t\t * than us that uses the same source, we\n-\t\t\t * cannot be a rename either.\n+\t\t\t * have to be a copy, not a rename.\n \t\t\t */\n \t\t\tfor (j = 0; j < q->nr; j++) {\n \t\t\t\tpp = q->queue[j];\n@@ -745,10 +752,9 @@ static void diff_resolve_rename_copy(voi\n \t\t}\n \t\telse if (memcmp(p->one->sha1, p->two->sha1, 20))\n \t\t\tp->status = 'M';\n-\t\telse {\n-\t\t\t/* we do not need this one */\n-\t\t\tp->status = 0;\n-\t\t}\n+\t\telse\n+\t\t\t/* this is a \"no-change\" entry */\n+\t\t\tp->status = 'X';\n \t}\n \tdiff_debug_queue(\"resolve-rename-copy done\", q);\n }\n@@ -767,8 +773,10 @@ void diff_flush(int diff_output_style, i\n \n \tfor (i = 0; i < q->nr; i++) {\n \t\tstruct diff_filepair *p = q->queue[i];\n+\t\tif (p->status == 'X')\n+\t\t\tcontinue;\n \t\tif (p->status == 0)\n-\t\t\tp->status = '?';\n+\t\t\tdie(\"internal error in diff-resolve-rename-copy\");\n \t\tswitch (diff_output_style) {\n \t\tcase DIFF_FORMAT_PATCH:\n \t\t\tdiff_flush_patch(p);\ndiff --git a/diffcore.h b/diffcore.h\n--- a/diffcore.h\n+++ b/diffcore.h\n@@ -45,6 +45,9 @@ struct diff_filepair {\n #define DIFF_PAIR_UNMERGED(p) \\\n \t(!DIFF_FILE_VALID((p)->one) && !DIFF_FILE_VALID((p)->two))\n \n+#define DIFF_PAIR_TYPE_CHANGED(p) \\\n+\t((S_IFMT & (p)->one->mode) != (S_IFMT & (p)->two->mode))\n+\n extern int diff_unmodified_pair(struct diff_filepair *);\n \n struct diff_queue_struct {\n------------------------------------------------\n\n"},{"id":"3953","messageId":"20050525222622.GA8552@vrfy.org","threadId":"711","inReplyTo":"7vzmujjdq4.fsf@assigned-by-dhcp.cox.net","subject":"Re: change of git-diff-tree and symlinks","fromName":"Kay Sievers","fromEmail":"kay.sievers@vrfy.org","sentAt":"2005-05-25T22:26:22Z","receivedAt":"2005-05-25T22:26:22Z","isPatch":false,"sender":{"key":"kay.sievers@vrfy.org","avatar":null},"body":"On Wed, May 25, 2005 at 12:40:51PM -0700, Junio C Hamano wrote:\n> >>>>> \"KS\" == Kay Sievers <kay.sievers@vrfy.org> writes:\n> \n> KS> Ok, works again. Any reason not to mark it as 'M'? It's easyly to\n> KS> distinguish between a content change and a mode change by looking if\n> KS> the sha has changed.\n> \n> I'd need some time to think about this in the evening (I'm at\n> work now) but I think Linus did '?' as an interim measure.  I\n> suspect 'M' would work just as well without introducing a new\n> class 'T', but on the other hand having them distinct would be\n> easier for people who read diff-raw format, so my knee-jerk\n> reaction is that we should use 'T'.  It's the same reasoning to\n> have N, D, and U --- they can be gleaned by looking at mode and\n> sha fields and there is no need to mark them any differently but\n> surely marking them the way we do now is much nicer.\n\nIf we introduce 'T', how is a content _and_ a type change represented\nif they happen at the same time?\n\nKay\n\n"},{"id":"3954","messageId":"7v7jhnhqpp.fsf@assigned-by-dhcp.cox.net","threadId":"711","inReplyTo":"20050525222622.GA8552@vrfy.org","subject":"Re: change of git-diff-tree and symlinks","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-05-25T22:43:14Z","receivedAt":"2005-05-25T22:43:14Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":">>>>> \"KS\" == Kay Sievers <kay.sievers@vrfy.org> writes:\n\nKS> If we introduce 'T', how is a content _and_ a type change represented\nKS> if they happen at the same time?\n\nIf you have this pair in two trees:\n\n    ln -s frotz xyzzy\n    echo -n frotz >xyzzy\n\nit is a 'T'.  If you instead have these in two trees:\n\n    ln -s rezrov xyzzy\n    echo -n frotz >xyzzy\n\nit is also a 'T'.\n\nI do not think we would want patch format to give us a diff\nshowing that string rezrov changing into frotz in the latter\nexample anyway.  When we have a type change, content change is\nirrelevant.\n\n"},{"id":"3955","messageId":"Pine.LNX.4.58.0505251544250.2307@ppc970.osdl.org","threadId":"711","inReplyTo":"20050525222622.GA8552@vrfy.org","subject":"Re: change of git-diff-tree and symlinks","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-05-25T22:47:10Z","receivedAt":"2005-05-25T22:47:10Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Thu, 26 May 2005, Kay Sievers wrote:\n> \n> If we introduce 'T', how is a content _and_ a type change represented\n> if they happen at the same time?\n\nA 'T' _always_ implies a content change, imho. \n\nYes, that strange udev changeset actually had files that had the same\ncontent as the symlinks, but from a patch perspective, that should\nprobably really still be a \"file got entirely deleted\" + \"we created a\nsymlink with new content\". Anything else just doesn't make any sense.\n\nSo in that way, 'T' really is different from 'M'. 'M' implies a patch\n(which might be empty, of course), while 'T' implies that the old thing \nwas deleted and entirely replaced with something totally different.\n\n\t\tLinus\n"},{"id":"3956","messageId":"7v1x7uj4i3.fsf_-_@assigned-by-dhcp.cox.net","threadId":"711","inReplyTo":"Pine.LNX.4.58.0505251544250.2307@ppc970.osdl.org","subject":"[PATCH] Mode only changes from diff.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-05-25T23:00:04Z","receivedAt":"2005-05-25T23:00:04Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"This fixes another bug.\n\n - Mode-only changes were pruned incorrectly from the output.\n - Added test to catch the above problem.\n - Normalize rename/copy similarity score in the diff-raw output\n   to per-cent, no matter what scale we internally use.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n\ndiff-helper.c        |    2 ++\ndiff.c               |    6 ++++--\nt/t4006-diff-mode.sh |   34 ++++++++++++++++++++++++++++++++++\n3 files changed, 40 insertions(+), 2 deletions(-)\nnew file (100755): t/t4006-diff-mode.sh\n\ndiff --git a/diff-helper.c b/diff-helper.c\n--- a/diff-helper.c\n+++ b/diff-helper.c\n@@ -4,6 +4,7 @@\n #include \"cache.h\"\n #include \"strbuf.h\"\n #include \"diff.h\"\n+#include \"diffcore.h\" /* just for MAX_SCORE */\n \n static const char *pickaxe = NULL;\n static int line_termination = '\\n';\n@@ -77,6 +78,7 @@ int main(int ac, const char **av) {\n \t\t\tif (status == 'R' || status == 'C') {\n \t\t\t\ttwo_paths = 1;\n \t\t\t\tsscanf(cp, \"%d\", &score);\n+\t\t\t\tscore = score * MAX_SCORE / 100;\n \t\t\t\tif (line_termination) {\n \t\t\t\t\tcp = strchr(cp,\n \t\t\t\t\t\t    inter_name_termination);\ndiff --git a/diff.c b/diff.c\n--- a/diff.c\n+++ b/diff.c\n@@ -517,7 +517,8 @@ static void diff_flush_raw(struct diff_f\n \tswitch (p->status) {\n \tcase 'C': case 'R':\n \t\ttwo_paths = 1;\n-\t\tsprintf(status, \"%c%1d\", p->status, p->score);\n+\t\tsprintf(status, \"%c%03d\", p->status,\n+\t\t\t(int)(0.5 + p->score * 100.0/MAX_SCORE));\n \t\tbreak;\n \tdefault:\n \t\ttwo_paths = 0;\n@@ -750,7 +751,8 @@ static void diff_resolve_rename_copy(voi\n \t\t\tif (!p->status)\n \t\t\t\tp->status = 'R';\n \t\t}\n-\t\telse if (memcmp(p->one->sha1, p->two->sha1, 20))\n+\t\telse if (memcmp(p->one->sha1, p->two->sha1, 20) ||\n+\t\t\t p->one->mode != p->two->mode)\n \t\t\tp->status = 'M';\n \t\telse\n \t\t\t/* this is a \"no-change\" entry */\ndiff --git a/t/t4006-diff-mode.sh b/t/t4006-diff-mode.sh\nnew file mode 100755\n--- /dev/null\n+++ b/t/t4006-diff-mode.sh\n@@ -0,0 +1,34 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2005 Junio C Hamano\n+#\n+\n+test_description='Test mode change diffs.\n+\n+'\n+. ./test-lib.sh\n+\n+test_expect_success \\\n+    'setup' \\\n+    'echo frotz >rezrov &&\n+     git-update-cache --add rezrov &&\n+     tree=`git-write-tree` &&\n+     echo $tree'\n+\n+test_expect_success \\\n+    'chmod' \\\n+    'chmod +x rezrov &&\n+     git-update-cache rezrov &&\n+     git-diff-cache $tree >current'\n+\n+_x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'\n+_x40=\"$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40\"\n+sed -e 's/\\(:100644 100755\\) \\('\"$_x40\"'\\) \\2 /\\1 X X /' <current >check\n+echo \":100644 100755 X X M\trezrov\" >expected\n+\n+test_expect_success \\\n+    'verify' \\\n+    'diff -u expected check'\n+\n+test_done\n+\n------------------------------------------------\n\n"},{"id":"3963","messageId":"7vr7fug2i4.fsf@assigned-by-dhcp.cox.net","threadId":"711","inReplyTo":"7v1x7uj4i3.fsf_-_@assigned-by-dhcp.cox.net","subject":"[PATCH] Test case portability fix.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-05-26T02:11:31Z","receivedAt":"2005-05-26T02:11:31Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"This is the remainder of testcase fix by Mark Allen to make them\nwork on his Darwin box.  I was using \"xargs -r\" (GNU) where it\nwas not needed, sed -ne '/^\\(author\\|committer\\)/s|>.*|>|p'\nwhere some sed does not know what to do with '\\|', and also\n\"cmp - file\" to compare standard input with a file, which his\ncmp does not support.\n\nAuthor: Mark Allen <mrallen1@yahoo.com>\nAuthor-Date: \nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n\nt/t0000-basic.sh                 |    2 +-\nt/t0110-environment-names-old.sh |    6 ++----\n2 files changed, 3 insertions(+), 5 deletions(-)\n\ndiff --git a/t/t0000-basic.sh b/t/t0000-basic.sh\n--- a/t/t0000-basic.sh\n+++ b/t/t0000-basic.sh\n@@ -84,7 +84,7 @@ do\n done\n test_expect_success \\\n     'adding various types of objects with git-update-cache --add.' \\\n-    'find path* ! -type d -print0 | xargs -0 -r git-update-cache --add'\n+    'find path* ! -type d -print0 | xargs -0 git-update-cache --add'\n \n # Show them and see that matches what we expect.\n test_expect_success \\\ndiff --git a/t/t0110-environment-names-old.sh b/t/t0110-environment-names-old.sh\n--- a/t/t0110-environment-names-old.sh\n+++ b/t/t0110-environment-names-old.sh\n@@ -86,8 +86,7 @@ committer A U Thor <author@example.xz>\n EOF\n test_expect_success \\\n     'verify old AUTHOR variables were used correctly in commit' \\\n-    'sed -ne '\\''/^\\(author\\|committer\\)/s|>.*|>|p'\\'' current |\n-     cmp - expected'\n+    'sed -ne '\\''/^\\(author\\)/s|>.*|>|p'\\'' -e'\\''/^\\(committer\\)/s|>.*|>|p'\\''\\    current > out && cmp out expected'\n \n unset GIT_DIR\n test_expect_success \\\n@@ -128,7 +127,6 @@ committer R O Htua <rohtua@example.xz>\n EOF\n test_expect_success \\\n     'verify new AUTHOR variables were used correctly in commit.' \\\n-    'sed -ne '\\''/^\\(author\\|committer\\)/s|>.*|>|p'\\'' current |\n-     cmp - expected'\n+    'sed -ne '\\''/^\\(author\\)/s|>.*|>|p'\\'' -e'\\''/^\\(committer\\)/s|>.*|>|p'\\''\\    current > out && cmp out expected'\n \n test_done\n------------------------------------------------\n\n"},{"id":"3964","messageId":"Pine.LNX.4.58.0505251935210.2307@ppc970.osdl.org","threadId":"711","inReplyTo":"7vr7fug2i4.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Test case portability fix.","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-05-26T02:36:16Z","receivedAt":"2005-05-26T02:36:16Z","isPatch":true,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Wed, 25 May 2005, Junio C Hamano wrote:\n>\n> This is the remainder of testcase fix by Mark Allen to make them\n> work on his Darwin box.  I was using \"xargs -r\" (GNU) where it\n> was not needed, sed -ne '/^\\(author\\|committer\\)/s|>.*|>|p'\n> where some sed does not know what to do with '\\|', and also\n> \"cmp - file\" to compare standard input with a file, which his\n> cmp does not support.\n> \n> Author: Mark Allen <mrallen1@yahoo.com>\n> Author-Date: \n\nBtw, do this as\n\n\tFrom: Mark Allen <mrallen1@yahoo.com>\n\nat the top of the email body, and my patch-application scripts will\nautomatically do the right thing.\n\nThe Author-date thing you might as well drop for now..\n\n\t\tLinus\n"},{"id":"3967","messageId":"7vll62g0g0.fsf@assigned-by-dhcp.cox.net","threadId":"711","inReplyTo":"Pine.LNX.4.58.0505251935210.2307@ppc970.osdl.org","subject":"Re: [PATCH] Test case portability fix.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-05-26T02:55:59Z","receivedAt":"2005-05-26T02:55:59Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sorry, I think I sent an stale copy from my draft box by\naccident and you already have the exactly same patch.\n\nAbout the \"From: \" thing, I understood.\n\n"},{"id":"4169","messageId":"4299CED5.5070508@roemling.net","threadId":"711","inReplyTo":"20050525111711.GA27492@vrfy.org","subject":"Re: change of git-diff-tree and symlinks","fromName":"Jochen Roemling","fromEmail":"jochen@roemling.net","sentAt":"2005-05-29T14:16:53Z","receivedAt":"2005-05-29T14:16:53Z","isPatch":false,"sender":{"key":"jochen@roemling.net","avatar":"https://gravatar.com/avatar/fd825445a548573b8483227eea8a12d7d3e474693d15bc2b77d9ee7df8870948?d=mp&s=160"},"body":"Hello Kay,\n\nI'm planning to use cogito/git for tracking development of my (PHP \nbased) website. Although this is the first time in my life I'm using \nsomething that smells like a SCM, it seems to work great. The only thing \nlacking is a working gitweb installation.\nI downloaded the gitweb.cgi script from \nkernel.org/pub/software/scm/gitweb, but it dates already May 23rd.\n\nIn your mail below from May 25 you state that there have been quite some \nchanges to git-diff-tree:\n\nKay Sievers wrote:\n\n>Hi,\n>I'm catching up with gitweb.cgi to parse the changed output. Works fine\n>so far and is really much easier to parse. Here is something that does\n>not work anymore. See the difference between:\n>\n>   http://www.kernel.org/git/?p=linux/hotplug/udev.git;a=commit;h=49cedafaf893bfe348eb7598227f1a11ae24bfd6\n>   http://ehlo.org/~kay/gitweb.cgi?p=linux/hotplug/udev.git;a=commit;h=49cedafaf893bfe348eb7598227f1a11ae24bfd6\n>\n>On my box is the lates git with the adapted gitweb.cgi. Here is the raw\n>output of the old git-diff-tree:\n>  kay@dhcp-188:~/src/udev> /home/kay/src/cogito/git-diff-tree -r 49cedafaf893bfe348eb7598227f1a11ae24bfd6 17f2b1a7e0d10334af7f9622848788add125dea8\n>  *120000->100644 blob 2d78258b1a0fe49afabc8c16a352117df5dc338a->2d78258b1a0fe49afabc8c16a352117df5dc338a test/sys/block/cciss!c0d0/device\n>  *120000->100644 blob 2d78258b1a0fe49afabc8c16a352117df5dc338a->2d78258b1a0fe49afabc8c16a352117df5dc338a test/sys/block/rd!c0d0/device\n>  *120000->100644 blob 2d78258b1a0fe49afabc8c16a352117df5dc338a->2d78258b1a0fe49afabc8c16a352117df5dc338a test/sys/block/sda/device\n>  *120000->100644 blob 1c776568bdc9dc750addd0885dded6b008a44460->1c776568bdc9dc750addd0885dded6b008a44460 test/sys/bus/pci/devices/0000:00:09.0\n>  *120000->100644 blob e000c77614a23ad57fed284bd007ed7c1cb7872e->e000c77614a23ad57fed284bd007ed7c1cb7872e test/sys/bus/pci/devices/0000:00:1e.0\n>  ...\n>\n>The new one shows simply nothing.\n>Shouldn't it print the mode changes like the old one?\n>\n>  \n>\nand that might be the reason why I'm getting \"nothing\" when I'm clicking \non a \"commitdiff\" link.\nAfter investigating further, I found out that the object type (\"blob\" in \nthe example above) is no longer printed by git-diff-tree.\nAlso there is a new parameter '-p' that allows the output of a patch \ndirectly instead of creating it with the help of temporary files as you \ndo it in gitweb.\nUnfortunately my perl knowledge is really poor and I didn't get it to \nwork. After I changed the call to git-diff-tree to use the '-p' switch, \nI'm getting a \"403 Forbidden - Reading diff-tree failed\" message, but \nthe same command on the command line works perfectly well. I don't know \nwhat is wrong there.\n\nCould you please post a downloadable current release of gitweb to \nkernel.org that works with the current git? If not, please tell me what \ngit release is installed at kernel.org so that I can use that branch to \nget it to work with gitweb.\n\nAnd as a last side note it would be helpfull if you could include a \nrelease number in the gitweb footer as you did in the very beginning so \nthat we know if something changed and there is new stuff to explore...\n\n... keep up the great work!\n\nJochen\n"},{"id":"4171","messageId":"20050529150656.GA27127@vrfy.org","threadId":"711","inReplyTo":"4299CED5.5070508@roemling.net","subject":"Re: change of git-diff-tree and symlinks","fromName":"Kay Sievers","fromEmail":"kay.sievers@vrfy.org","sentAt":"2005-05-29T15:06:56Z","receivedAt":"2005-05-29T15:06:56Z","isPatch":false,"sender":{"key":"kay.sievers@vrfy.org","avatar":null},"body":"On Sun, May 29, 2005 at 04:16:53PM +0200, Jochen Roemling wrote:\n> I'm planning to use cogito/git for tracking development of my (PHP \n> based) website. Although this is the first time in my life I'm using \n> something that smells like a SCM, it seems to work great. The only thing \n> lacking is a working gitweb installation.\n> I downloaded the gitweb.cgi script from \n> kernel.org/pub/software/scm/gitweb, but it dates already May 23rd.\n> \n> In your mail below from May 25 you state that there have been quite some \n> changes to git-diff-tree:\n> \n> Kay Sievers wrote:\n> >\n> >The new one shows simply nothing.\n> >Shouldn't it print the mode changes like the old one?\n> >\n> and that might be the reason why I'm getting \"nothing\" when I'm clicking \n> on a \"commitdiff\" link.\n\nThe kernel.org servers use Cogito which needs a new release. So the\nversion on kernel.org is always a working version with the current\nrelease of Cogito as long as we don't get a git-core to provide the\nbinaries.\n\n> After investigating further, I found out that the object type (\"blob\" in \n> the example above) is no longer printed by git-diff-tree.\n\nThe format has changed, just get the latest version of gitweb from my box\ninstead.\n\n> Also there is a new parameter '-p' that allows the output of a patch \n> directly instead of creating it with the help of temporary files as you \n> do it in gitweb.\n\nSure, gitweb did the diffs before git was able to do that. And it does\nnot really matter who is creating the temp-files, the cgi or the\ngit-binaries. :)\nIf things are stable some day, I may switch that over and maybe even\nsupport the nice rename detection.\n\n> Could you please post a downloadable current release of gitweb to \n> kernel.org that works with the current git? If not, please tell me what \n> git release is installed at kernel.org so that I can use that branch to \n> get it to work with gitweb.\n\nMy latest version is here:\n  ftp://ehlo.org/gitweb.cgi\n\n> And as a last side note it would be helpfull if you could include a \n> release number in the gitweb footer as you did in the very beginning so \n> that we know if something changed and there is new stuff to explore...\n\nIt is in the html-source, right at the top.\n\nThanks,\nKay\n"},{"id":"4172","messageId":"4299E88E.7090306@roemling.net","threadId":"711","inReplyTo":"20050529150656.GA27127@vrfy.org","subject":"Re: change of git-diff-tree and symlinks","fromName":"Jochen Roemling","fromEmail":"jochen@roemling.net","sentAt":"2005-05-29T16:06:38Z","receivedAt":"2005-05-29T16:06:38Z","isPatch":false,"sender":{"key":"jochen@roemling.net","avatar":"https://gravatar.com/avatar/fd825445a548573b8483227eea8a12d7d3e474693d15bc2b77d9ee7df8870948?d=mp&s=160"},"body":"[resending in plain-text]\n\nKay Sievers wrote:\n\n>The kernel.org servers use Cogito which needs a new release. So the\n>version on kernel.org is always a working version with the current\n>release of Cogito as long as we don't get a git-core to provide the\n>binaries.\n>  \n>\nAh yes, I remember the discussion about that.\nSebastian, could you include a matching gitweb.cgi into your \nDebian-Package?\n\nAnd what about something like:\n\nif (-e '/etc/gitweb.conf') { requite '/etc/gitweb.conf'; }\n\nafter the variable settings? The included file would then set \n$projectroot and friends to the local values so that I don't have to \npatch gitweb everytime I upgrade it. Since perl has no plain \"include\" \nand the require doesn't really work for me (it seems to include the \nfile, but the variables stay the same), I leave it up to you (I would \nhave been so proud to provide you a patch, but obviously my perl \nknowledge is worse than I thought).\n\n>My latest version is here:\n>  ftp://ehlo.org/gitweb.cgi\n>  \n>\nThanks for pointing that out. I had the impression, on ehlo.org is only \na installed version, not a downloadable one.\n\n>>And as a last side note it would be helpfull if you could include a \n>>release number in the gitweb footer as you did in the very beginning so \n>>that we know if something changed and there is new stuff to explore...\n>>    \n>>\n>\n>It is in the html-source, right at the top.\n>  \n>\nGood hiding-place....\n\nJochen\n"},{"id":"4173","messageId":"E1DcQRD-00057h-Vh@highlab.com","threadId":"711","inReplyTo":"4299E88E.7090306@roemling.net","subject":"Re: change of git-diff-tree and symlinks","fromName":"Sebastian Kuzminsky","fromEmail":"seb@highlab.com","sentAt":"2005-05-29T16:14:55Z","receivedAt":"2005-05-29T16:14:55Z","isPatch":false,"sender":{"key":"seb@highlab.com","avatar":"https://gravatar.com/avatar/f7ddd092ba3cf6999434f4d0d2f4b90fd174c2c3851617e8cffc0a2fee47becc?d=mp&s=160"},"body":"Jochen Roemling <jochen@roemling.net> wrote:\n> Sebastian, could you include a matching gitweb.cgi into your \n> Debian-Package?\n\nI'm planning to package gitweb as a separate Debian package.  I'll try\nto get to it next week.\n\n\n-- \nSebastian Kuzminsky\n"},{"id":"4188","messageId":"7vwtphn9oi.fsf@assigned-by-dhcp.cox.net","threadId":"711","inReplyTo":"20050529150656.GA27127@vrfy.org","subject":"Re: change of git-diff-tree and symlinks","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-05-29T18:55:57Z","receivedAt":"2005-05-29T18:55:57Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":">>>>> \"KS\" == Kay Sievers <kay.sievers@vrfy.org> writes:\n\n>> Also there is a new parameter '-p' that allows the output of a patch \n>> directly instead of creating it with the help of temporary files as you \n>> do it in gitweb.\n\nKS> Sure, gitweb did the diffs before git was able to do that. And it does\nKS> not really matter who is creating the temp-files, the cgi or the\nKS> git-binaries. :)\n\nI agree that you are doing the right thing here.  In a scripted\nenvironment it usually is more sensible not to use '-p' unless\ngenerating the diff is the _only_ thing you are doing.  '-p' is\nprimarily for people who ends up using the bare plumbing\ninteractively.\n\nKS> If things are stable some day, I may switch that over and maybe even\nKS> support the nice rename detection.\n\nSorry for being the primary culprit for the disruption ;-).\n\nYou do not have to use '-p' to be able to use rename detection\nnor any other diffcore stuff.  If you are processing\n\"git-diff-tree -r\" output right now, you can already process\n\"git-diff-tree -r -B -M -S'foo' -Oorder\" output just fine and\nleave your downstream processing the same as is.\n\n\n\n"},{"id":"4197","messageId":"20050529213206.GR1036@pasky.ji.cz","threadId":"711","inReplyTo":"20050529150656.GA27127@vrfy.org","subject":"Re: change of git-diff-tree and symlinks","fromName":"Petr Baudis","fromEmail":"pasky@ucw.cz","sentAt":"2005-05-29T21:32:06Z","receivedAt":"2005-05-29T21:32:06Z","isPatch":false,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Sun, May 29, 2005 at 05:06:56PM CEST, I got a letter\nwhere Kay Sievers <kay.sievers@vrfy.org> told me that...\n> On Sun, May 29, 2005 at 04:16:53PM +0200, Jochen Roemling wrote:\n> > I'm planning to use cogito/git for tracking development of my (PHP \n> > based) website. Although this is the first time in my life I'm using \n> > something that smells like a SCM, it seems to work great. The only thing \n> > lacking is a working gitweb installation.\n> > I downloaded the gitweb.cgi script from \n> > kernel.org/pub/software/scm/gitweb, but it dates already May 23rd.\n> > \n> > In your mail below from May 25 you state that there have been quite some \n> > changes to git-diff-tree:\n> > \n> > Kay Sievers wrote:\n> > >\n> > >The new one shows simply nothing.\n> > >Shouldn't it print the mode changes like the old one?\n> > >\n> > and that might be the reason why I'm getting \"nothing\" when I'm clicking \n> > on a \"commitdiff\" link.\n> \n> The kernel.org servers use Cogito which needs a new release. So the\n> version on kernel.org is always a working version with the current\n> release of Cogito as long as we don't get a git-core to provide the\n> binaries.\n\nTomorrow evening. I'd even do it now but I feel the changes need a bit\nof testing yet.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nC++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor\n"},{"id":"4231","messageId":"E1DcamS-0005Yn-D9@highlab.com","threadId":"711","inReplyTo":"4299E88E.7090306@roemling.net","subject":"Re: change of git-diff-tree and symlinks","fromName":"Sebastian Kuzminsky","fromEmail":"seb@highlab.com","sentAt":"2005-05-30T03:17:32Z","receivedAt":"2005-05-30T03:17:32Z","isPatch":false,"sender":{"key":"seb@highlab.com","avatar":"https://gravatar.com/avatar/f7ddd092ba3cf6999434f4d0d2f4b90fd174c2c3851617e8cffc0a2fee47becc?d=mp&s=160"},"body":"Jochen Roemling <jochen@roemling.net> wrote:\n> Sebastian, could you include a matching gitweb.cgi into your \n> Debian-Package?\n\n\nLooks like gitweb's already packaged for Debian.  Andres Salomon is\ndoing it:\n\n    http://marc.theaimsgroup.com/?l=git&m=111661740226054&w=2\n\n\n\n\n-- \nSebastian Kuzminsky\n"}]}