[PATCH] git.el: Only show completions from refs/heads, refs/remotes and refs/tags

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Otherwise it will pick up e.g. lots of irrelevant stuff from
refs/bisect, refs/stash or refs/patches (for StGit users).

Signed-off-by: David Kågedal <davidk@xxxxxxxxxxxxxx>
---
 contrib/emacs/git.el |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/contrib/emacs/git.el b/contrib/emacs/git.el
index feb229c..125e684 100644
--- a/contrib/emacs/git.el
+++ b/contrib/emacs/git.el
@@ -1388,7 +1388,10 @@ With a prefix arg, diff the marked files instead."
 (defun git-read-commit-name (prompt &optional default)
   "Ask for a commit name, with completion for local branch, remote branch and tag."
   (completing-read prompt
-                   (list* "HEAD" "ORIG_HEAD" "FETCH_HEAD" (mapcar #'car (git-for-each-ref)))
+                   (list* "HEAD" "ORIG_HEAD" "FETCH_HEAD"
+                          (mapcar #'car (git-for-each-ref "refs/heads"
+                                                          "refs/remotes"
+                                                          "refs/tags")))
 		   nil nil nil nil default))
 
 (defun git-checkout (branch &optional merge)
-- 
1.6.2.rc1.21.gda6d

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux