about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDaniel Hahler <git@thequod.de>2017-04-09 17:18:23 +0200
committerDaniel Hahler <git@thequod.de>2017-04-23 22:27:38 +0200
commit4fa7c6aeccf19442e59740d388db5066cb30f3fc (patch)
tree7231c887645d8b7a3f2d6fdc96792f79a45c71b0
parent68466f327e15579939ff359464c42b2b966a7825 (diff)
downloadzsh-4fa7c6aeccf19442e59740d388db5066cb30f3fc.tar.gz
zsh-4fa7c6aeccf19442e59740d388db5066cb30f3fc.tar.xz
zsh-4fa7c6aeccf19442e59740d388db5066cb30f3fc.zip
40943: __git_recent_commits: prefer recent commit objects
Without this "commit to be amended" shows up before "recent commit object
name" with `git commit --fixup`, but the recent commit objects are the
most useful here.
-rw-r--r--ChangeLog5
-rw-r--r--Completion/Unix/Command/_git4
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index cef83e09c..87721928a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-04-23  Daniel Hahler  <zsh@thequod.de>
+
+	* 40943: Completion/Unix/Command/_git: __git_recent_commits: prefer
+	recent commit objects.
+
 2017-04-23  Peter Stephenson  <p.w.stephenson@ntlworld.com>
 
 	* 40995: Src/lex.c, Test/D08cmdsubst.ztst: we need to expand
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 85aac9264..a46e3b55d 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -6326,11 +6326,11 @@ __git_recent_commits () {
   ret=1
   # Resetting expl to avoid it 'leaking' from one line to the next.
   expl=()
+  _describe -V -t commits 'recent commit object name' descr && ret=0
+  expl=()
   _wanted commit-tags expl 'commit tag' compadd "$@" -a - tags && ret=0
   expl=()
   _wanted heads expl 'head' compadd "$@" -a - heads && ret=0
-  expl=()
-  _describe -V -t commits 'recent commit object name' descr && ret=0
   return $ret
 }