Ok, I'll move it into a new class RevWalkUtil (or RevWalkUtils? (both naming conventions seem to be used in jgit)).

Should the new method then have the following signature?:

  public static long count(final RevWalk walk, final RevCommit start, final RevCommit end)

Should the caller be responsible for doing reset() or should that be done inside the method?