summary refs log tree commit diff
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2007-09-23 19:31:27 +0000
committerClint Adams <clint@users.sourceforge.net>2007-09-23 19:31:27 +0000
commite16f52a1e72333b0e9e1f96d9e09eb3f8819866a (patch)
tree95adc40cf0ced47eb45c40feaf2f6ff2efd6745e
parentcf6c33dcf9b77b3184b2ea7f7cc579cb59b2182f (diff)
downloadzsh-e16f52a1e72333b0e9e1f96d9e09eb3f8819866a.tar.gz
zsh-e16f52a1e72333b0e9e1f96d9e09eb3f8819866a.tar.xz
zsh-e16f52a1e72333b0e9e1f96d9e09eb3f8819866a.zip
23823: merge in git rev-parse completion from Nikolai Weibull's repository.
-rw-r--r--ChangeLog5
-rw-r--r--Completion/Unix/Command/_git29
2 files changed, 29 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 96062983a..950793778 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-09-23  Clint Adams  <clint@zsh.org>
+
+	* 23823: Completion/Unix/Command/_git: merge in git rev-parse
+	completion from Nikolai Weibull's repository.
+
 2007-09-21  Clint Adams  <clint@zsh.org>
 
 	* 23822: Completion/Unix/Command/_git: merge in git rm
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 4cd3a5173..56b0a68db 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -1,10 +1,9 @@
-#compdef git git-annotate git-apply git-checkout-index git-clean git-commit-tree git-describe git-hash-object git-index-pack git-init-db git-instaweb git-merge-index git-merge-tree git-mktag git-mktree git-pack-objects git-prune-packed git-read-tree git-remote git-unpack-objects git-update-index git-write-tree git-cat-file git-diff-index git-diff-files git-diff-stages git-diff-tree git-fsck-objects git-ls-files git-ls-tree git-quiltimport git-merge-base git-name-rev git-rev-list git-show-index git-tar-tree git-unpack-file git-var git-verify-pack git-clone-pack git-fetch-pack git-http-fetch git-local-fetch git-peek-remote git-receive-pack git-send-pack git-ssh-fetch git-ssh-upload git-update-server-info git-upload-pack git-add git-am git-applymbox git-bisect git-branch git-checkout git-cherry-pick git-clone git-commit git-diff git-fetch git-format-patch git-grep git-log git-ls-remote git-merge git-mv git-octopus git-pull git-push git-rebase git-repack git-reset git-resolve git-revert git-shortlog git-show-branch git-status git-verify-tag git-whatchanged git-applypatch git-archimport git-archive git-convert-objects git-cvsimport git-lost-found git-merge-one-file git-prune git-relink git-svnimport git-symbolic-ref git-tag git-update-ref git-check-ref-format git-cherry git-count-objects git-daemon git-get-tar-commit-id git-mailinfo git-mailsplit git-patch-id git-request-pull git-rm git-send-email git-stripspace
+#compdef git git-annotate git-apply git-checkout-index git-clean git-commit-tree git-describe git-hash-object git-index-pack git-init-db git-instaweb git-merge-index git-merge-tree git-mktag git-mktree git-pack-objects git-prune-packed git-read-tree git-remote git-rev-parse git-unpack-objects git-update-index git-write-tree git-cat-file git-diff-index git-diff-files git-diff-stages git-diff-tree git-fsck-objects git-ls-files git-ls-tree git-quiltimport git-merge-base git-name-rev git-rev-list git-show-index git-tar-tree git-unpack-file git-var git-verify-pack git-clone-pack git-fetch-pack git-http-fetch git-local-fetch git-peek-remote git-receive-pack git-send-pack git-ssh-fetch git-ssh-upload git-update-server-info git-upload-pack git-add git-am git-applymbox git-bisect git-branch git-checkout git-cherry-pick git-clone git-commit git-diff git-fetch git-format-patch git-grep git-log git-ls-remote git-merge git-mv git-octopus git-pull git-push git-rebase git-repack git-reset git-resolve git-revert git-shortlog git-show-branch git-status git-verify-tag git-whatchanged git-applypatch git-archimport git-archive git-convert-objects git-cvsimport git-lost-found git-merge-one-file git-prune git-relink git-svnimport git-symbolic-ref git-tag git-update-ref git-check-ref-format git-cherry git-count-objects git-daemon git-get-tar-commit-id git-mailinfo git-mailsplit git-patch-id git-request-pull git-rm git-send-email git-stripspace
 
 # Commands not completed:
 # git-sh-setup
 # git-shell
 # git-parse-remote 
-# git-rev-parse 
 
 # TODO: most commands need a valid git repository to run, so add a check for it
 # so that we can make our handling a little bit cleaner (need to deal with
@@ -1391,9 +1390,29 @@ _git-request-pull () {
     ':end commit:__git_revisions'
 }
 
-# TODO: do we want this?
-#_git-rev-parse () {
-#}
+_git-rev-parse () {
+  _arguments \
+    '(--revs-only --no-revs)--revs-only[do not output flags and parameters not meant for "git-rev-list"]' \
+    '(--revs-only --no-revs)--no-revs[do not output flags and parameters meant for "git-rev-list"]' \
+    '(--flags --no-flags)--flags[do not output non-flag parameters]' \
+    '(--flags --no-flags)--no-flags[do not output flag parameters]' \
+    '--default[use "arg" if there is no parameter given]:arg' \
+    '--verify[verify parameter to be usable]' \
+    '--sq[output single shell-quoted line]' \
+    '--not[toggle ^ prefix of object names]' \
+    '--symbolic[output in a format as true to input as possible]' \
+    '--all[show all refs found in $GIT_DIR/refs]' \
+    '--branches[show branch refs found in $GIT_DIR/refs/heads]' \
+    '--tags[show tag refs found in $GIT_DIR/refs/tags]' \
+    '--remotes[show tag refs found in $GIT_DIR/refs/remotes]' \
+    '--show-prefix[show path of current directory relative to top-leve directory]' \
+    '--show-cdup[show path of top-level directory relative to current directory]' \
+    '--git-dir[show "$GIT_DIR" if defined else show path to ".git" directory]' \
+    '--short=-[show only handful hexdigits prefix]:: :_guard "[[\:digit\:]]#" number' \
+    {--after=-,--since=-}'[show "--max-age=" parameter corresponding given date string]:datestring' \
+    {--berore=-,--until=-}'[show "--min-age=" parameter corresponding given date string]:datestring' \
+    '*:args' && ret=0
+}
 
 _git-rm () {
   _arguments -S -A '-*' \