name = JGit
license = Eclipse Distribution License v1.0
+ skipCommit = 1a6964c8274c50f0253db75f010d78ef0e739343
+
[CQ "3454"]
description = args4j Version: 2.0.12
license = BSD License
/** 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;
loadEclipseIpLog(version, c);
loadCommitters(repo);
- scanProjectCommits(c);
+ scanProjectCommits(meta.getProjects().get(0), c);
commits.add(c);
} finally {
WindowCursor.release(curs);
if (log == null)
return;
- IpLogMeta meta = new IpLogMeta();
+ meta = new IpLogMeta();
try {
meta.loadFrom(new BlobBasedConfig(null, db, log.getObjectId(0)));
} catch (ConfigInvalidException e) {
}
}
- 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();
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.
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";
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);
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. */
private final Set<String> licenses = new TreeSet<String>();
+ private final ObjectIdSubclassMap<ObjectId> skipCommits = new ObjectIdSubclassMap<ObjectId>();
+
private String version;
/**
licenses.add(licenseName);
}
+ void addSkipCommit(AnyObjectId commit) {
+ skipCommits.add(commit.copy());
+ }
+
+ boolean isSkippedCommit(AnyObjectId commit) {
+ return skipCommits.contains(commit);
+ }
+
String getVersion() {
return version;
}
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>