aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/vc/vc-git.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/vc/vc-git.el')
-rw-r--r--lisp/vc/vc-git.el18
1 files changed, 15 insertions, 3 deletions
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 78a2fa08795..84aeb0a1105 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -210,6 +210,16 @@ toggle display of the entire list."
210 widget)))) 210 widget))))
211 :version "27.1") 211 :version "27.1")
212 212
213(defcustom vc-git-revision-complete-only-branches nil
214 "Control whether tags are returned by revision completion for Git.
215
216When non-nil, only branches and remotes will be returned by
217`vc-git-revision-completion-table'. This is used by various VC
218commands when completing branch names. When nil, tags are also
219included in the completions."
220 :type 'boolean
221 :version "28.1")
222
213;; History of Git commands. 223;; History of Git commands.
214(defvar vc-git-history nil) 224(defvar vc-git-history nil)
215 225
@@ -1415,9 +1425,11 @@ This requires git 1.8.4 or later, for the \"-L\" option of \"git log\"."
1415 (with-temp-buffer 1425 (with-temp-buffer
1416 (vc-git-command t nil nil "for-each-ref" "--format=%(refname)") 1426 (vc-git-command t nil nil "for-each-ref" "--format=%(refname)")
1417 (goto-char (point-min)) 1427 (goto-char (point-min))
1418 (while (re-search-forward "^refs/\\(heads\\|tags\\|remotes\\)/\\(.*\\)$" 1428 (let ((regexp (if vc-git-revision-complete-only-branches
1419 nil t) 1429 "^refs/\\(heads\\|remotes\\)/\\(.*\\)$"
1420 (push (match-string 2) table))) 1430 "^refs/\\(heads\\|tags\\|remotes\\)/\\(.*\\)$")))
1431 (while (re-search-forward regexp nil t)
1432 (push (match-string 2) table))))
1421 table)) 1433 table))
1422 1434
1423(defun vc-git-revision-completion-table (files) 1435(defun vc-git-revision-completion-table (files)