void (@NotNull AnActionEvent e) { Project project = e.getProject(); VcsLogCommitSelection selection = e.getData(VcsLogDataKeys.VCS_LOG_COMMIT_SELECTION); if (project == null || selection == null) { e.getPresentation().setEnabledAndVisible(false); return; } MultiMap<Repo, Hash> grouped = groupFirstPackOfCommits(project, selection); if (grouped == null) { e.getPresentation().setEnabledAndVisible(false); } else { e.getPresentation().setVisible(isVisible(project, grouped)); e.getPresentation().setEnabled(!grouped.isEmpty() && isEnabled(grouped)); } }