{"thread":{"id":"16619","subject":"[EGIT PATCH] Drop StGit support","startedAt":"2008-12-06T23:01:23Z","lastAt":"2008-12-08T16:18:45Z","messageCount":2,"participants":["Robin Rosenberg","Shawn O. Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"97285","messageId":"1228604483-30761-1-git-send-email-robin.rosenberg@dewire.com","threadId":"16619","inReplyTo":null,"subject":"[EGIT PATCH] Drop StGit support","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg@dewire.com","sentAt":"2008-12-06T23:01:23Z","receivedAt":"2008-12-06T23:01:23Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"It is slow and none of the jgit/egit developers use it.\n\nSigned-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>\n---\n .../internal/decorators/GitResourceDecorator.java  |   20 ++----\n .../src/org/spearce/jgit/lib/Repository.java       |   62 --------------------\n 2 files changed, 7 insertions(+), 75 deletions(-)\n\nThis applies on top of the close outputstream bugfix patch posted recently.\n\ndiff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitResourceDecorator.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitResourceDecorator.java\nindex 1055fcc..97a0311 100644\n--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitResourceDecorator.java\n+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitResourceDecorator.java\n@@ -322,19 +322,13 @@ public void decorate(final Object element, final IDecoration decoration) {\n \t\t\t\t\t\t\t\tRepository repo = mapped.getRepository();\n \t\t\t\t\t\t\t\ttry {\n \t\t\t\t\t\t\t\t\tString branch = repo.getBranch();\n-\t\t\t\t\t\t\t\t\tif (repo.isStGitMode()) {\n-\t\t\t\t\t\t\t\t\t\tString patch = repo.getPatch();\n-\t\t\t\t\t\t\t\t\t\tdecoration.addSuffix(\" [StGit \" + patch + \"@\" + branch\n-\t\t\t\t\t\t\t\t\t\t\t\t+ \"]\");\n-\t\t\t\t\t\t\t\t\t} else {\n-\t\t\t\t\t\t\t\t\t\tRepositoryState repositoryState = repo.getRepositoryState();\n-\t\t\t\t\t\t\t\t\t\tString statename;\n-\t\t\t\t\t\t\t\t\t\tif (repositoryState.equals(RepositoryState.SAFE))\n-\t\t\t\t\t\t\t\t\t\t\tstatename = \"\";\n-\t\t\t\t\t\t\t\t\t\telse\n-\t\t\t\t\t\t\t\t\t\t\tstatename = repositoryState.getDescription() + \" \";\n-\t\t\t\t\t\t\t\t\t\tdecoration.addSuffix(\" [Git \" + statename + \"@ \" + branch + \"]\");\n-\t\t\t\t\t\t\t\t\t}\n+\t\t\t\t\t\t\t\t\tRepositoryState repositoryState = repo.getRepositoryState();\n+\t\t\t\t\t\t\t\t\tString statename;\n+\t\t\t\t\t\t\t\t\tif (repositoryState.equals(RepositoryState.SAFE))\n+\t\t\t\t\t\t\t\t\t\tstatename = \"\";\n+\t\t\t\t\t\t\t\t\telse\n+\t\t\t\t\t\t\t\t\t\tstatename = repositoryState.getDescription() + \" \";\n+\t\t\t\t\t\t\t\t\tdecoration.addSuffix(\" [Git \" + statename + \"@ \" + branch + \"]\");\n \t\t\t\t\t\t\t\t} catch (IOException e) {\n \t\t\t\t\t\t\t\t\te.printStackTrace();\n \t\t\t\t\t\t\t\t\tdecoration.addSuffix(\" [Git ?]\");\ndiff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java b/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java\nindex da1494f..b63ef18 100644\n--- a/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java\n+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java\n@@ -58,7 +58,6 @@\n \n import org.spearce.jgit.errors.IncorrectObjectTypeException;\n import org.spearce.jgit.errors.RevisionSyntaxException;\n-import org.spearce.jgit.stgit.StGitPatch;\n import org.spearce.jgit.util.FS;\n \n /**\n@@ -988,67 +987,6 @@ public Ref peel(final Ref ref) {\n \t\treturn ret;\n \t}\n \n-\t/**\n-\t * @return true if HEAD points to a StGit patch.\n-\t */\n-\tpublic boolean isStGitMode() {\n-\t\tFile file = new File(getDirectory(), \"HEAD\");\n-\t\tBufferedReader reader = null;\n-\t\ttry {\n-\t\t\treader = new BufferedReader(new FileReader(file));\n-\t\t\tString string = reader.readLine();\n-\t\t\tif (!string.startsWith(\"ref: refs/heads/\"))\n-\t\t\t\treturn false;\n-\t\t\tString branch = string.substring(\"ref: refs/heads/\".length());\n-\t\t\tFile currentPatches = new File(new File(new File(getDirectory(),\n-\t\t\t\t\t\"patches\"), branch), \"applied\");\n-\t\t\tif (!currentPatches.exists())\n-\t\t\t\treturn false;\n-\t\t\tif (currentPatches.length() == 0)\n-\t\t\t\treturn false;\n-\t\t\treturn true;\n-\n-\t\t} catch (IOException e) {\n-\t\t\te.printStackTrace();\n-\t\t\treturn false;\n-\t\t} finally {\n-\t\t\ttry {\n-\t\t\t\tif (reader != null)\n-\t\t\t\t\treader.close();\n-\t\t\t} catch (IOException e1) {\n-\t\t\t\t// nothing to do here\n-\t\t\t}\n-\t\t}\n-\t}\n-\n-\t/**\n-\t * @return applied patches in a map indexed on current commit id\n-\t * @throws IOException\n-\t */\n-\tpublic Map<ObjectId,StGitPatch> getAppliedPatches() throws IOException {\n-\t\tMap<ObjectId,StGitPatch> ret = new HashMap<ObjectId,StGitPatch>();\n-\t\tif (isStGitMode()) {\n-\t\t\tFile patchDir = new File(new File(getDirectory(),\"patches\"),getBranch());\n-\t\t\tBufferedReader apr = new BufferedReader(new FileReader(new File(patchDir,\"applied\")));\n-\t\t\ttry {\n-\t\t\t\tfor (String patchName=apr.readLine(); patchName!=null; patchName=apr.readLine()) {\n-\t\t\t\t\tFile topFile = new File(new File(new File(patchDir,\"patches\"), patchName), \"top\");\n-\t\t\t\t\tBufferedReader tfr = new BufferedReader(new FileReader(topFile));\n-\t\t\t\t\ttry {\n-\t\t\t\t\t\tString objectId = tfr.readLine();\n-\t\t\t\t\t\tObjectId id = ObjectId.fromString(objectId);\n-\t\t\t\t\t\tret.put(id, new StGitPatch(patchName, id));\n-\t\t\t\t\t} finally {\n-\t\t\t\t\t\ttfr.close();\n-\t\t\t\t\t}\n-\t\t\t\t}\n-\t\t\t} finally {\n-\t\t\t\tapr.close();\n-\t\t\t}\n-\t\t}\n-\t\treturn ret;\n-\t}\n-\t\n \t/** Clean up stale caches */\n \tpublic void refreshFromDisk() {\n \t\trefs.clearCache();\n-- \n1.6.0.3.640.g6331a\n"},{"id":"97351","messageId":"20081208161845.GC31551@spearce.org","threadId":"16619","inReplyTo":"1228604483-30761-1-git-send-email-robin.rosenberg@dewire.com","subject":"Re: [EGIT PATCH] Drop StGit support","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-12-08T16:18:45Z","receivedAt":"2008-12-08T16:18:45Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Robin Rosenberg <robin.rosenberg@dewire.com> wrote:\n> It is slow and none of the jgit/egit developers use it.\n> \n> Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>\n\nThanks.  I also fixed up the MANIFEST.MF to not export stgit package,\nand removed the StGitPatch class as it isn't used anymore after\nthis was applied.  Both chagnes got squashed into this patch when\nI applied it.\n\n-- \nShawn.\n"}]}