public String serialize(GitCommit commit) { return commit.toJson(); }
private Collection<Commit> getCommits(String fromRev, String toRev) { LOG.info("Loading all commits between {} and {}", fromRev, toRev); LinkedList<Commit> commits = new LinkedList<>(); String commitToken = "@@commit@@"; String infoToken = "@@info@@"; // %H: commit hash // %ae: author email // %an: author name // %B: raw body (unwrapped subject and body) // %N: commit notes String log = logProvider.getLog(fromRev, toRev, "--pretty=format:%H" + infoToken + "%ae" + infoToken + "%an" + infoToken + "%B%N" + commitToken); for (String entry : log.split(commitToken)) { String[] entryParts = entry.split(infoToken); if (entryParts.length == 4) { String commitId = entryParts[0].trim(); String email = entryParts[1].trim(); String author = entryParts[2].trim(); String message = entryParts[3].trim(); LOG.info("Loaded commit - email: {}, author: {}, message (trimmed): {}", email, author, message.replaceAll("\n.*", "")); commits.add(new GitCommit(commitId, email, author, message)); } } return commits; } }
private Collection<Commit> getCommits(String fromRev, String toRev) { LOG.info("Loading all commits between {} and {}", fromRev, toRev); LinkedList<Commit> commits = new LinkedList<>(); String commitToken = "@@commit@@"; String infoToken = "@@info@@"; // %H: commit hash // %ae: author email // %an: author name // %B: raw body (unwrapped subject and body) // %N: commit notes String log = logProvider.getLog(fromRev, toRev, "--pretty=format:%H" + infoToken + "%ae" + infoToken + "%an" + infoToken + "%B%N" + commitToken); for (String entry : log.split(commitToken)) { String[] entryParts = entry.split(infoToken); if (entryParts.length == 4) { String commitId = entryParts[0].trim(); String email = entryParts[1].trim(); String author = entryParts[2].trim(); String message = entryParts[3].trim(); LOG.info("Loaded commit - email: {}, author: {}, message (trimmed): {}", email, author, message.replaceAll("\n.*", "")); commits.add(new GitCommit(commitId, email, author, message)); } } return commits; } }
private Collection<Commit> getCommits(String fromRev, String toRev) { LOG.info("Loading all commits between {} and {}", fromRev, toRev); LinkedList<Commit> commits = new LinkedList<Commit>(); String commitToken = "@@commit@@"; String infoToken = "@@info@@"; // %H: commit hash // %ae: author email // %an: author name // %B: raw body (unwrapped subject and body) // %N: commit notes String log = logProvider.getLog(fromRev, toRev, "--pretty=format:%H" + infoToken + "%ae" + infoToken + "%an" + infoToken + "%B%N" + commitToken); for (String entry : log.split(commitToken)) { String[] entryParts = entry.split(infoToken); if (entryParts.length == 4) { String commitId = entryParts[0].trim(); String email = entryParts[1].trim(); String author = entryParts[2].trim(); String message = entryParts[3].trim(); LOG.info("Loaded commit - email: {}, author: {}, message (trimmed): {}", email, author, message.replaceAll("\n.*", "")); commits.add(new GitCommit(commitId, email, author, message)); } } return commits; } }
public String serialize(GitCommit commit) { return commit.toJson(); }
public GitCommit deserialize(JsonObject jsonObject) { final String commitId = jsonObject.getString("commitId"); final String email = jsonObject.getString("email"); final String author = jsonObject.getString("author"); final String message = jsonObject.getString("message"); return new GitCommit(commitId, email, author, message); } }
public String serialize(GitCommit commit) { return commit.toJson(); }
public GitCommit deserialize(JsonObject jsonObject) { final String commitId = jsonObject.getString("commitId"); final String email = jsonObject.getString("email"); final String author = jsonObject.getString("author"); final String message = jsonObject.getString("message"); return new GitCommit(commitId, email, author, message); } }
@Override public void toJson(Writer writable) throws IOException { writable.append(toJson()); }
public GitCommit deserialize(JsonObject jsonObject) { final String commitId = jsonObject.getString("commitId"); final String email = jsonObject.getString("email"); final String author = jsonObject.getString("author"); final String message = jsonObject.getString("message"); return new GitCommit(commitId, email, author, message); } }
@Override public void toJson(Writer writable) throws IOException { writable.append(toJson()); }
@Override public void toJson(Writer writable) throws IOException { writable.append(toJson()); }