private static void createIntoClipboard(@NotNull Project project,
                                          @NotNull List<? extends Change> changes,
                                          @Nullable String commitMessage,
                                          @NotNull PatchBuilder patchBuilder,
                                          @NotNull CommitContext commitContext) {
    ProgressManager.getInstance().runProcessWithProgressSynchronously(() -> {
      try {
        Path baseDir = PatchWriter.calculateBaseDirForWritingPatch(project, changes);
        CreatePatchCommitExecutor.writePatchToClipboard(project, baseDir, changes, commitMessage, false, false,
                                                        patchBuilder, commitContext);
      }
      catch (IOException | VcsException exception) {
        LOG.warn("Can't create patch", exception);
        VcsNotifier.getInstance(project).notifyWeakError(PATCH_CREATION_FAILED,
                                                         VcsBundle.message("patch.creation.failed"),
                                                         exception.getMessage());
      }
    }, VcsBundle.message("create.patch.commit.action.progress"), true, project);
  }
private static void createIntoClipboard(@NotNull Project project,
                                          @NotNull List<? extends Change> changes,
                                          @Nullable String commitMessage,
                                          @NotNull PatchBuilder patchBuilder,
                                          @NotNull CommitContext commitContext)