From 066b65d03d4e6a1f666917fcea78998f3d001873 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Mon, 18 Dec 2017 19:56:21 -0500 Subject: [PATCH] Set minimum number of commits for gitmerge in batch mode * admin/gitmerge.el (gitmerge-minimum-missing): New variable. (gitmerge): In batch mode, respect gitmerge-minimum-missing. --- admin/gitmerge.el | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/admin/gitmerge.el b/admin/gitmerge.el index ba9f2b8f808..4bc946e144b 100644 --- a/admin/gitmerge.el +++ b/admin/gitmerge.el @@ -63,6 +63,9 @@ bump version\\|Auto-commit")) "Regexp matching logs of revisions that might be skipped. `gitmerge-missing' will ask you if it should skip any matches.") +(defvar gitmerge-minimum-missing 10 + "Minimum number of missing commits to consider merging in batch mode.") + (defvar gitmerge-status-file (expand-file-name "gitmerge-status" user-emacs-directory) "File where missing commits will be saved between sessions.") @@ -567,6 +570,12 @@ Branch FROM will be prepended to the list." (setq gitmerge--from from) (when (null gitmerge--commits) (user-error "Nothing to merge")) + (and noninteractive + gitmerge-minimum-missing + (< (length gitmerge--commits) gitmerge-minimum-missing) + (user-error "Number of missing commits (%s) is less than %s" + (length gitmerge--commits) + gitmerge-minimum-missing)) (with-current-buffer (gitmerge-setup-log-buffer gitmerge--commits gitmerge--from) (goto-char (point-min)) -- 2.39.2