In Bitbucket 8.8.2 how to use com.atlassian.bitbucket.scm interface ScmCommandFactory?
I want to use diff method as listed on javadoc but cannot find a way to use the interface. Class which implement this interface is not documented. I wan to get to diff between 2 commits and also run git log but SDK documentation is not clear. Earlier version have GitScmCommandBuilder to run GIT commands.
diff(DiffCommandParameters parameters, DiffContentCallback callback)
Here’s a snippet from one of my plugins (Control Freak) - works fine on Bitbucket 8.15.0:
Repository r = // obtain this somehow
SingleLineOutputHandler h = new SingleLineOutputHandler();
GitScmCommandBuilder revListBuilder = gitBuilderFactory.builder(r).command("rev-list");
revListBuilder.argument("--topo-order");
revListBuilder.argument("--pretty=%H,%P%x04%aN <%aE>%x02%cN <%cE>");
revListBuilder.argument("--not");
revListBuilder.argument("--branches");
revListBuilder.argument("--tags");
GitCommand<String> revsCmd = revListBuilder.build(h);
String newPushedCommits = revsCmd.call();