private @Nullable List<? extends GraphCommit<Integer>> join(@NotNull List<? extends GraphCommit<Integer>> recentCommits,
                                                                @NotNull List<? extends GraphCommit<Integer>> fullLog,
                                                                @NotNull Map<VirtualFile, CompressedRefs> previousRefs,
                                                                @NotNull Map<VirtualFile, CompressedRefs> newRefs) {
      if (fullLog.isEmpty()) return recentCommits;

      return computeWithSpan(myTracer, LogData.JoiningNewAndOldCommits.getName(), span -> {
        Collection<Integer> prevRefIndices = previousRefs
          .values()
          .stream()
          .flatMap(refs -> refs.getCommits().stream())
          .collect(Collectors.toSet());

        Collection<Integer> newRefIndices = newRefs
          .values()
          .stream()
          .flatMap(refs -> refs.getCommits().stream())
          .collect(Collectors.toSet());

        try {
          return new VcsLogJoiner<Integer, GraphCommit<Integer>>().addCommits(fullLog, prevRefIndices,
                                                                              recentCommits,
                                                                              newRefIndices).first;
        }
        catch (VcsLogRefreshNotEnoughDataException e) {
          // valid case: e.g. another developer merged a long-developed branch, or we just didn't pull for a long time
          LOG.info(e);
        }
        catch (IllegalStateException e) {
          // it happens from time to time, but we don't know why, and can hardly debug it.
          LOG.info(e);
        }
        return null;
      });
    }
private @Nullable List<? extends GraphCommit<Integer>> join(@NotNull List<? extends GraphCommit<Integer>> recentCommits,
                                                                @NotNull List<? extends GraphCommit<Integer>> fullLog,
                                                                @NotNull Map<VirtualFile, CompressedRefs> previousRefs,
                                                                @NotNull Map<VirtualFile, CompressedRefs> newRefs)