{"thread":{"id":"12146","subject":"[EGIT PATCH] Show diffs for changed files under a new or deleted directory.","startedAt":"2008-02-17T15:05:46Z","lastAt":"2008-02-18T06:44:57Z","messageCount":4,"participants":["Roger C. Soares","Robin Rosenberg"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"68995","messageId":"200802171605.48250.robin.rosenberg@dewire.com","threadId":"12146","inReplyTo":"1203263746-2924-1-git-send-email-rogersoares@intelinet.com.br","subject":"Re: [EGIT PATCH] Show diffs for changed files under a new or deleted directory.","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg@dewire.com","sentAt":"2008-02-17T15:05:46Z","receivedAt":"2008-02-17T15:05:46Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"söndagen den 17 februari 2008 skrev du:\n> When a directory is added or removed in a commit the files under it \n> were not being shown in the structure compare viewer. This fixes it by\n> adding diff nodes for all the files under this directory.\n> \n> This patch also fixes some files showing as being removed in the\n> structure compare when they were actually being added.\n> \n> Signed-off-by: Roger C. Soares <rogersoares@intelinet.com.br>\n> ---\n> Hi Robin,\n> \n> What is \"TODO: Git ordering\" supposed to change?\n\nShould really read FIXME. It's a known bug that I forgot about at this place.\n\nThe git data structures has a nasty ordering of things that makes sense in \nthe index but nowhere else. This is an example. say a.b and a=b is a file and \na is a tree, then the 'git' order is:\n\na.b\na\na=b\n\ni.e. the tree 'a' is sorted as if there is a '/' at then end. For full path\nnames that is no problem and it is actually trivial, but when you order\nthings by partial names it is much messier and quite hard to test also. There\nis a bug in the IndexTreeWalker and probably the differenser and you found it.\nIt seems most likely you fixed it for that particular case, but it could still \nbe broken for another.\n\nI'd love to see a unit test for your code since, even if it works, it is very easy\nto break again.\n\nSee also the topic \"[EGIT Patches] Sort order from hell fixes\". Unfortunately\nthe patches did *not* fix the ordering, it just moved the problem to another\nset of input data. Patch 1/2 is ok, I think, but 2/2 is just bogus.\n\nHere is one of the cases I'm struggling with now. I discovered it when trying\nto commit things and the dialog shows allmost all files as modified. Another\nuser got no files listed. We probably should compute the DiffNode structure\nusing the IndexDiff too to make sure everyone does it right, once I (or we)\nmake it work. That would also give us the missing Index/workdir vs HEAD diff\nfeature too.\n\nI've amended the existing tests since the original ones only tested the\n\"interesting\" properties and missed some surprised so currently I'm trying to\nmake these tests work. We need more tests than this though since these tests\npass with known bad code.\n\n-- robin\n\n/*\n *  Copyright (C) 2007 David Watson <dwatson@mimvista.com>\n *\n *  This library is free software; you can redistribute it and/or\n *  modify it under the terms of the GNU Lesser General Public\n *  License, version 2.1, as published by the Free Software Foundation.\n *\n *  This library is distributed in the hope that it will be useful,\n *  but WITHOUT ANY WARRANTY; without even the implied warranty of\n *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n *  Lesser General Public License for more details.\n *\n *  You should have received a copy of the GNU Lesser General Public\n *  License along with this library; if not, write to the Free Software\n *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301\n */\n\npackage org.spearce.jgit.lib;\n\nimport java.io.File;\nimport java.io.IOException;\n\npublic class IndexDiffTest extends RepositoryTestCase {\n\tpublic void testAdded() throws IOException {\n\t\tGitIndex index = new GitIndex(db);\n\t\twriteTrashFile(\"file1\", \"file1\");\n\t\twriteTrashFile(\"dir/subfile\", \"dir/subfile\");\n\t\tTree tree = new Tree(db);\n\n\t\tindex.add(trash, new File(trash, \"file1\"));\n\t\tindex.add(trash, new File(trash, \"dir/subfile\"));\n\t\tIndexDiff diff = new IndexDiff(tree, index);\n\t\tdiff.diff();\n\t\tassertEquals(2, diff.getAdded().size());\n\t\tassertTrue(diff.getAdded().contains(\"file1\"));\n\t\tassertTrue(diff.getAdded().contains(\"dir/subfile\"));\n\t\tassertEquals(0, diff.getChanged().size());\n\t\tassertEquals(0, diff.getModified().size());\n\t\tassertEquals(0, diff.getRemoved().size());\n\t}\n\n\tpublic void testRemoved() throws IOException {\n\t\tGitIndex index = new GitIndex(db);\n\t\twriteTrashFile(\"file2\", \"file2\");\n\t\twriteTrashFile(\"dir/file3\", \"dir/file3\");\n\n\t\tTree tree = new Tree(db);\n\t\ttree.addFile(\"file2\");\n\t\ttree.addFile(\"dir/file3\");\n\t\tassertEquals(2, tree.memberCount());\n\t\ttree.findBlobMember(\"file2\").setId(new ObjectId(\"30d67d4672d5c05833b7192cc77a79eaafb5c7ad\"));\n\t\tTree tree2 = (Tree) tree.findTreeMember(\"dir\");\n\t\ttree2.findBlobMember(\"file3\").setId(new ObjectId(\"873fb8d667d05436d728c52b1d7a09528e6eb59b\"));\n\t\ttree2.setId(new ObjectWriter(db).writeTree(tree2));\n\t\ttree.setId(new ObjectWriter(db).writeTree(tree));\n\n\t\tIndexDiff diff = new IndexDiff(tree, index);\n\t\tdiff.diff();\n\t\tassertEquals(2, diff.getRemoved().size());\n\t\tassertTrue(diff.getRemoved().contains(\"file2\"));\n\t\tassertTrue(diff.getRemoved().contains(\"dir/file3\"));\n\t\tassertEquals(0, diff.getChanged().size());\n\t\tassertEquals(0, diff.getModified().size());\n\t\tassertEquals(0, diff.getAdded().size());\n\t}\n\n\tpublic void testModified() throws IOException {\n\t\tGitIndex index = new GitIndex(db);\n\t\t\n\t\t\n\t\tindex.add(trash, writeTrashFile(\"file2\", \"file2\"));\n\t\tindex.add(trash, writeTrashFile(\"dir/file3\", \"dir/file3\"));\n\t\t\n\t\twriteTrashFile(\"dir/file3\", \"changed\");\n\n\t\tTree tree = new Tree(db);\n\t\ttree.addFile(\"file2\").setId(new ObjectId(\"0123456789012345678901234567890123456789\"));\n\t\ttree.addFile(\"dir/file3\").setId(new ObjectId(\"0123456789012345678901234567890123456789\"));\n\t\tassertEquals(2, tree.memberCount());\n\n\t\tTree tree2 = (Tree) tree.findTreeMember(\"dir\");\n\t\ttree2.setId(new ObjectWriter(db).writeTree(tree2));\n\t\ttree.setId(new ObjectWriter(db).writeTree(tree));\n\t\tIndexDiff diff = new IndexDiff(tree, index);\n\t\tdiff.diff();\n\t\tassertEquals(2, diff.getChanged().size());\n\t\tassertTrue(diff.getChanged().contains(\"file2\"));\n\t\tassertTrue(diff.getChanged().contains(\"dir/file3\"));\n\t\tassertEquals(1, diff.getModified().size());\n\t\tassertTrue(diff.getModified().contains(\"dir/file3\"));\n\t\tassertEquals(0, diff.getAdded().size());\n\t\tassertEquals(0, diff.getRemoved().size());\n\t\tassertEquals(0, diff.getMissing().size());\n\t}\n\n\tpublic void testUnchangedSimple() throws IOException {\n\t\tGitIndex index = new GitIndex(db);\n\n\t\tindex.add(trash, writeTrashFile(\"a.b\", \"a.b\"));\n\t\tindex.add(trash, writeTrashFile(\"a.c\", \"a.c\"));\n\t\tindex.add(trash, writeTrashFile(\"a=c\", \"a=c\"));\n\t\tindex.add(trash, writeTrashFile(\"a=d\", \"a=d\"));\n\n\t\tTree tree = new Tree(db);\n\t\t// got the hash id'd from the data using echo -n a.b|git hash-object -t blob --stdin\n\t\ttree.addFile(\"a.b\").setId(new ObjectId(\"f6f28df96c2b40c951164286e08be7c38ec74851\"));\n\t\ttree.addFile(\"a.c\").setId(new ObjectId(\"6bc0e647512d2a0bef4f26111e484dc87df7f5ca\"));\n\t\ttree.addFile(\"a=c\").setId(new ObjectId(\"06022365ddbd7fb126761319633bf73517770714\"));\n\t\ttree.addFile(\"a=d\").setId(new ObjectId(\"fa6414df3da87840700e9eeb7fc261dd77ccd5c2\"));\n\n\t\ttree.setId(new ObjectWriter(db).writeTree(tree));\n\n\t\tIndexDiff diff = new IndexDiff(tree, index);\n\t\tdiff.diff();\n\t\tassertEquals(0, diff.getChanged().size());\n\t\tassertEquals(0, diff.getAdded().size());\n\t\tassertEquals(0, diff.getRemoved().size());\n\t\tassertEquals(0, diff.getMissing().size());\n\t\tassertEquals(0, diff.getModified().size());\n\t}\n\n\t/**\n\t * This test has both files and directories that involve\n\t * the tricky ordering used by Git.\n\t *\n\t * @throws IOException\n\t */\n\tpublic void testUnchangedComplex() throws IOException {\n\t\tGitIndex index = new GitIndex(db);\n\n\t\tindex.add(trash, writeTrashFile(\"a.b\", \"a.b\"));\n\t\tindex.add(trash, writeTrashFile(\"a.c\", \"a.c\"));\n\t\tindex.add(trash, writeTrashFile(\"a/b.b/b\", \"a/b.b/b\"));\n\t\tindex.add(trash, writeTrashFile(\"a/b\", \"a/b\"));\n\t\tindex.add(trash, writeTrashFile(\"a/c\", \"a/c\"));\n\t\tindex.add(trash, writeTrashFile(\"a=c\", \"a=c\"));\n\t\tindex.add(trash, writeTrashFile(\"a=d\", \"a=d\"));\n\n\t\tTree tree = new Tree(db);\n\t\t// got the hash id'd from the data using echo -n a.b|git hash-object -t blob --stdin\n\t\ttree.addFile(\"a.b\").setId(new ObjectId(\"f6f28df96c2b40c951164286e08be7c38ec74851\"));\n\t\ttree.addFile(\"a.c\").setId(new ObjectId(\"6bc0e647512d2a0bef4f26111e484dc87df7f5ca\"));\n\t\ttree.addFile(\"a/b.b/b\").setId(new ObjectId(\"8d840bd4e2f3a48ff417c8e927d94996849933fd\"));\n\t\ttree.addFile(\"a/b\").setId(new ObjectId(\"db89c972fc57862eae378f45b74aca228037d415\"));\n\t\ttree.addFile(\"a/c\").setId(new ObjectId(\"52ad142a008aeb39694bafff8e8f1be75ed7f007\"));\n\t\ttree.addFile(\"a=c\").setId(new ObjectId(\"06022365ddbd7fb126761319633bf73517770714\"));\n\t\ttree.addFile(\"a=d\").setId(new ObjectId(\"fa6414df3da87840700e9eeb7fc261dd77ccd5c2\"));\n\n\t\tTree tree3 = (Tree) tree.findTreeMember(\"a/b.b\");\n\t\ttree3.setId(new ObjectWriter(db).writeTree(tree3));\n\t\tTree tree2 = (Tree) tree.findTreeMember(\"a\");\n\t\ttree2.setId(new ObjectWriter(db).writeTree(tree2));\n\t\ttree.setId(new ObjectWriter(db).writeTree(tree));\n\n\t\tIndexDiff diff = new IndexDiff(tree, index);\n\t\tdiff.diff();\n\t\tassertEquals(0, diff.getChanged().size());\n\t\tassertEquals(0, diff.getAdded().size());\n\t\tassertEquals(0, diff.getRemoved().size());\n\t\tassertEquals(0, diff.getMissing().size());\n\t\tassertEquals(0, diff.getModified().size());\n\t}\n}\n"},{"id":"68990","messageId":"1203263746-2924-1-git-send-email-rogersoares@intelinet.com.br","threadId":"12146","inReplyTo":null,"subject":"[EGIT PATCH] Show diffs for changed files under a new or deleted directory.","fromName":"Roger C. Soares","fromEmail":"rogersoares@intelinet.com.br","sentAt":"2008-02-17T15:55:46Z","receivedAt":"2008-02-17T15:55:46Z","isPatch":true,"sender":{"key":"rogersoares@intelinet.com.br","avatar":null},"body":"When a directory is added or removed in a commit the files under it \nwere not being shown in the structure compare viewer. This fixes it by\nadding diff nodes for all the files under this directory.\n\nThis patch also fixes some files showing as being removed in the\nstructure compare when they were actually being added.\n\nSigned-off-by: Roger C. Soares <rogersoares@intelinet.com.br>\n---\nHi Robin,\n\nWhat is \"TODO: Git ordering\" supposed to change?\n\nPlease evaluate.\n\n[]s,\nRoger.\n\n\n .../GitCompareFileRevisionEditorInput.java         |   79 +++++++++++++++++---\n 1 files changed, 68 insertions(+), 11 deletions(-)\n\ndiff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/GitCompareFileRevisionEditorInput.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/GitCompareFileRevisionEditorInput.java\nindex d3bc92a..d72093b 100644\n--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/GitCompareFileRevisionEditorInput.java\n+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/GitCompareFileRevisionEditorInput.java\n@@ -122,30 +122,65 @@ public class GitCompareFileRevisionEditorInput extends CompareEditorInput {\n \t\t\twhile (li<lc.length && ri<rc.length) {\n \t\t\t\tITypedElement ln = lc[li];\n \t\t\t\tITypedElement rn = rc[ri];\n+\t\t\t\tint compareTo = ln.getName().compareTo(rn.getName());\n \t\t\t\t// TODO: Git ordering!\n-\t\t\t\tif (ln.getName().compareTo(rn.getName()) < 0) {\n-\t\t\t\t\tdiffNode.add(new DiffNode(Differencer.ADDITION,null, ln, null));\n-\t\t\t\t\t++li;\n-\t\t\t\t}\n-\t\t\t\tif (ln.getName().compareTo(rn.getName()) > 0) {\n-\t\t\t\t\tdiffNode.add(new DiffNode(Differencer.DELETION,null, null, rn));\n-\t\t\t\t\t++ri;\n-\t\t\t\t}\n-\t\t\t\tif (ln.getName().compareTo(rn.getName()) == 0) {\n+\t\t\t\tif (compareTo == 0) {\n \t\t\t\t\tif (!ln.equals(rn))\n \t\t\t\t\t\tdiffNode.add(compare(ln,rn));\n \t\t\t\t\t++li;\n \t\t\t\t\t++ri;\n+\t\t\t\t} else if (compareTo < 0) {\n+\t\t\t\t\tDiffNode childDiffNode = new DiffNode(Differencer.ADDITION, null, ln, null);\n+\t\t\t\t\tdiffNode.add(childDiffNode);\n+\t\t\t\t\tif (ln.getType().equals(ITypedElement.FOLDER_TYPE)) {\n+\t\t\t\t\t\tITypedElement[] children = (ITypedElement[])((IStructureComparator)ln).getChildren();\n+\t\t\t\t\t\tif(children != null && children.length > 0) {\n+\t\t\t\t\t\t\tfor (ITypedElement child : children) {\n+\t\t\t\t\t\t\t\tchildDiffNode.add(addDirectoryFiles(child, Differencer.ADDITION));\n+\t\t\t\t\t\t\t}\n+\t\t\t\t\t\t}\n+\t\t\t\t\t}\n+\t\t\t\t\t++li;\n+\t\t\t\t} else {\n+\t\t\t\t\tDiffNode childDiffNode = new DiffNode(Differencer.DELETION, null, null, rn);\n+\t\t\t\t\tdiffNode.add(childDiffNode);\n+\t\t\t\t\tif (rn.getType().equals(ITypedElement.FOLDER_TYPE)) {\n+\t\t\t\t\t\tITypedElement[] children = (ITypedElement[])((IStructureComparator)rn).getChildren();\n+\t\t\t\t\t\tif(children != null && children.length > 0) {\n+\t\t\t\t\t\t\tfor (ITypedElement child : children) {\n+\t\t\t\t\t\t\t\tchildDiffNode.add(addDirectoryFiles(child, Differencer.DELETION));\n+\t\t\t\t\t\t\t}\n+\t\t\t\t\t\t}\n+\t\t\t\t\t}\n+\t\t\t\t\t++ri;\n \t\t\t\t}\n \t\t\t}\n \t\t\twhile (li<lc.length) {\n \t\t\t\tITypedElement ln = lc[li];\n-\t\t\t\tdiffNode.add(new DiffNode(Differencer.ADDITION,null, ln, null));\n+\t\t\t\tDiffNode childDiffNode = new DiffNode(Differencer.ADDITION, null, ln, null);\n+\t\t\t\tdiffNode.add(childDiffNode);\n+\t\t\t\tif (ln.getType().equals(ITypedElement.FOLDER_TYPE)) {\n+\t\t\t\t\tITypedElement[] children = (ITypedElement[])((IStructureComparator)ln).getChildren();\n+\t\t\t\t\tif(children != null && children.length > 0) {\n+\t\t\t\t\t\tfor (ITypedElement child : children) {\n+\t\t\t\t\t\t\tchildDiffNode.add(addDirectoryFiles(child, Differencer.ADDITION));\n+\t\t\t\t\t\t}\n+\t\t\t\t\t}\n+\t\t\t\t}\n \t\t\t\t++li;\n \t\t\t}\n \t\t\twhile (ri<rc.length) {\n \t\t\t\tITypedElement rn = rc[ri];\n-\t\t\t\tdiffNode.add(new DiffNode(Differencer.ADDITION,null, null, rn));\n+\t\t\t\tDiffNode childDiffNode = new DiffNode(Differencer.DELETION, null, null, rn);\n+\t\t\t\tdiffNode.add(childDiffNode);\n+\t\t\t\tif (rn.getType().equals(ITypedElement.FOLDER_TYPE)) {\n+\t\t\t\t\tITypedElement[] children = (ITypedElement[])((IStructureComparator)rn).getChildren();\n+\t\t\t\t\tif(children != null && children.length > 0) {\n+\t\t\t\t\t\tfor (ITypedElement child : children) {\n+\t\t\t\t\t\t\tchildDiffNode.add(addDirectoryFiles(child, Differencer.DELETION));\n+\t\t\t\t\t\t}\n+\t\t\t\t\t}\n+\t\t\t\t}\n \t\t\t\t++ri;\n \t\t\t}\n \t\t\treturn diffNode;\n@@ -154,6 +189,28 @@ public class GitCompareFileRevisionEditorInput extends CompareEditorInput {\n \t\t}\n \t}\n \n+\tprivate DiffNode addDirectoryFiles(ITypedElement elem, int diffType) {\n+\t\tITypedElement l = null;\n+\t\tITypedElement r = null;\n+\t\tif (diffType == Differencer.DELETION) {\n+\t\t\tr = elem;\n+\t\t} else {\n+\t\t\tl = elem;\n+\t\t}\n+\n+\t\tif (elem.getType().equals(ITypedElement.FOLDER_TYPE)) {\n+\t\t\tDiffNode diffNode = null;\n+\t\t\tdiffNode = new DiffNode(null,Differencer.CHANGE,null,l,r);\n+\t\t\tITypedElement[] children = (ITypedElement[])((IStructureComparator)elem).getChildren();\n+\t\t\tfor (ITypedElement child : children) {\n+\t\t\t\tdiffNode.add(addDirectoryFiles(child, diffType));\n+\t\t\t}\n+\t\t\treturn diffNode;\n+\t\t} else {\n+\t\t\treturn new DiffNode(diffType, null, l, r);\n+\t\t}\n+\t}\n+\n \tprivate void initLabels(ICompareInput input) {\n \t\tCompareConfiguration cc = getCompareConfiguration();\n \t\tif(left != null && left instanceof GitResourceNode) {\n-- \n1.5.3.8\n"},{"id":"69086","messageId":"47B9110E.90707@intelinet.com.br","threadId":"12146","inReplyTo":"200802171605.48250.robin.rosenberg@dewire.com","subject":"Re: [EGIT PATCH] Show diffs for changed files under a new or deleted directory.","fromName":"Roger C. Soares","fromEmail":"rogersoares@intelinet.com.br","sentAt":"2008-02-18T05:01:02Z","receivedAt":"2008-02-18T05:01:02Z","isPatch":true,"sender":{"key":"rogersoares@intelinet.com.br","avatar":null},"body":"Hi Robin,\n\nRobin Rosenberg escreveu:\n> i.e. the tree 'a' is sorted as if there is a '/' at then end. For full path\n> names that is no problem and it is actually trivial, but when you order\n> things by partial names it is much messier and quite hard to test also. There\n> is a bug in the IndexTreeWalker and probably the differenser and you found it.\n> It seems most likely you fixed it for that particular case, but it could still \n> be broken for another.\n>   \nThanks for your explanation, it makes more sense now.\n\nI didn't look in detail yet the parts where we need to interact with the \nindex and the workspace, but just thinking about it now. If we are using \nan algorithm which requires that both trees are sorted using the same \norder, and one of them can't be trusted to follow such order, them \nsorting the trees the way we want looks like a simple solution...\n\nI intend to go back to this after I finish some more patches I'm working \non to add more info into the revision detail viewer. So, lets go in \nsteps and look at one distinct thing at a time. My patch doesn't change \nsorting or ordering of things and isn't very complicated either, it just \nadds missing functionality.\n\nSo, if in the old tree we had:\n\nfile1\n\nand in the new tree we have:\n\nfile1\ndir1/file2\ndir1/file3\n\nThe compare viewer must show:\n\n+ dir1/file2\n+ dir1/file3\n\nThe current code only notices that dir1 was added and shows:\n\n+ dir1\n\nwhich confuses people reviewing code because they can't see that file2 \nand file3 were added. What the patch does is take the next step and, if \nthe added or removed node is a directory and it has children, add all \nthe children to the compare viewer using the same Differencer from the \ndirectory.\n\nThe Differencer I changed was actually a bug. If you say that the files \nleft in the left pane are Differencer.ADDITION, then the ones left on \nthe right pane _must_ be Differencer.DELETION. It just doesn't make \nsense to say that files not on the old tree but on the new tree are \naddition, and at the same time that files on the old tree but not on the \nnew tree are also addition.\n\nThere is another check that must be added. If in a commit I delete a \ndirectory and add a file with the same name of the directory and \nvice-versa. This case is still failing, it shows an alert with an empty \nmessage. But as I said, I intend to deal with it later, it is a more \nuncommon case and nobody here complained about it yet... :)\n\nI think it should be like this for all cases, even when comparing with \nthe index or the workspace, so if there is something else I'm missing \nplease let me know.\n\n\n> I'd love to see a unit test for your code since, even if it works, it is very easy\n> to break again.\n>   \nOk, I'll get a look on the test cases and probably write something when \nI get back into these compare issues. That if somebody else doesn't do \nit before me, of course :)\n\n[]s,\nRoger.\n"},{"id":"69091","messageId":"200802180744.57757.robin.rosenberg@dewire.com","threadId":"12146","inReplyTo":"47B9110E.90707@intelinet.com.br","subject":"Re: [EGIT PATCH] Show diffs for changed files under a new or deleted directory.","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg@dewire.com","sentAt":"2008-02-18T06:44:57Z","receivedAt":"2008-02-18T06:44:57Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"måndagen den 18 februari 2008 skrev du:\n> The Differencer I changed was actually a bug. If you say that the files \n> left in the left pane are Differencer.ADDITION, then the ones left on \n> the right pane _must_ be Differencer.DELETION. It just doesn't make \n> sense to say that files not on the old tree but on the new tree are \n> addition, and at the same time that files on the old tree but not on the \n> new tree are also addition.\nOk, I see. I'll test it a little and push soon.\n> > I'd love to see a unit test for your code since, even if it works, it is very easy\n> > to break again.\n> >   \n> Ok, I'll get a look on the test cases and probably write something when \n> I get back into these compare issues. That if somebody else doesn't do \n> it before me, of course :)\n\nNot very likely within a short time frame, though I want do the excersize. Unfortunately I have too many open branches right now to add yet another. The original author (cough, cough) didn't do it. I was so happy and pleased, at them time, to see it work at all so easiliy :) . I've written some tests for other functions, so I guess it's mostly about setting up some more infrastructure to make testing reasonably simple.\n\n-- robin\n"}]}