diff --git a/.eclipse_iplog b/.eclipse_iplog index c7bf1b48e9f095aa73e7fb7c104ec8cf151306d1..b6d6e9bbb1cc70aec81c997f5e5105f64252d855 100644 --- a/.eclipse_iplog +++ b/.eclipse_iplog @@ -2,6 +2,8 @@ name = JGit license = Eclipse Distribution License v1.0 + skipCommit = 1a6964c8274c50f0253db75f010d78ef0e739343 + [CQ "3454"] description = args4j Version: 2.0.12 license = BSD License diff --git a/org.eclipse.jgit.iplog/src/org/eclipse/jgit/iplog/IpLogGenerator.java b/org.eclipse.jgit.iplog/src/org/eclipse/jgit/iplog/IpLogGenerator.java index 417c5065504200360664051a96504e1f68069b27..d8956afe12744c1a416d96e202861e4582f4ae58 100644 --- a/org.eclipse.jgit.iplog/src/org/eclipse/jgit/iplog/IpLogGenerator.java +++ b/org.eclipse.jgit.iplog/src/org/eclipse/jgit/iplog/IpLogGenerator.java @@ -130,6 +130,9 @@ public class IpLogGenerator { /** Root commits which were scanned to gather project data. */ private final Set<RevCommit> commits = new HashSet<RevCommit>(); + /** The meta file we loaded to bootstrap our definitions. */ + private IpLogMeta meta; + private String characterEncoding = "UTF-8"; private Repository db; @@ -185,7 +188,7 @@ public void scan(Repository repo, RevCommit startCommit, String version) loadEclipseIpLog(version, c); loadCommitters(repo); - scanProjectCommits(c); + scanProjectCommits(meta.getProjects().get(0), c); commits.add(c); } finally { WindowCursor.release(curs); @@ -202,7 +205,7 @@ private void loadEclipseIpLog(String version, RevCommit commit) if (log == null) return; - IpLogMeta meta = new IpLogMeta(); + meta = new IpLogMeta(); try { meta.loadFrom(new BlobBasedConfig(null, db, log.getObjectId(0))); } catch (ConfigInvalidException e) { @@ -277,12 +280,17 @@ private Date parseDate(SimpleDateFormat dt, String value) } } - private void scanProjectCommits(RevCommit start) throws IOException { + private void scanProjectCommits(Project proj, RevCommit start) + throws IOException { rw.reset(); rw.markStart(start); RevCommit commit; while ((commit = rw.next()) != null) { + if (proj.isSkippedCommit(commit)) { + continue; + } + final PersonIdent author = commit.getAuthorIdent(); final Date when = author.getWhen(); diff --git a/org.eclipse.jgit.iplog/src/org/eclipse/jgit/iplog/IpLogMeta.java b/org.eclipse.jgit.iplog/src/org/eclipse/jgit/iplog/IpLogMeta.java index 38b7d417b14bc24c36e0d035f212950f45f37554..d0a5279abb504af6ab31d0cb9ab0f9934a4a1967 100644 --- a/org.eclipse.jgit.iplog/src/org/eclipse/jgit/iplog/IpLogMeta.java +++ b/org.eclipse.jgit.iplog/src/org/eclipse/jgit/iplog/IpLogMeta.java @@ -59,6 +59,7 @@ import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.FileBasedConfig; import org.eclipse.jgit.lib.LockFile; +import org.eclipse.jgit.lib.ObjectId; /** * Manages the {@code .eclipse_iplog} file in a project. @@ -75,6 +76,8 @@ public class IpLogMeta { private static final String K_COMMENTS = "comments"; + private static final String K_SKIP_COMMIT = "skipCommit"; + private static final String K_LICENSE = "license"; private static final String K_DESCRIPTION = "description"; @@ -104,6 +107,8 @@ void loadFrom(Config cfg) { Project project = new Project(id, name); project.setComments(cfg.getString(S_PROJECT, id, K_COMMENTS)); + for (String c : cfg.getStringList(S_PROJECT, id, K_SKIP_COMMIT)) + project.addSkipCommit(ObjectId.fromString(c)); for (String license : cfg.getStringList(S_PROJECT, id, K_LICENSE)) project.addLicense(license); projects.add(project); diff --git a/org.eclipse.jgit.iplog/src/org/eclipse/jgit/iplog/Project.java b/org.eclipse.jgit.iplog/src/org/eclipse/jgit/iplog/Project.java index 6495d38ff5afe2793e27270008f809e9a33b4d6d..15b79cede50cc93a30d59bb812165e915e014d79 100644 --- a/org.eclipse.jgit.iplog/src/org/eclipse/jgit/iplog/Project.java +++ b/org.eclipse.jgit.iplog/src/org/eclipse/jgit/iplog/Project.java @@ -48,6 +48,10 @@ import java.util.Set; import java.util.TreeSet; +import org.eclipse.jgit.lib.AnyObjectId; +import org.eclipse.jgit.lib.ObjectId; +import org.eclipse.jgit.lib.ObjectIdSubclassMap; + /** Description of a project. */ class Project { /** Sorts projects by unique identities. */ @@ -65,6 +69,8 @@ public int compare(Project a, Project b) { private final Set<String> licenses = new TreeSet<String>(); + private final ObjectIdSubclassMap<ObjectId> skipCommits = new ObjectIdSubclassMap<ObjectId>(); + private String version; /** @@ -104,6 +110,14 @@ void addLicense(String licenseName) { licenses.add(licenseName); } + void addSkipCommit(AnyObjectId commit) { + skipCommits.add(commit.copy()); + } + + boolean isSkippedCommit(AnyObjectId commit) { + return skipCommits.contains(commit); + } + String getVersion() { return version; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdSubclassMap.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdSubclassMap.java index bd57c061b6188c791c8c7436e03585f66f2556dc..a0b6d0ed24af9b0d67cdd14b9e3736cb52132939 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdSubclassMap.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdSubclassMap.java @@ -97,6 +97,17 @@ public V get(final AnyObjectId toFind) { return null; } + /** + * Returns true if this map contains the specified object. + * + * @param toFind + * object to find. + * @return true if the mapping exists for this object; false otherwise. + */ + public boolean contains(final AnyObjectId toFind) { + return get(toFind) != null; + } + /** * Store an object for future lookup. * <p>