return not(since).add(until);
.not(repository.resolve("master")) .add(repository.resolve("remotes/origin/testbranch")) .call();
.not(repository.resolve("master")) .add(repository.resolve("remotes/origin/testbranch")) .call();
/** * Method description * * * @param logCommand * @param localId * @param remoteId * * @throws IOException */ @Override protected void prepareLogCommand(LogCommand logCommand, ObjectId localId, ObjectId remoteId) throws IOException { if (localId != null) { logCommand.not(localId); } logCommand.add(remoteId); }
/** * Method description * * * @param logCommand * @param localId * @param remoteId * * @throws IOException */ @Override protected void prepareLogCommand(LogCommand logCommand, ObjectId localId, ObjectId remoteId) throws IOException { logCommand.add(localId); if (remoteId != null) { logCommand.not(remoteId); } }
/** * Adds the range {@code since..until} * * @param since * @param until * @return {@code this} * @throws MissingObjectException * the commit supplied is not available from the object * database. This usually indicates the supplied commit is * invalid, but the reference was constructed during an earlier * invocation to {@link RevWalk#lookupCommit(AnyObjectId)}. * @throws IncorrectObjectTypeException * the object was not parsed yet and it was discovered during * parsing that it is not actually a commit. This usually * indicates the caller supplied a non-commit SHA-1 to * {@link RevWalk#lookupCommit(AnyObjectId)}. * @throws JGitInternalException * a low-level exception of JGit has occurred. The original * exception can be retrieved by calling * {@link Exception#getCause()}. Expect only * {@code IOException's} to be wrapped. Subclasses of * {@link IOException} (e.g. {@link MissingObjectException}) are * typically not wrapped here but thrown as original exception */ public LogCommand addRange(AnyObjectId since, AnyObjectId until) throws MissingObjectException, IncorrectObjectTypeException { return not(since).add(until); }
return not(since).add(until);
public List<RevCommit> getCommitsInBranchOnly(Git git, String baseBranch, String otherBranch) throws IOException, GitAPIException { Repository repository = git.getRepository(); Iterable<RevCommit> rawCommitsOnlyInPRbranch = git.log() .not(repository.resolve(baseBranch)) .add(repository.resolve(otherBranch)) .call(); return StreamSupport.stream(rawCommitsOnlyInPRbranch.spliterator(), false).collect(toList()); }
public List<RevCommit> getCommitsOnWhichBranchIsLateComparedToBaseBranch(Git git, PullRequest pr) throws IOException, GitAPIException { Repository repository = git.getRepository(); Iterable<RevCommit> rawCommitsInDefaultBranchButMissingInPRbranch = git.log() .not(repository.resolve("remotes/origin/" + pr.getBranchName())) .add(repository.resolve(pr.getBaseBranchName())) .call(); return StreamSupport.stream(rawCommitsInDefaultBranchButMissingInPRbranch.spliterator(), false).collect(toList()); }
log.not(oldId);
log.not(oldId);