From f24ab2ef9450c98c9bc512bfbebe348b6408f604 Mon Sep 17 00:00:00 2001 From: Clint Adams Date: Tue, 25 Sep 2007 16:35:43 +0000 Subject: 23829: merge in the remaining git completion changes from Nikolai Weibull's repository. --- Completion/Unix/Command/_git | 403 ++++++++++++++++++++++++++++++++----------- 1 file changed, 301 insertions(+), 102 deletions(-) (limited to 'Completion/Unix/Command/_git') diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index b49c5687f..9ec2e3fe0 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -166,139 +166,249 @@ __git_zstyle_default () { fi } -# TODO: either skip uninteresting commands or skip the description - the list -# is just too long +# TODO: Either skip uninteresting commands or skip the description - the list +# is just too long. +# NOTE: I'm coming to the opinion that skipping the description is the right +# thing to do…, but not 100% sure yet. (( $+functions[_git_commands] )) || _git_commands () { - local -a commands - - commands=( + local -a base_commands + base_commands=( 'add:add paths to the index' + 'apply:apply patch on a git index file and a work tree' + 'bisect:find the change that introduced a bug' + 'branch:create and show branches' + 'checkout:checkout and switch to a branch' + 'cherry-pick:cherry-pick the effect of an existing commit' + 'clone:clone a repository into a new directory' + 'commit:record changes to the repository' + 'diff:show changes between commits, commit and working tree, etc.' + 'fetch:download objects and a head from another repository' + 'gc:cleanup unnecessary files and optimize thee local repository' + 'grep:print lines matching a pattern' + 'init:create empty git object database' + 'log:show commit logs' + 'merge:grand unified merge driver' + 'mv:move or rename file, directory, or symlink' + 'prune:prune all unreachable objects from the object database' + 'pull:fetch from and merge with a remote repository' + 'push:update remote refs along with associated objects' + 'rebase:rebase local commits to new upstream head' + 'reset:reset current HEAD to the specified state' + 'revert:revert existing commit' + 'rm:remove files from the working tree and from the index' + 'show-branch:show branches and their commits' + "status:show working-tree's status" + 'tag:create tag object signed with GPG' + 'verify-tag:check GPG signature of a tag') + + local -a additional_commands + additional_commands=( 'am:apply patches from a mailbox (cooler than applymbox)' 'annotate:annotate file lines with commit info' - 'apply:apply patch on a git index file and a work tree' 'applymbox:apply patches from a mailbox' 'applypatch:apply one patch extracted from an e-mail' - 'archimport:import an Arch repository into git' 'archive:create an archive of files from a named tree' - 'bisect:find the change that introduced a bug' - 'branch:create and show branches' + 'blame:blame file lines on commits' 'cat-file:provide content or type information for repository objects' 'check-ref-format:makes sure that a reference-name is well formed' - 'checkout:checkout and switch to a branch' 'checkout-index:copy files from the index to the working directory' 'cherry:find commits not merged upstream' - 'cherry-pick:cherry-pick the effect of an existing commit' 'clean:remove untracked files from the working tree' - 'clone:clones a repository into a new directory' - 'clone-pack:clones a repository into the current repository (transport)' - 'commit:record changes to the repository' - 'commit-tree:creates a new commit object' - 'convert-objects:converts old-style git repository' + 'clone-pack:clone a repository into the current repository (transport)' + 'commit-tree:create a new commit object' 'count-objects:count unpacked objects and display their disk consumption' - 'cvsimport:import a CVS "repository" into a git repository' - 'daemon:starts a really simple server for git repositories' - 'diff:show changes between commits, commit and working tree, etc.' - 'diff-files:compares files in the working tree and the index' - 'diff-index:compares content and mode of blobs between index and repository' - 'diff-stages:compares two "merge states" in the index file' - 'diff-tree:compares the content and mode of blobs found via two tree objects' - 'fetch:download objects and a head from another repository' + 'describe:show the most recent tag that is reachable from a commit' + 'diff-files:compare files in the working tree and the index' + 'diff-index:compare content and mode of blobs between index and repository' + 'diff-stages:compare two "merge states" in the index file' + 'diff-tree:compare the content and mode of blobs found via two tree objects' 'fetch-pack:receive missing objects from another repository' - 'format-patch:prepare patches for e-mail submission' - 'fsck-objects:verifies the connectivity and validity of the objects in the database' - 'get-tar-commit-id:extract commit ID from an archive created using tar-tree' - 'grep:print lines matching a pattern' - 'hash-object:computes the object ID from a file' - 'http-fetch:downloads a remote git repository via HTTP' + 'fmt-merge-msg:produce merge commit message' + 'imap-send:dump mailbox from stdin into imap folder' 'index-pack:build pack index file for an existing packed archive' - 'init-db:creates an empty git object database' - 'instaweb:instantly browse your working repository in gitweb' - 'local-fetch:duplicates another git repository on a local system' - 'log:shows commit logs' - 'lost-found:recovers lost references that luckily have not yet been pruned' - 'ls-files:information about files in the index/working directory' - 'ls-remote:shows references in a remote or local repository' - 'ls-tree:displays a tree object in human-readable form' - 'mailinfo:extracts patch from a single e-mail message' - 'mailsplit:splits an mbox file into a list of files' - 'merge:grand unified merge driver' - 'merge-base:finds a good common ancestor as possible for a merge' - 'merge-index:runs a merge for files needing merging' + 'local-fetch:duplicate another git repository on a local system' + 'ls-remote:show references in a remote or local repository' + 'ls-tree:display tree object in human-readable form' + 'mailinfo:extract patch from a single e-mail message' + 'mailsplit:split mbox file into a list of files' + 'merge-base:find as good a common ancestor as possible for a merge' + 'merge-file:run a three-way file merge' + 'merge-index:run merge for files needing merging' 'merge-one-file:standard helper-program to use with merge-index' 'merge-tree:show three-way merge without touching index' - 'mktag:creates a tag object' + 'mktag:create tag object' 'mktree:build tree-object from ls-tree formatted text' - 'mv:moves or renames a file, directory, or symlink' 'name-rev:find symbolic names for given revisions' - 'octopus:merges more than two commits' - 'pack-objects:creates a packed archive of objects' + 'octopus:merge more than two commits' + 'pack-objects:create packed archive of objects' + 'pack-redundant:find redundant pack files' + 'pack-refs:pack heads and tags for efficient repository access' 'parse-remote:routines to help parsing $GIT_DIR/remotes/' - 'patch-id:computes unique ID for a apatch' - 'peek-remote:lists references on a remote repository using the upload-pack protocol' - 'prune:prunes all unreachable objects from the object database' - 'prune-packed:removes extra objects that are already in pack files' - 'pull:fetch from and merge with a remote repository' - 'push:update remote refs along with associated objects' + 'peek-remote:list references on a remote repository using the upload-pack protocol' + 'prune-packed:remove extra objects that are already in pack files' + 'read-tree:r