{"thread":{"id":"11461","subject":"[EGIT PATCH] Remove directory entries from Structure Compare view.","startedAt":"2008-01-04T02:11:17Z","lastAt":"2008-01-05T01:11:59Z","messageCount":2,"participants":["Roger C. Soares","Robin Rosenberg"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"64406","messageId":"200801040011.17934.rogersoares@intelinet.com.br","threadId":"11461","inReplyTo":null,"subject":"[EGIT PATCH] Remove directory entries from Structure Compare view.","fromName":"Roger C. Soares","fromEmail":"rogersoares@intelinet.com.br","sentAt":"2008-01-04T02:11:17Z","receivedAt":"2008-01-04T02:11:17Z","isPatch":true,"sender":{"key":"rogersoares@intelinet.com.br","avatar":null},"body":"Date: Wed, 2 Jan 2008 22:51:33 -0200\n\nSigned-off-by: Roger C. Soares <rogersoares@intelinet.com.br>\n---\nPlease evaluate.\n\n .../GitCompareFileRevisionEditorInput.java         |   25 +++++++++++++++++++-\n 1 files changed, 24 insertions(+), 1 deletions(-)\n\ndiff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/GitCompareFileRevisionEditorInput.java \nb/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/GitCompareFileRevisionEditorInput.java\nindex 82cd205..eaba1fa 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@@ -21,6 +21,7 @@ import org.eclipse.compare.ITypedElement;\n import org.eclipse.compare.structuremergeviewer.DiffNode;\n import org.eclipse.compare.structuremergeviewer.Differencer;\n import org.eclipse.compare.structuremergeviewer.ICompareInput;\n+import org.eclipse.compare.structuremergeviewer.IDiffElement;\n import org.eclipse.compare.structuremergeviewer.IStructureComparator;\n import org.eclipse.core.resources.IFile;\n import org.eclipse.core.resources.IFileState;\n@@ -299,7 +300,29 @@ public class GitCompareFileRevisionEditorInput extends CompareEditorInput {\n \t\tensureContentsCached(getLeftRevision(), getRightRevision(), monitor);\n \t\tinitLabels(input);\n \t\tsetTitle(NLS.bind(TeamUIMessages.SyncInfoCompareInput_title, new String[] { input.getName() }));\n-\t\treturn input;\n+\n+\t\t// The compare editor (Structure Compare) will show the diff filenames\n+\t\t// with their project relative path. So, no need to also show directory entries.\n+\t\tDiffNode flatDiffNode = new DiffNode(null,Differencer.CHANGE,null,left,right);\n+\t\tflatDiffView(flatDiffNode, (DiffNode) input);\n+\n+\t\treturn flatDiffNode;\n+\t}\n+\n+\tprivate void flatDiffView(DiffNode rootNode, DiffNode currentNode) {\n+\t\tif(currentNode != null) {\n+\t\t\tIDiffElement[] dElems = currentNode.getChildren();\n+\t\t\tif(dElems != null) {\n+\t\t\t\tfor(IDiffElement dElem : dElems) {\n+\t\t\t\t\tDiffNode dNode = (DiffNode) dElem;\n+\t\t\t\t\tif(dNode.getChildren() != null && dNode.getChildren().length > 0) {\n+\t\t\t\t\t\tflatDiffView(rootNode, dNode);\n+\t\t\t\t\t} else {\n+\t\t\t\t\t\trootNode.add(dNode);\n+\t\t\t\t\t}\n+\t\t\t\t}\n+\t\t\t}\n+\t\t}\n \t}\n \n }\n-- \n1.5.3.7\n"},{"id":"64485","messageId":"200801050212.03732.robin.rosenberg.lists@dewire.com","threadId":"11461","inReplyTo":"200801040011.17934.rogersoares@intelinet.com.br","subject":"Re: [EGIT PATCH] Remove directory entries from Structure Compare view.","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2008-01-05T01:11:59Z","receivedAt":"2008-01-05T01:11:59Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"fredag 04 januari 2008 skrev Roger C. Soares:\n> Date: Wed, 2 Jan 2008 22:51:33 -0200\n> \n> Signed-off-by: Roger C. Soares <rogersoares@intelinet.com.br>\n> ---\n> Please evaluate.\n\nVery much I like it. I will apply it. My guess is some people want\nto make this an option in the compare viewer, but we can add that later.\n\n-- robin\n"}]}