From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tom Tromey Newsgroups: gmane.emacs.bugs Subject: bug#25710: Acknowledgement (25.1.91; vc-retrieve-tag does not offer branch namd completion) Date: Sat, 04 Mar 2017 11:06:30 -0700 Message-ID: <8760jokjbt.fsf@tromey.com> References: <87a89p1yaz.fsf@tromey.com> <87r331zcqd.fsf@tromey.com> <8a4466fb-af60-785b-ffdd-563f2b0248d3@yandex.ru> <87inoczdun.fsf@tromey.com> <93d9799f-955c-0451-55a0-3595ad26dc96@yandex.ru> <87wpcsxe96.fsf@tromey.com> <87h93txxtm.fsf@tromey.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1488650835 9439 195.159.176.226 (4 Mar 2017 18:07:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 4 Mar 2017 18:07:15 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) Cc: Tom Tromey , 25710@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Mar 04 19:07:08 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ckE5C-0001RE-Dx for geb-bug-gnu-emacs@m.gmane.org; Sat, 04 Mar 2017 19:07:06 +0100 Original-Received: from localhost ([::1]:36171 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ckE5H-0000no-3R for geb-bug-gnu-emacs@m.gmane.org; Sat, 04 Mar 2017 13:07:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51112) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ckE5B-0000nh-9p for bug-gnu-emacs@gnu.org; Sat, 04 Mar 2017 13:07:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ckE58-0006H2-36 for bug-gnu-emacs@gnu.org; Sat, 04 Mar 2017 13:07:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:42035) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ckE57-0006Gy-VH for bug-gnu-emacs@gnu.org; Sat, 04 Mar 2017 13:07:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ckE57-0002tb-OH for bug-gnu-emacs@gnu.org; Sat, 04 Mar 2017 13:07:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Tom Tromey Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 04 Mar 2017 18:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25710 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25710-submit@debbugs.gnu.org id=B25710.148865080811110 (code B ref 25710); Sat, 04 Mar 2017 18:07:01 +0000 Original-Received: (at 25710) by debbugs.gnu.org; 4 Mar 2017 18:06:48 +0000 Original-Received: from localhost ([127.0.0.1]:40234 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ckE4u-0002t8-2h for submit@debbugs.gnu.org; Sat, 04 Mar 2017 13:06:48 -0500 Original-Received: from gproxy9-pub.mail.unifiedlayer.com ([69.89.20.122]:36166 helo=gproxy9.mail.unifiedlayer.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ckE4s-0002su-3s for 25710@debbugs.gnu.org; Sat, 04 Mar 2017 13:06:46 -0500 Original-Received: from CMOut01 (unknown [10.0.90.82]) by gproxy9.mail.unifiedlayer.com (Postfix) with ESMTP id E35521E08F8 for <25710@debbugs.gnu.org>; Sat, 4 Mar 2017 11:06:36 -0700 (MST) Original-Received: from box522.bluehost.com ([74.220.219.122]) by CMOut01 with id ru6X1u00L2f2jeq01u6ad4; Sat, 04 Mar 2017 11:06:36 -0700 X-Authority-Analysis: v=2.1 cv=U+QBU4bu c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=6Iz7jQTuP9IA:10 a=vaJtXVxTAAAA:8 a=P0_UZS9Lpsi0ntiITbsA:9 a=hCt-GehETBxEYQOojhlW:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Ib5nq2CTCVi8/UIWYvNR2Zeq6SXEBlDBSluNPeQk6nQ=; b=AwbiH5iEgnopDiViDmkUCvof6p 9zxOpBWygTF5aE0OTG3e1fCUSoTHw+Pv6wVLqvmYtf3zCErFQCtLMpM4I+EwjEzCWHzF8A9/KyqQu a5tVqcH56LrmGNID8WTxdoH9N; Original-Received: from 71-218-43-111.hlrn.qwest.net ([71.218.43.111]:52102 helo=bapiya) by box522.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87) (envelope-from ) id 1ckE4d-0000zF-50; Sat, 04 Mar 2017 11:06:31 -0700 X-Attribution: Tom In-Reply-To: (Dmitry Gutov's message of "Mon, 20 Feb 2017 00:13:26 +0200") X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box522.bluehost.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 71.218.43.111 X-Exim-ID: 1ckE4d-0000zF-50 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 71-218-43-111.hlrn.qwest.net (bapiya) [71.218.43.111]:52102 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTIyLmJsdWVob3N0LmNvbQ== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:130195 Archived-At: >>>>> "Dmitry" == Dmitry Gutov writes: Dmitry> Will it change how vc-git-revision-completion-table works, Dmitry> across all commands? If so, I'm good with it. Yeah. What do you think of the appended? Tom diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 1a3f1bf..d20b10e 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -180,6 +180,16 @@ vc-git-log-output-coding-system :type '(coding-system :tag "Coding system to decode Git log output") :version "25.1") +(defcustom vc-git-revision-complete-only-branches nil + "Control whether tags are returned by revision completion for Git. + +When non-nil, only branches and remotes will be returned by +`vc-git-revision-completion-table'. This is used by various VC +commands when completing branch names. When nil, tags are also +included in the completions." + :type 'boolean + :version "26.1") + ;; History of Git commands. (defvar vc-git-history nil) @@ -1187,9 +1197,11 @@ vc-git-revision-table (with-temp-buffer (vc-git-command t nil nil "for-each-ref" "--format=%(refname)") (goto-char (point-min)) - (while (re-search-forward "^refs/\\(heads\\|tags\\|remotes\\)/\\(.*\\)$" - nil t) - (push (match-string 2) table))) + (let ((regexp (if vc-git-revision-complete-only-branches + "^refs/\\(heads\\|remotes\\)/\\(.*\\)$" + "^refs/\\(heads\\|tags\\|remotes\\)/\\(.*\\)$"))) + (while (re-search-forward regexp nil t) + (push (match-string 2) table)))) table)) (defun vc-git-revision-completion-table (files)