From: Glenn Morris Date: Tue, 19 Dec 2017 00:56:21 +0000 (-0500) Subject: Set minimum number of commits for gitmerge in batch mode X-Git-Tag: emacs-27.0.90~6005 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=066b65d03d4e6a1f666917fcea78998f3d001873;p=emacs.git 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. --- 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))