Source:
<code>public ChangelogCommand changelog() { return new ChangelogCommand() { <START> 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%n%n"; <END> private final List<String> revs = new ArrayList<>(); private Integer n = null; private Writer out = null; @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); 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); } } }; }</code><technical_language>Replaces #339</technical_language>

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; @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); 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); } } }; }