summary refs log tree commit diff
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2008-08-16 00:48:48 +0000
committerClint Adams <clint@users.sourceforge.net>2008-08-16 00:48:48 +0000
commitddd6af43ef6fc4ca6f6906e64cce443f691d5341 (patch)
tree76ec31186e8a8b0afc20f15b833b36e4c4566840
parentd1fba243eef01ba1f1f48e5a722c5634599d1f6b (diff)
downloadzsh-ddd6af43ef6fc4ca6f6906e64cce443f691d5341.tar.gz
zsh-ddd6af43ef6fc4ca6f6906e64cce443f691d5341.tar.xz
zsh-ddd6af43ef6fc4ca6f6906e64cce443f691d5341.zip
25457: improvements for git diff and git log.
-rw-r--r--ChangeLog3
-rw-r--r--Completion/Unix/Command/_git13
2 files changed, 10 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 175912ff5..b7ae661f3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2008-08-16  Clint Adams  <clint@zsh.org>
 
+	* 25457: Completion/Unix/Command/_git: improvements for git diff
+	and git log.
+
 	* Mikael Magnusson: 25456: Completion/Unix/Command/_git: fix typo
 	of "before".
 
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index ac08dd3d2..3dc973ac6 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -1597,9 +1597,10 @@ _git-diff () {
   _arguments -S \
     $diff_args \
     '--cached[show diff between index and named commit]' \
-    '::original revision:__git_commits' \
-    '::new revision:__git_commits' \
-    '*::index file:__git_modified_files' && ret=0
+    '::commit range:__git_commit_ranges' \
+    '::original revision:__git_objects' \
+    '::new revision:__git_objects' \
+    '*::index file:__git_files' && ret=0
 }
 
 (( $+functions[_git-fetch] )) ||
@@ -1727,9 +1728,9 @@ _git-log () {
 
   case $state in
     (files)
-      _alternative \
-        'files:index file:__git_cached_files' \
-        'branches:branch:__git_branch_names' && ret=0
+      _arguments -S \
+        '::index file:__git_cached_files' \
+        '*::branch:__git_commit_ranges' && ret=0
       ;;
   esac
 }