Source:
public ChangelogCommand changelog() { return new ChangelogCommand() { public static final String RAW = "commit %H%ntree %T%nparent %P%nauthor %aN <%aE> %ai%ncommitter %cN <%cE> %ci%n%n%w(76,4,4)%s%n%n%b"; final List<String> revs = new ArrayList<>(); Integer n = null; Writer out = null; boolean listMerges = false; public ChangelogCommand excludes(String rev) { revs.add(sanitize('^'+rev)); return this; } public ChangelogCommand excludes(ObjectId rev) { return excludes(rev.name()); } public ChangelogCommand includes(String rev) { revs.add(rev); return this; } public ChangelogCommand includes(ObjectId rev) { return includes(rev.name()); } public ChangelogCommand to(Writer w) { this.out = w; return this; } public ChangelogCommand max(int n) { this.n = n; return this; } public void abort() { } public void execute() throws GitException, InterruptedException { ArgumentListBuilder args = new ArgumentListBuilder(gitExe, "whatchanged", "--no-abbrev", "-M"); args.add("--format="+RAW); if (n!=null) args.add("-n").add(n); if (listMerges) args.add("-m"); for (String rev : this.revs) args.add(rev); if (out==null) throw new IllegalStateException(); try (WriterOutputStream w = new WriterOutputStream(out, Charset.forName("UTF-8"))) { if (launcher.launch().cmds(args).envs(environment).stdout(w).stderr(listener.getLogger()).pwd(workspace).join() != 0) throw new GitException("Error launching git whatchanged"); } catch (IOException e) { throw new GitException("Error launching git whatchanged",e); } } public void listMerges(boolean flag) { listMerges = flag; } }; }

Target:
public ChangelogCommand changelog() { return new ChangelogCommand() { public static final String RAW = "commit %H%ntree %T%nparent %P%nauthor %aN <%aE> %ai%ncommitter %cN <%cE> %ci%n%n%w(0,4,4)%B"; private final List<String> revs = new ArrayList<>(); private Integer n = null; private Writer out = null; private boolean listMerges = false; @Override public ChangelogCommand excludes(String rev) { revs.add(sanitize('^'+rev)); return this; } @Override public ChangelogCommand excludes(ObjectId rev) { return excludes(rev.name()); } @Override public ChangelogCommand includes(String rev) { revs.add(rev); return this; } @Override public ChangelogCommand includes(ObjectId rev) { return includes(rev.name()); } @Override public ChangelogCommand to(Writer w) { this.out = w; return this; } @Override public ChangelogCommand max(int n) { this.n = n; return this; } @Override public void abort() { } @Override public void execute() throws GitException, InterruptedException { ArgumentListBuilder args = new ArgumentListBuilder(gitExe, "whatchanged", "--no-abbrev", "-M"); args.add("--format="+RAW); if (n!=null) args.add("-n").add(n); if (listMerges) args.add("-m"); for (String rev : this.revs) args.add(rev); if (out==null) throw new IllegalStateException(); try (WriterOutputStream w = new WriterOutputStream(out, Charset.forName("UTF-8"))) { if (launcher.launch().cmds(args).envs(environment).stdout(w).stderr(listener.getLogger()).pwd(workspace).join() != 0) throw new GitException("Error: " + args + " in " + workspace); } catch (IOException e) { throw new GitException("Error: " + args + " in " + workspace, e); } } public ChangelogCommand listMerges(boolean flag) { listMerges = flag; return this; } }; }