summaryrefslogtreecommitdiff
path: root/Completion/Unix/Command/_git
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Unix/Command/_git')
-rw-r--r--Completion/Unix/Command/_git700
1 files changed, 536 insertions, 164 deletions
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 2b6a36956..119a705f6 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -64,8 +64,9 @@ _git-add () {
'(-i --interactive : -)'{-i,--interactive}'[add contents interactively to index]' \
'(-p --patch)'{-p,--patch}'[like -i but go directly into patch mode for specified files]' \
'(-e --edit)'{-e,--edit}'[open diff against index in editor]' \
- '(-u --update -A --all)'{-u,--update}'[update only files git already knows about]' \
- '(-A --all -u --update)'{-A,--all}'[act as both add . and add -u]' \
+ '(-A --all --no-ignore-removal -u --update --no-all --ignore-removal)'{-A,--all,--no-ignore-removal}'[add, modify, and remove index entries to match the working tree]' \
+ '(-A --all --no-ignore-removal -u --update --no-all --ignore-removal)'{--no-all,--ignore-removal}'[like "--all" but ignore removals]' \
+ '(-A --all --no-ignore-removal -u --update --no-all --ignore-removal)'{-u,--update}'[update the index just where it already has an entry matching <pathspec>]' \
'(-N --intent-to-add)'{-N,--intent-to-add}'[record only that path will be added later]' \
'--refresh[do not add files, but refresh their stat() info in index]' \
'--ignore-errors[continue adding if an error occurs]' \
@@ -104,6 +105,7 @@ _git-am () {
_arguments -S \
'(-s --signoff)'{-s,--signoff}'[add Signed-off-by: line to the commit message]' \
'(-k --keep)'{-k,--keep}'[pass -k to git mailinfo]' \
+ '--keep-non-patch[pass -b to git mailinfo]' \
'( --no-keep-cr)--keep-cr[pass --keep-cr to git mailsplit]' \
'(--keep-cr )--no-keep-cr[do not pass --keep-cr to git mailsplit]' \
'(-c --scissors --no-scissors)'{-c,--scissors}'[strip everything before a scissors line]' \
@@ -277,12 +279,13 @@ _git-bisect () {
(( $+functions[_git-branch] )) ||
_git-branch () {
- declare l c m d
+ declare l c m d e
- l='--color --no-color -r -a -v --verbose --abbrev --no-abbrev'
- c='-l -f --force -t --track --no-track --set-upstream --contains --merged --no-merged'
- m='-m -M'
- d='-d -D'
+ l='--color --no-color -r -a -v --verbose --abbrev --no-abbrev --list'
+ c='-l -f --force -t --track --no-track -u --set-upstream --set-upstream-to --unset-upstream --contains --merged --no-merged'
+ m='-m --move -M'
+ d='-d --delete -D'
+ e='--edit-description'
declare -a dependent_creation_args
if (( words[(I)-r] == 0 )); then
@@ -312,27 +315,33 @@ _git-branch () {
fi
_arguments -w -S -s \
- "($c $m $d --no-color :)--color=-[turn on branch coloring]:: :__git_color_whens" \
- "($c $m $d : --color)--no-color[turn off branch coloring]" \
- "($c $m -a)-r[list or delete only remote-tracking branches]" \
- "($c $m $d : -r)-a[list both remote-tracking branches and local branches]" \
- "($c $m $d : -v --verbose)"{-v,--verbose}'[show SHA1 and commit subject line for each head]' \
- "($c $m $d :)--abbrev=[set minimum SHA1 display-length]: :__git_guard_number length" \
- "($c $m $d :)--no-abbrev[do not abbreviate sha1s]" \
- "($l $m $d)-l[create the branch's reflog]" \
- "($l $m $d -f --force)"{-f,--force}"[force the creation of a new branch]" \
- "($l $m $d -t --track)"{-t,--track}"[set up configuration so that pull merges from the start point]" \
- "($l $m $d)--no-track[override the branch.autosetupmerge configuration variable]" \
- "($l $m $d)--set-upstream[set up configuration so that pull merges]" \
- "($l $m $d)--contains=[only list branches which contain the specified commit]: :__git_committishs" \
- "($l $m $d)--merged=[only list branches which are fully contained by HEAD]: :__git_committishs" \
- "($l $m $d)--no-merged=[do not list branches which are fully contained by HEAD]: :__git_committishs" \
+ "($c $m $d $e --no-color :)--color=-[turn on branch coloring]:: :__git_color_whens" \
+ "($c $m $d $e : --color)--no-color[turn off branch coloring]" \
+ "($c $m $d $e --no-column)"'--column=[display tag listing in columns]:column.branch option:((always\:"always show in columns" never\:"never show in columns" auto\:"show in columns if the output is to the terminal" column\:"fill columns before rows (default)" row\:"fill rows before columns" plain\:"show in one column" dense\:"make unequal size columns to utilize more space" nodense\:"make equal size columns"))' \
+ "($c $m $d $e --column)"'--no-column[do not display in columns]' \
+ "($c $m $d $e )*--list[list only branches matching glob]:pattern" \
+ "($c $m $e -a)-r[list or delete only remote-tracking branches]" \
+ "($c $m $d $e: -r)-a[list both remote-tracking branches and local branches]" \
+ "($c $m $d $e : -v -vv --verbose)"{-v,-vv--verbose}'[show SHA1 and commit subject line for each head]' \
+ "($c $m $d $e :)--abbrev=[set minimum SHA1 display-length]: :__git_guard_number length" \
+ "($c $m $d $e :)--no-abbrev[do not abbreviate sha1s]" \
+ "($l $m $d $e)-l[create the branch's reflog]" \
+ "($l $m $d $e -f --force)"{-f,--force}"[force the creation of a new branch]" \
+ "($l $m $d $e -t --track)"{-t,--track}"[set up configuration so that pull merges from the start point]" \
+ "($l $m $d $e)--no-track[override the branch.autosetupmerge configuration variable]" \
+ "($l $m $d $e -u --set-upstream --set-upstream-to --unset-upstream)"{-u,--set-upstream-to=}"[set up configuration so that pull merges]:remote-branches:__git_remote_branch_names" \
+ "($l $m $d $e -u --set-upstream --set-upstream-to --unset-upstream)--unset-upstream[remove upstream configuration]" \
+ "($l $m $d $e)--contains=[only list branches which contain the specified commit]: :__git_committishs" \
+ "($l $m $d $e)--merged=[only list branches which are fully contained by HEAD]: :__git_committishs" \
+ "($l $m $d $e)--no-merged=[do not list branches which are fully contained by HEAD]: :__git_committishs" \
+ "($c $l $m $d)--edit-description[edit branch description]" \
$dependent_creation_args \
- "($l $c $d -M)-m[rename a branch and the corresponding reflog]" \
- "($l $c $d -m)-M[rename a branch even if the new branch-name already exists]" \
+ "($l $c $d $m $e)"{-m,--move}"[rename a branch and the corresponding reflog]" \
+ "($l $c $d $m $e)-M[rename a branch even if the new branch-name already exists]" \
$dependent_modification_args \
- "($l $c $m -D)-d[delete a fully merged branch]" \
- "($l $c $m -d)-D[delete a branch]" \
+ "($l $c $m $d $e)"{-d,--delete}"[delete a fully merged branch]" \
+ "($l $c $m $d $e)-D[delete a branch]" \
+ {-q,--quiet}"[be more quiet]" \
$dependent_deletion_args
}
@@ -390,6 +399,23 @@ _git-bundle () {
return ret
}
+(( $+functions[_git-check-ignore] )) ||
+_git-check-ignore () {
+ _arguments \
+ '(-q --quiet)'{-q,--quiet}'[do not output anything, just set exit status]' \
+ '(-v --verbose)'{-v,--verbose}'[output details about the matching pattern (if any) for each pathname]' \
+ '--stdin[read file names from stdin instead of from the command-line]' \
+ '-z[make output format machine-parseable]' \
+ '(-n --non-matching)'{-n,--non-matching}'[show given paths which do not match any pattern]' \
+ '*:: :->file' && ret=0
+}
+
+(( $+functions[_git-check-mailmap] )) ||
+_git-check-mailmap () {
+ _arguments \
+ '--stdin[read contacts from stdin after those given on the command line]'
+}
+
(( $+functions[_git-checkout] )) ||
_git-checkout () {
# TODO: __git_tree_ishs is just stupid. It should be giving us a list of tags
@@ -414,6 +440,7 @@ _git-checkout () {
'(--patch)--no-track[override the branch.autosetupmerge configuration variable]' \
$new_branch_reflog_opt \
'(-b -B -t --track --patch)--orphan[create a new orphan branch based at given commit]: :__git_branch_names' \
+ '--ignore-skip-worktree-bits[ignores patterns and adds back any files in <paths>]' \
'(-q --quiet -f --force -m --merge --conflict --patch)'{-m,--merge}'[3way merge current branch, working tree and new branch]' \
'(-q --quiet -f --force -m --merge --patch)--conflict[same as --merge, using given merge style]:style:(merge diff3)' \
'(-)'{-p,--patch}'[interactively select hunks in diff between given tree-ish and working tree]' \
@@ -430,22 +457,27 @@ _git-checkout () {
if (( CURRENT == 1 )) && [[ -z $opt_args[(I)--] ]]; then
# TODO: Allow A...B
local branch_arg='branches::__git_revisions' \
+ remote_branch_noprefix_arg='remote branches::__git_remote_branch_names_noprefix' \
tree_ish_arg='tree-ishs::__git_tree_ishs' \
file_arg='modified-files::__git_modified_files'
if [[ -n ${opt_args[(I)-b|-B|--orphan]} ]]; then
+ remote_branch_noprefix_arg=
tree_ish_arg=
file_arg=
elif [[ -n $opt_args[(I)--track] ]]; then
branch_arg='remote-branches::__git_remote_branch_names'
+ remote_branch_noprefix_arg=
tree_ish_arg=
file_arg=
elif [[ -n ${opt_args[(I)--ours|--theirs|-m|--conflict|--patch]} ]]; then
branch_arg=
+ remote_branch_noprefix_arg=
fi
_alternative \
$branch_arg \
+ $remote_branch_noprefix_arg \
$tree_ish_arg \
$file_arg && ret=0
elif [[ -n ${opt_args[(I)-b|-B|-t|--track|--orphan]} ]]; then
@@ -464,11 +496,18 @@ _git-checkout () {
(( $+functions[_git-cherry-pick] )) ||
_git-cherry-pick () {
_arguments \
+ '(- :)--quit[end revert or cherry-pick sequence]' \
+ '(- :)--continue[resume revert or cherry-pick sequence]' \
+ '(- :)--abort[cancel revert or cherry-pick sequence]' \
+ '--allow-empty-message[allow replaying a commit with an empty message]' \
+ '--keep-redundant-commits[keep cherry-picked commits that will become empty]' \
'(-e --edit --ff)'{-e,--edit}'[edit commit before committing the revert]' \
'(--ff)-x[append information about what commit was cherry-picked]' \
'(-m --mainline)'{-m,--mainline}'[specify mainline when cherry-picking a merge commit]:parent number' \
'(-n --no-commit --ff)'{-n,--no-commit}'[do not make the actually commit]' \
'(-s --signoff --ff)'{-s,--signoff}'[add Signed-off-by line at the end of the commit message]' \
+ '*'{-s,--strategy=}'[use given merge strategy]:merge strategy:__git_merge_strategies' \
+ '*'{-X,--strategy-option=}'[pass merge-strategy-specific option to merge strategy]' \
'(-e --edit -x -n --no-commit -s --signoff)--ff[fast forward, if possible]' \
': :__git_revisions'
}
@@ -486,6 +525,7 @@ _git-clean () {
_arguments -w -C -S -s \
'-d[also remove untracked directories]' \
'(-f --force)'{-f,--force}'[required when clean.requireForce is true (default)]' \
+ '(-i --interactive)'{-i,--interactive}'[show what would be done and clean files interactively]' \
'(-n --dry-run)'{-n,--dry-run}'[only show what would and what would not be removed]' \
'(-q --quiet)'{-q,--quiet}'[only report errors]' \
'*'{-e,--exclude=}'[skip files matching specified pattern]:pattern' \
@@ -543,7 +583,8 @@ _git-clone () {
# TODO: Argument to -b should complete branch names in the repository being
# cloned.
_arguments -w -C -S -s \
- '(-l --local)'{-l,--local}'[clone locally, hardlink refs and objects if possible]' \
+ '(-l --local --no-local)'{-l,--local}'[clone locally, hardlink refs and objects if possible]' \
+ '(-l --local --no-local)--no-local[override --local, as if file:/// URL was given]' \
'--no-hardlinks[copy files instead of hardlinking when doing a local clone]' \
'(-s --shared)'{-s,--shared}'[share the objects with the source repository (warning: see man page)]' \
'--reference[reference repository]:repository:_directories' \
@@ -557,7 +598,9 @@ _git-clone () {
'(-b --branch)'{-b,--branch}'[point HEAD to the given branch]: :__git_guard_branch-name' \
'(-u --upload-pack)'{-u,--upload-pack=}'[specify path to git-upload-pack on remote side]:remote path' \
'--template=[directory to use as a template for the object database]: :_directories' \
+ '*'{-c,--config}'[<key>=<value> set a configuration variable in the newly created repository]' \
'--depth[create a shallow clone, given number of revisions deep]: :__git_guard_number depth' \
+ '--single-branch[clone only history leading up to the main branch or the one specified by -b]' \
'--recursive[initialize all contained submodules]' \
': :->repository' \
': :_directories' && ret=0
@@ -575,6 +618,18 @@ _git-clone () {
return ret
}
+(( $+functions[_git-column] )) ||
+_git-column () {
+ _arguments -w -S -s \
+ '--command=[look up layout mode using config vars column.<name> and column.ui]' \
+ '--mode=[specify layout mode. See configuration variable column.ui for option syntax]' \
+ '--raw-mode=[same as --mode but take mode encoded as a number]' \
+ '--width=[specify the terminal width]' \
+ '--indent=[string to be printed at the beginning of each line]' \
+ '--nl[string to be printed at the end of each line, including newline character]' \
+ '--padding[the number of spaces between columns. One space by default]'
+}
+
(( $+functions[_git-commit] )) ||
_git-commit () {
local amend_opt='--amend[amend the tip of the current branch]'
@@ -587,25 +642,29 @@ _git-commit () {
reset_author_opt='(--author)--reset-author[make committer the author of the commit]'
fi
- # TODO: --null is an undocumented alias.
# TODO: --interactive isn’t explicitly listed in the documentation.
_arguments -w -S -s \
'(-a --all --interactive -o --only -i --include *)'{-a,--all}'[stage all modified and deleted paths]' \
+ '--fixup=[construct a commit message for use with rebase --autosquash]:' \
+ '--squash=[construct a commit message for use with rebase --autosquash]:' \
$reset_author_opt \
'( --porcelain --dry-run)--short[output dry run in short format]' \
'(--short --dry-run)--porcelain[output dry run in porcelain-ready format]' \
'(--short --porcelain --dry-run -z --null)'{-z,--null}'[separate dry run entry output with NUL]' \
+ '--patch[use the interactive patch selection interface to chose which changes to commit]' \
'(--reset-author)--author[override the author name used in the commit]:author name' \
'--date=[override the author date used in the commit]:date' \
'(-s --signoff)'{-s,--signoff}'[add Signed-off-by line at the end of the commit message]' \
'(-n --no-verify)'{-n,--no-verify}'[do not look for suspicious lines the commit introduces]' \
'--allow-empty[allow recording an empty commit]' \
'--allow-empty-message[allow recording a commit with an empty message]' \
- '--cleanup=[specify how the commit message should be cleaned up]:mode:((verbatim\:"don'\''t change the commit message at all"
+ '--cleanup=[specify how the commit message should be cleaned up]:mode:((verbatim\:"do not change the commit message at all"
whitespace\:"remove leading and trailing whitespace lines"
strip\:"remove both whitespace and commentary lines"
default\:"act as '\''strip'\'' if the message is to be edited and as '\''whitespace'\'' otherwise"))' \
- '(-e --edit)'{-e,--edit}'[edit the commit message before committing]' \
+ '(-e --edit --no-edit)'{-e,--edit}'[edit the commit message before committing]' \
+ '(-e --edit --no-edit)--no-edit[do not edit the commit message before committing]' \
+ '--no-post-rewrite[bypass the post-rewrite hook]' \
'(-a --all --interactive -o --only -i --include)'{-i,--include}'[update the given files and commit the whole index]' \
'(-a --all --interactive -o --only -i --include)'{-o,--only}'[commit only the given files]' \
'(-u --untracked-files)'{-u-,--untracked-files=}'[show files in untracked directories]::mode:((no\:"show no untracked files"
@@ -616,6 +675,7 @@ _git-commit () {
'--dry-run[only show list of paths that are to be commited or not, and any untracked]' \
'( --no-status)--status[include the output of git status in the commit message template]' \
'(--status )--no-status[do not include the output of git status in the commit message template]' \
+ '(-S --gpg-sign)'{-S-,--gpg-sign=}'[GPG-sign the commit]::key id' \
'(-a --all --interactive -o --only -i --include *)--interactive[interactively update paths in the index file]' \
'*: :__git_ignore_line_inside_arguments __git_changed_files' \
- '(message)' \
@@ -641,6 +701,7 @@ _git-describe () {
'(--abbrev)--long[always show full format, even for exact matches]' \
'--match=[only consider tags matching glob pattern]:pattern' \
'--always[show uniquely abbreviated commit object as fallback]' \
+ '--first-parent[follow only the first parent of merge commits]' \
'*: :__git_committishs'
}
@@ -788,14 +849,18 @@ _git-format-patch () {
'(--thread )--no-thread[do not thread messages]' \
'--in-reply-to=[make the first mail a reply to the given message]:message id' \
'--ignore-if-in-upstream[do not include a patch that matches a commit in the given range]' \
+ '(-v --reroll-count)'{-v,--reroll-count=}'[mark the series as the <n>-th iteration of the topic]: :__git_guard_number iteration' \
'(-k --keep-subject)--subject-prefix=[use the given prefix instead of \[PATCH\]]:prefix' \
'*--to=[add To: header to email headers]: :_email_addresses' \
'*--cc=[add Cc: header to email headers]: :_email_addresses' \
+ '--from=[add From: header to email headers]: :_email_addresses' \
'*--add-header=[add an arbitrary header to email headers]:header' \
'--cover-letter[generate a cover letter template]' \
+ '--notes=[append notes for the commit after the three-dash line]:: :__git_notes_refs' \
'( --no-signature)--signature=[add a signature]:signature' \
'(--signature )--no-signature[do not add a signature]' \
'--suffix=[use the given suffix for filenames]:filename suffix' \
+ '--quiet[suppress the output of the names of generated files]' \
'--no-binary[do not output contents of changes in binary files, only note that they differ]' \
'--root[treat the revision argument as a range]' \
': :->commit-or-commit-range' && ret=0
@@ -842,19 +907,23 @@ _git-grep () {
_arguments -C -A '-*' \
'(-O --open-files-in-pager --no-index)--cached[search blobs registered in index file instead of working tree]' \
'(--cached)--no-index[search files in current directory, not just treacked files]' \
+ '(--exclude-standard)--no-exclude-standard[also search in ignored files]' \
+ '(--no-exclude-standard)--exclude-standard[exclude files standard ignore mechanisms]' \
+ '--untracked[search in untracked files]' \
'(-a --text)'{-a,--text}'[process binary files as if they were text]' \
'(-i --ignore-case)'{-i,--ignore-case}'[ignore case when matching]' \
'-I[do not match pattern in binary files]' \
- '--max-depth=[descend at most given levels of directories]:__git_guard_number depth' \
+ '--max-depth=[descend at most given levels of directories]: :__git_guard_number depth' \
'(-w --word-regexp)'{-w,--word-regexp}'[match only whole words]' \
'(-v --invert-match)'{-v,--invert-match}'[select non-matching lines]' \
'( -H)-h[supress output of filenames]' \
'(-h )-H[show filenames]' \
'--full-name[output paths relative to the project top directory]' \
- '(-E --extended-regexp -G --basic-regexp)'{-E,--extended-regexp}'[use POSIX extended regexes]' \
- '(-E --extended-regexp -G --basic-regexp)'{-G,--basic-regexp}'[use POSIX basic regexes]' \
- '(-F --fixed-strings)'{-F,--fixed-strings}'[do not interpret pattern as a regex]' \
- '-n[prefix the line number to matching lines]' \
+ '(-E --extended-regexp -G --basic-regexp -P --perl-regexp -F --fixed-strings)'{-E,--extended-regexp}'[use POSIX extended regexes]' \
+ '(-E --extended-regexp -G --basic-regexp -P --perl-regexp -F --fixed-strings)'{-G,--basic-regexp}'[use POSIX basic regexes]' \
+ '(-E --extended-regexp -G --basic-regexp -P --perl-regexp -F --fixed-strings)'{-P,--perl-regexp}'[use perl-compatible regexes]' \
+ '(-E --extended-regexp -G --basic-regexp -P --perl-regexp -F --fixed-strings)'{-F,--fixed-strings}'[do not interpret pattern as a regex]' \
+ '(-n --line-number)'{-n,--line-number}'[prefix the line number to matching lines]' \
'(-l --files-with-matches -L --files-without-match --name-only)'{-l,--files-with-matches,--name-only}'[show only names of matching files]' \
'(-l --files-with-matches -L --files-without-match)'{-L,--files-without-match}'[show only names of non-matching files]' \
'(--cached -O --open-files-in-pager)'{-O,--open-files-in-pager}'=-[open matching files in pager]::_path_commands' \
@@ -862,10 +931,13 @@ _git-grep () {
'(-c --count)'{-c,--count}'[show number of matching lines in files]' \
'( --no-color)--color=-[color matches]:: :__git_color_whens' \
'(--color )---no-color[do not color matches]' \
- '-A[show trailing context]: :__git_guard_number lines' \
- '-B[show leading context]: :__git_guard_number lines' \
- '-C[show context]: :__git_guard_number lines' \
+ '--break[prefix the line number to matching lines]' \
+ '--heading[show the filename above the matches]' \
+ '(-A --after-context)'{-A,--after-context=}'[show <num> trailing lines, and separate groups of matches]: :__git_guard_number lines' \
+ '(-B --before-context)'{-B,--before-context=}'[show <num> leading lines, and separate groups of matches]: :__git_guard_number lines' \
+ '(-A --after-context -B --before-context -C --context)'{-C,--context=}'[show <num> leading and trailing lines, and separate groups of matches]: :__git_guard_number lines' \
'(-p --show-function)'{-p,--show-function}'[show preceding line containing function name of match]' \
+ '(-W --function-context)'{-W,--function-context}'[show whole function where a match was found]' \
'(1)*-f[read patterns from given file]:pattern file:_files' \
'(1)*-e[use the given pattern for matching]:pattern' \
$pattern_operators \
@@ -979,6 +1051,7 @@ _git-init () {
'--bare[create a bare repository]' \
'--template=[directory to use as a template for the object database]: :_directories' \
'--shared=[share repository amongst several users]:: :__git_repository_permissions' \
+ '--separate-git-dir=[create git dir elsewhere and link it using the gitdir mechanism]:: :_directories' \
':: :_directories'
}
@@ -996,6 +1069,7 @@ _git-log () {
$log_options \
$revision_options \
$diff_options \
+ '-L+[trace the evolution of a line range or regex within a file]:range' \
'(-)--[start file arguments]' \
'*:: :->commit-range-or-file' && ret=0
@@ -1039,6 +1113,7 @@ _git-merge () {
'-m[set the commit message to be used for the merge commit]:merge message' \
'( --no-rerere-autoupdate)--rerere-autoupdate[allow the rerere mechanism to update the index]' \
'(--rerere-autoupdate )--no-rerere-autoupdate[do not allow the rerere mechanism to update the index]' \
+ '--abort[restore the original branch and abort the merge operation]' \
'*: :__git_commits'
}
@@ -1085,6 +1160,7 @@ _git-notes () {
copy:'copy notes from one object to another'
append:'append notes to a given object'
edit:'edit notes for a given object'
+ merge:'merge the given notes ref into the current ref'
show:'show notes for a given object'
remove:'remove notes for a given object'
prune:'remove all notes for non-existing/unreachable objects')
@@ -1119,6 +1195,15 @@ _git-notes () {
': :__git_commits' \
': :__git_commits' && ret=0
;;
+ (merge)
+ _arguments -w -S -s \
+ '(-s --strategy)--abort[abort an in-progress notes merge]' \
+ '(-s --strategy)--commit[finalize an in-progress notes merge]' \
+ {-q,--quiet}'[be quiet]' \
+ {-v,--verbose}'[be more verbose]' \
+ '(--abort --commit)'{-s,--strategy=}'[resolve conflicts using the given strategy]' \
+ ': :__git_notes_refs' && ret=0
+ ;;
(append)
_arguments -w -S -s \
'*'{-m,--message=}'[use given note message]:message' \
@@ -1160,20 +1245,25 @@ _git-push () {
# later on to match the remote end.
_arguments -w -S -s \
'--all[push all refs under refs/heads/]' \
+ '--prune[remove remote branches that do not have a local counterpart]' \
'--mirror[push all refs under refs/heads/ and refs/tags/ and delete non-existing refs]' \
'(-n --dry-run)'{-n,--dry-run}'[do everything except actually send the updates]' \
'--porcelain[produce machine-readable output]' \
'--delete[delete all listed refs from the remote repository]' \
'--tags[all tags under refs/tags are pushed]' \
+ '--follow-tags[also push missing annotated tags reachable from the pushed refs]' \
'(--receive-pack --exec)'{--receive-pack=-,--exec=-}'[path to git-receive-pack on remote]:remote git-receive-pack:_files' \
'(-f --force)'{-f,--force}'[allow refs that are not ancestors to be updated]' \
'(:)--repo=[default repository to use]:repository:__git_any_repositories' \
- '(-u --set-upstream)'{-u,--set-upstream}'[add upstream reference for each branch that is up to date or pushed]' \
+ '(-u --set-upstream-to)'{-u,--set-upstream-to}'[add upstream reference for each branch that is up to date or pushed]' \
'( --no-thin)--thin[try to minimize number of objects to be sent]' \
'(--thin )--no-thin[do not try to minimize number of objects to be sent]' \
'(-q --quiet -v --verbose --progress)'{-q,--quiet}'[suppress all output]' \
'(-q --quiet -v --verbose)'{-v,--verbose}'[output additional information]' \
'(-q --quiet)--progress[output progress information]' \
+ '(--verify)--no-verify[bybass the pre-push hook]' \
+ '--recurse-submodules=[submodule handling]:submodule handling:((check\:"refuse pushing of supermodule if submodule commit cannot be found on the remote"
+ on-demand\:"push all changed submodules"))' \
':: :__git_any_repositories' \
'*: :__git_ref_specs'
}
@@ -1182,7 +1272,7 @@ _git-push () {
_git-rebase () {
local -a autosquash_opts
- if (( words[(I)--interactive] )); then
+ if (( words[(I)-i|--interactive] )); then
autosquash_opts=(
'( --no-autosquash)--autosquash[check for auto-squash boundaries]'
'(--autosquash )--no-autosquash[do not check for auto-squash boundaries]')
@@ -1191,6 +1281,7 @@ _git-rebase () {
_arguments -A '-*' \
'(- :)--continue[continue after resolving merge conflict]' \
'(- :)--abort[abort current rebase]' \
+ '--keep-empty[keep empty commits in the result]' \
'(- :)--skip[skip the current patch]' \
'(-m --merge)'{-m,--merge}'[use merging strategies to rebase]' \
'*'{-s,--strategy=}'[use given merge strategy]:merge strategy:__git_merge_strategies' \
@@ -1204,7 +1295,9 @@ _git-rebase () {
'(-i --interactive)--whitespace=-[detect a new or modified line that has whitespace errors]: :__git_apply_whitespace_strategies' \
'(-i --interactive)--committer-date-is-author-date[use author date as committer date]' \
'(-i --interactive --ignore-whitespace --whitespace --committer-date-is-author-date)'{-i,--interactive}'[make a list of commits to be rebased and open in $EDITOR]' \
+ '--edit-todo[edit interactive instruction sheet in an editor]' \
'(-p --preserve-merges --interactive)'{-p,--preserve-merges}'[try to recreate merges instead of ignoring them]' \
+ {-x,--exec}'[with -i\: append "exec <cmd>" after each line]:command' \
'(1)--root[rebase all reachable commits]' \
$autosquash_opts \
'--no-ff[cherry-pick all rebased commits with --interactive, otherwise synonymous to --force-rebase]' \
@@ -1246,9 +1339,12 @@ _git-reset () {
(( $+functions[_git-revert] )) ||
_git-revert () {
_arguments -w -S -s \
+ '(- :)--quit[end revert or cherry-pick sequence]' \
+ '(- :)--continue[resume revert or cherry-pick sequence]' \
+ '(- :)--abort[cancel revert or cherry-pick sequence]' \
'(-e --edit --no-edit)'{-e,--edit}'[edit the commit before committing the revert]' \
+ '(-e --edit --no-edit)--no-edit[do not edit the commit message before committing the revert]' \
'(-m --mainline)'{-m+,--mainline=}'[pick which parent is mainline]:parent number' \
- '(-e --edit)--no-edit[do not edit the commit message]' \
'(-n --no-commit)'{-n,--no-commit}'[do not commit the reversion]' \
'(-s --signoff)'{-s,--signoff}'[add Signed-off-by line at the end of the commit message]' \
': :__git_commits'
@@ -1270,11 +1366,7 @@ _git-rm () {
case $state in
(file)
- if [[ -n ${opt_args[(I)--cached]} ]]; then
- __git_changed-in-index_files && ret=0
- else
- __git_cached_files && ret=0
- fi
+ __git_cached_files && ret=0
;;
esac
@@ -1298,7 +1390,8 @@ _git-shortlog () {
'(-e --email)'{-e,--email}'[show email addres of each author]' \
'-w-[linewrap the output]:: :->wrap' \
$revision_options \
- '*: :__git_commits' && ret=0
+ '(-)--[start file arguments]' \
+ '*:: :->commit-range-or-file' && ret=0
case $state in
(wrap)
@@ -1314,6 +1407,30 @@ _git-shortlog () {
__git_guard_number 'line width'
fi
;;
+ (commit-range-or-file)
+ case $CURRENT in
+ (1)
+ if [[ -n ${opt_args[(I)--]} ]]; then
+ __git_cached_files && ret=0
+ else
+ _alternative \
+ 'commit-ranges::__git_commit_ranges' \
+ 'cached-files::__git_cached_files' && ret=0
+ fi
+ ;;
+ (*)
+ # TODO: Write a wrapper function that checks whether we have a
+ # committish range or comittish and calls __git_tree_files
+ # appropriately.
+ if __git_is_committish_range $line[1]; then
+ __git_tree_files ${PREFIX:-.} $(__git_committish_range_last $line[1]) && ret=0
+ elif __git_is_committish $line[1]; then
+ __git_tree_files ${PREFIX:-.} $line[1] && ret=0
+ else
+ __git_cached_files && ret=0
+ fi
+ ;;
+ esac
esac
return ret
@@ -1324,9 +1441,10 @@ _git-show () {
local curcontext=$curcontext state line ret=1
typeset -A opt_args
- local -a log_options revision_options
+ local -a log_options revision_options diff_options
__git_setup_log_options
__git_setup_revision_options
+ __git_setup_diff_options
_arguments -w -C -s \
$log_options \
@@ -1382,6 +1500,7 @@ _git-stash () {
'( --no-keep-index)--keep-index[all changes already added to the index are left intact]' \
'(--keep-index )--no-keep-index[all changes already added to the index are undone]' \
'(-q --quiet)'{-q,--quiet}'[suppress all output]' \
+ '(-u --include-untracked)'{-u,--include-untracked}'[include untracked files]' \
'::message' && ret=0
;;
(list)
@@ -1449,7 +1568,10 @@ _git-status () {
normal\:"show untracked files and directories" \
all\:"also show untracked files in untracked directories (default)"))' \
'--ignore-submodules[ignore changes to submodules]:: :__git_ignore_submodules_whens' \
+ '--ignored[show ignored files as well]' \
'(--porcelain)-z[use NUL termination on output]' \
+ '(--no-column)--column=-[display in columns]::column.status option:((always\:"always show in columns" never\:"never show in columns" auto\:"show in columns if the output is to the terminal" column\:"fill columns before rows (default)" row\:"fill rows before columns" plain\:"show in one column" dense\:"make unequal size columns to utilize more space" nodense\:"make equal size columns"))' \
+ '(--column)--no-column[do not display in columns]' \
'*: :__git_ignore_line_inside_arguments _files'
}
@@ -1458,7 +1580,7 @@ _git-submodule () {
local curcontext=$curcontext state line ret=1
declare -A opt_args
- _arguments -C -A '-*' \
+ _arguments -C \
'(-q --quiet)'{-q,--quiet}'[suppress all output]' \
': :->command' \
'*:: :->option-or-argument' && ret=0
@@ -1471,6 +1593,7 @@ _git-submodule () {
add:'add given repository as a submodule'
status:'show the status of a submodule'
init:'initialize a submodule'
+ deinit:'unregister a submodule'
update:'update a submodule'
summary:'show commit summary between given commit and working tree/index'
foreach:'evaluate shell command in each checked-out submodule'
@@ -1489,6 +1612,7 @@ _git-submodule () {
'(-q --quiet)'{-q,--quiet}'[suppress all output]' \
'(-b --branch)'{-b,--branch}'[branch of repository to add as submodule]' \
'(-f --force)'{-f,--force}'[allow adding an otherwise ignored submodule path]' \
+ '--name[use given name instead of defaulting to its path]:name' \
'--reference=[remote repository to clone]: :__git_any_repositories' \
': :__git_any_repositories' \
':: :_directories' && ret=0
@@ -1505,6 +1629,11 @@ _git-submodule () {
'(-q --quiet)'{-q,--quiet}'[suppress all output]' \
'*: :__git_ignore_line_inside_arguments __git_submodules' && ret=0
;;
+ (deinit)
+ _arguments -S \
+ '(-f --force)'{-f,--force}'[remove submodule worktree even if local modifications are present]' \
+ '*: :__git_ignore_line_inside_arguments __git_submodules' && ret=0
+ ;;
(update)
# TODO: --init not properly documented.
_arguments -S \
@@ -1514,6 +1643,7 @@ _git-submodule () {
'--rebase[rebase current branch onto commit recorded in superproject]' \
'--reference=[remote repository to clone]: :__git_any_repositories' \
'--recursive[traverse submodules recursively]' \
+ '--force[discard local changes by checking out the current up-to-date version]' \
'--init[initialize uninitialized submodules]' \
'*: :__git_ignore_line_inside_arguments __git_submodules' && ret=0
;;
@@ -1547,6 +1677,7 @@ _git-submodule () {
;;
(sync)
_arguments -S \
+ '--recursive[traverse submodules recursively]' \
'(-q --quiet)'{-q,--quiet}'[suppress all output]' \
'*: :__git_ignore_line_inside_arguments __git_submodules' && ret=0
;;
@@ -1572,10 +1703,11 @@ _git-tag () {
_arguments -A '-*' \
- creation \
- '( -s -u)-a[create an unsigned, annotated tag]' \
- '(-a -u)-s[create an signed and annotated tag]' \
- '(-a -s )-u[create a tag, annotated and signed with the given key]: :__git_gpg_secret_keys' \
+ '( -s -u --local-user)-a[create an unsigned, annotated tag]' \
+ '(-a -u --local-user)-s[create an signed and annotated tag]' \
+ '(-a -s)'{-u,--local-user}'[create a tag, annotated and signed with the given key]: :__git_gpg_secret_keys' \
'-f[replace existing tag]' \
+ '--cleanup=[cleanup message]:mode:((verbatim\:"no cleanup" whitespace\:"remove leading and trailing whitespace" strip\:"remove leading and trailing whitespace and comments"))' \
$message_opts \
': :__git_tags' \
':: :__git_commits' \
@@ -1585,7 +1717,10 @@ _git-tag () {
- listing \
'-n+[limit line output of annotation]: :__git_guard_number "limit"' \
'-l[list tags matching pattern]' \
+ '(--no-column)--column=-[display tag listing in columns]::column.tag option:((always\:"always show in columns" never\:"never show in columns" auto\:"show in columns if the output is to the terminal" column\:"fill columns before rows (default)" row\:"fill rows before columns" plain\:"show in one column" dense\:"make unequal size columns to utilize more space" nodense\:"make equal size columns"))' \
+ '(--column)--no-column[do not display in columns]' \
'--contains=[only list tags which contain the specified commit]: :__git_commits' \
+ '--points-at=[only list tags of the given object]: :__git_commits' \
'::pattern' \
- verification \
'-v[verifies gpg signutare of tags]' \
@@ -1630,7 +1765,6 @@ _git-config () {
value_arg=': :->value'
fi
- # TODO --local is undocumented.
_arguments -w -C -S -s \
'( --system --local -f --file)--global[use user-global config file]' \
'(--global --local -f --file)--system[use system-wide config file]' \
@@ -1657,26 +1791,47 @@ _git-config () {
'(2)--get-regexp[like "--get-all", but interpret "name" as a regular expression]' \
'(2 3 --bool --int --bool-or-int --path -z --null)--get-colorbool[check if color should be used]: :->gettable-colorbool-option' \
'(2 3 --bool --int --bool-or-int --path -z --null)--get-color[find color setting]: :->gettable-color-option' \
- '(-e --edit --bool --int --bool-or-int --path -z --null)'{-e,--edit}'[open config file for editing]' && ret=0
+ '(-e --edit --bool --int --bool-or-int --path -z --null)'{-e,--edit}'[open config file for editing]' \
+ '(--no-includes)'--includes'[respect "include.*" directives in config files when looking up values]' \
+ '(--includes)'--no-includes'[do not respect "include.*" directives]' && ret=0
# TODO: Most all _path_commands should be able to take arguments and so on.
# How do we deal with that and how do we quote the whole argument to git
# config?
- # TODO: Add merge.*.(name|driver|recursive) and diff.*.(command|funcname)
+ # TODO: Add support for merge.*. (merge driver), diff.*. (diff driver), and filter.*. (filter driver) options
# (see gitattributes(5)).
# TODO: .path options should take absolute paths.
declare -a git_options_static
git_options_static=(
advice.pushNonFastForward:'show advice when git push refuses non-fast-forward refs::->bool:true'
+ advice.pushUpdateRejected:'combined setting for advice.push*::->bool:true'
+ advice.pushNonFFCurrent:'show advice when git push fails due to a non-fast-forward update to the current branch::->bool:true'
+ advice.pushNonFFDefault:'show advice to set push.default to "upstream" or "current" after running git-push::->bool:true'
+ advice.pushNonFFMatching:'show advice when running git-push and pushed matching refs explicitly::->bool:true'
+ advice.pushAlreadyExists:'show advice when git-push rejects an update that does not qualify for fast-forwarding::->bool:true'
+ advice.pushFetchFirst:'show advice when git-push rejects an update that tries to overwrite a remote ref that points at unknown object::->bool:true'
+ advice.pushNeedsForce:'show advice when git-push rejects an update that tries to overwrite a remote ref that points a non-commitish::->bool:true'
advice.statusHints:'show advice in output of git status::->bool:true'
+ advice.statusUoption:'show advice to consider using the "-u" option to git-status when it takes more than 2 seconds::->bool:true'
advice.commitBeforeMerge:'show advice when git merge refuses to merge::->bool:true'
advice.resolveConflict:'show advice when conflict prevents operation from being performed::->bool:true'
advice.implicitIdentity:'show advice when identity is guessed from system settings::->bool:true'
advice.detachedHead:'show advice when entering detached-HEAD state::->bool:true'
+ advice.amWorkDir:'show the location of the patch file when git-am fails to apply it::->bool:true'
blame.blankboundary:'show blank SHA-1 for boundary commits::->bool:false'
blame.showroot:'show root commits as normal commits::->bool:false'
blame.date:'date format to use in output::__git_date_formats:iso'
+ 'branch.*.description:branch description:branch description:->string'
+ cvsexportcommit.cvsdir:'the default location of the CVS checkout to use for the export:cvs export dir:_directories'
+ column.ui:'specify whether supported commands should output in columns.::->column:never'
+ column.branch:'specify whether to output branch listing in git branch in columns::->column:never'
+ column.clean:'specify the layout when listing items in git clean -i::->column:never'
+ column.status:'specify whether to output untracked files in git status in columns::->column:never'
+ column.tag:'specify whether to output tag listing in git tag in columns::->column:never'
core.fileMode:'track changes to the executable bit of files::->bool:true'
+ core.attributesfile:'look into this file for attributes in addition to .gitattributes:additional attributes file:_files'
+ core.abbrev:'set the length object names are abbreviated to:length:->int:7'
+ core.commentchar:'comment character when using an editor::->string'
core.ignoreCygwinFSTricks:'use Cygwin stat()/lstat()::->bool:true'
core.ignorecase:'use workarounds for non-case-sensitive filesystems::->bool:false'
core.trustctime:'trust inode change time::->bool:true'
@@ -1698,6 +1853,7 @@ _git-config () {
core.loosecompression:'level of compression to apply to non-pack files::->compression:1'
core.packedGitWindowSize:'size of mappings of pack files:pack window size:->bytes'
core.packedGitLimit:'maximum number of bytes to map from pack files:maximum pack file map size:->bytes'
+ core.precomposeunicode:'revert the unicode decomposition of filenames done by Mac OS::->bool:false'
core.deltaBaseCacheLimit:'maximum size of cache for base objects:maximum base objects cache size:->bytes:16m'
core.bigFileThreshold:'maximum size of files to compress:maximum compress size:->bytes:512m'
core.excludesfile:'additional file to use for exclusion:excludes file:_files'
@@ -1708,9 +1864,17 @@ _git-config () {
core.fsyncobjectfiles:'fsync() when writing object files::->bool:false'
core.preloadindex:'use parallel index preload for operations like git diff::->bool:false'
core.createObject:'take steps to prevent overwriting existing objects::->core.createObject:link'
+ core.checkstat:'determine which stat fields to match between the index and work tree::->core.checkstat:default'
core.notesRef:'show notes in given refs:refs:->string:refs/notes/commits'
core.sparseCheckout:'use sparse checkout::->bool:false'
+ credential.helper:'external helper to be called when a username or password credential is needed::_path_commands'
+ credential.useHttpPath:'consider the "path" component of an http or https URL to be important::->bool:false'
+ credential.username:'If no username is set use this username by default:default username:->string'
+ 'credential.*.helper:external helper to be called when a username or password credential is needed::_path_commands'
+ 'credential.*.useHttpPath:consider the "path" component of an http or https URL to be important::->bool:false'
+ 'credential.*.username:if no username is set use this username by default:default username:->string'
add.ignore-errors:'ignore indexing errors when adding files::->bool:false'
+ add.ignoreErrors:'ignore indexing errors when adding files::->bool:false'
am.keepcr:'keep CR characters when splitting mails::->bool:false'
apply.ignorewhitespace:'ignore whitespace changes::->apply.ignorewhitespace:no'
apply.whitespace:'default value for the --whitespace option::->apply.whitespace:error'
@@ -1719,6 +1883,7 @@ _git-config () {
'branch.*.remote:what remote git fetch and git push should fetch form/push to::__git_remotes'
'branch.*.merge:default refspec to be marked for merging::__git_ref_specs'
'branch.*.mergeoptions:default options for merging::->branch.mergeoptions'
+ 'branch.*.pushremote:what remote git push should push to::__git_remotes'
'branch.*.rebase:rebase on top of fetched branch::->bool:false'
'browser.*.cmd:browser command to use:browser:_path_commands'
'browser.*.path:path to use for the browser:absolute browser path:_files -g "*(*)"'
@@ -1727,6 +1892,7 @@ _git-config () {
color.branch.current:'color of the current branch::->color'
color.branch.local:'color of a local branch::->color'
color.branch.remote:'color of a remote branch::->color'
+ color.branch.upstream:'color of upstream branches::->color'
color.branch.plain:'color of other branches::->color'
color.diff:'color output of git diff::->color-bool'
color.diff.plain:'color of context text::->color'
@@ -1758,6 +1924,7 @@ _git-config () {
color.pager:'feed colored output to pager::->bool:true'
color.showbranch:'color output of git show-branch::->color-bool'
color.status:'color output of git status::->color-bool'
+ color.status.branch:'color of the current branch::->color'
color.status.header:'color of header text::->color'
color.status.added:'color of added, but not yet committed, files::->color'
color.status.updated:'color of updated, but not yet committed, files::->color'
@@ -1765,24 +1932,41 @@ _git-config () {
color.status.untracked:'color of files not currently being tracked::->color'
color.status.nobranch:'color of no-branch warning::->color'
color.ui:'color output of capable git commands::->color-bool'
+ commit.cleanup:'default --cleanup option::->commit.cleanup:default'
commit.status:'include status information in commit message template::->bool:true'
commit.template:'template file for commit messages:template:_files'
+ 'diff.*.binary:make the diff driver treat files as binary::->bool:false'
+ 'diff.*.cachetextconv:make the diff driver cache the text conversion outputs::->bool:false'
+ 'diff.*.command:custom diff driver command::_path_commands'
+ 'diff.*.textconv:command to generate the text-converted version of a file::_path_commands'
+ 'diff.*.wordregex:regular expression that the diff driver should use to split words in a line:regular expression:->string'
+ 'diff.*.xfuncname:regular expression that the diff driver should use to recognize the hunk header:regular expression:->string'
+ diff.algorithm:'default diff algorithm::->diff.algorithm:default'
diff.autorefreshindex:'run git update-index --refresh before git diff::->bool:true'
+ diff.context:'default number of context lines::->int:3'
+ diff.dirstat:'comma separated list of --dirstat parameters specifying default behaviour:comma-separated list:->string:changes,noncumulative,3'
diff.external:'command to generate diff with:diff command:_path_commands'
diff.mnemonicprefix:'use mnemonic source and destination prefixes::->bool:false'
diff.noprefix:'strip source and destination prefixes::->bool:false'
diff.renameLimit:'number of files to consider when detecting copy/renames:rename limit:->int'
diff.renames:'try to detect renames::->diff.renames:true'
diff.ignoreSubmodules:'ignore submodules::->bool:false'
- diff.suppressBlankEmpty:'inbihit printing space before empty output lines::->bool:false'
+ diff.statGraphWidth:'width of the graph part in --stat output:width:->int'
+ diff.submodule:'output format for submodule differences::->diff.submodule:short'
+ diff.suppressBlankEmpty:'inhibit printing space before empty output lines::->bool:false'
diff.tool:'diff tool to use::__git_difftools'
'difftool.*.cmd:command to invoke for the diff tool::_path_commands'
'difftool.*.path:path to use for the diff tool:absolute diff tool path:_files -g "*(*)"'
difftool.prompt:'prompt before each invocation of the diff tool::->bool:true'
- diff.wordRegex:'regex used to determine what a word is when performing word-by-word diff:regex:->string'
+ diff.wordRegex:'regex used to determine what a word is when performing word-by-word diff:regular expression:->string'
diff.guitool:'diff tool with gui to use::__git_difftools'
fetch.unpackLimit:'maximum number of objects to unpack when fetching:unpack limit:->int'
+ fetch.recurseSubmodules:'recurse into submodules (as needed) when fetching::->fetch.recurseSubmodules:on-demand'
+ fetch.fsckObjects:'check all fetched objects::->bool:false'
+ 'filter.*.clean:command which is used to convert the content of a worktree file to a blob upon checkin::_path_commands'
+ 'filter.*.smudge:command which is used to convert the content of a blob object to a worktree file upon checkout::_path_commands'
format.attach:'use multipart/mixed attachments::->bool:false'
+ format.coverLetter:'control whether to generate a cover-letter when format-patch is invoked::->bool:false'
format.numbered:'use sequence numbers in patch subjects::->format.numbered:auto'
format.headers:'additional email headers to include in email patches:headers:->string'
format.to:'additional email recipients of patches::->string'
@@ -1795,7 +1979,7 @@ _git-config () {
format.signoff:'enable --signoff by default::->bool:false'
'gc.*.reflogexpire:grace period for git reflog expire::->days:90'
'gc.*.reflogexpireunreachable:grace period for git reflog expire for unreachable entries::->days:30'
- gc.aggressiveWindow:'window size used in delta compression algorithm:->int:250'
+ gc.aggressiveWindow:'window size used in delta compression algorithm::->int:250'
gc.auto:'minimum limit for packing loose objects with --auto::->int:6700'
gc.autopacklimit:'minimum limit for packing packs with --auto::->int:50'
gc.packrefs:'allow git gc to run git pack-refs::->gc.packrefs:true'
@@ -1822,8 +2006,9 @@ _git-config () {
'gitcvs.*.dbTableNamePrefix:database table name prefix:prefix:->string'
gitcvs.usecrlfattr:'use end-of-line conversion attributes::->bool:false'
gitcvs.allbinary:'treat all files from CVS as binary::->bool:false'
- gui.commitmsgwidth:'width of commit message window:width:->int:75'
- gui.diffcontext:'number of context lines used in diff window:context:->int:5'
+ gpg.program:'use program instead of "gpg" found on $PATH when making or verifying a PGP signature::_path_commands'
+ gui.commitmsgwidth:'width of commit message window:width::->int:75'
+ gui.diffcontext:'number of context lines used in diff window:context::->int:5'
gui.encoding:'encoding to use for displaying file contents::->encoding'
gui.matchtrackingbranch:'create branches that track remote branches::->bool:false'
gui.newbranchtemplate:'suggested name for new branches:template:->string'
@@ -1833,6 +2018,16 @@ _git-config () {
gui.fastcopyblame:'try harder during blame detection::->bool:false'
gui.copyblamethreshold:'threshold to use in blame location detection:threshold:->string'
gui.blamehistoryctx:'specify radius of history context in days for selected commit::->days'
+ 'guitool.*.argprompt:prompt for arguments:argument prompt:->string'
+ 'guitool.*.cmd:shell command line to execute::_path_commands'
+ 'guitool.*.confirm:show a confirmation dialog::->bool:false'
+ 'guitool.*.needsfile:require that a diff is selected for command to be available::->bool:false'
+ 'guitool.*.noconsole:suppress command output::->bool:false'
+ 'guitool.*.norescan:skip rescanning for changes to the working directory::->bool:false'
+ 'guitool.*.revprompt:request a single valid revision from the user, and set the "REVISION" environment variable::->string'
+ 'guitool.*.prompt:prompt to display:prompt:->string'
+ 'guitool.*.revunmerged:show only unmerged branches in revprompt::->bool:false'
+ 'guitool.*.title:title of prompt dialog:prompt title:->string'
guitool.cmd:'shell command line to execute::_path_commands'
guitool.needsfile:'require that a diff is selected for command to be available::->bool:false'
guitool.noconsole:'suppress command output::->bool:false'
@@ -1843,7 +2038,14 @@ _git-config () {
guitool.revunmerged:'show only unmerged branches in revprompt::->bool:false'
guitool.title:'title of prompt dialog:prompt title:->string'
guitool.prompt:'prompt to display:prompt:->string'
+ grep.extendedRegexp:'enable --extended-regexp option by default (ignored when grep.patternType is set)::->bool:false'
+ grep.lineNumber:'enable -n option by default::->bool:false'
+ grep.patternType:'default matching pattern type::->grep.patternType:default'
help.browser:'browser used to display help in web format::__git_browsers'
+ http.cookiefile:'file containing cookie lines which should be used in the Git http session::_files'
+ help.htmlpath:'location of HTML help::->help.htmlpath'
+ http.lowSpeedLimit:'limit controlling when to abort an HTTP transfer:speed limit:->int'
+ http.lowSpeedTime:'limit controlling when to abort an HTTP transfer:time limit (seconds):->int'
help.format:'default help format used by git help::->help.format'
help.autocorrect:'execute corrected mistyped commands::->bool:false'
http.proxy:'HTTP proxy to use:proxy:_urls'
@@ -1853,8 +2055,9 @@ _git-config () {
http.sslCertPasswordProtected:'prompt for a password for the SSL certificate::->bool:false'
http.sslCAInfo:'file containing CA certificates to verify against for HTTPS:CA certificates file:_files'
http.sslCAPath:'directory containing files with CA certificates to verify against for HTTPS:CA certificates directory:_directories'
- http.maxRequests:'how many HTTP requests to launch in parallel:maximum number of requests:->int:5'
- http.minSessions:'number of curl sessions to keep across requests:mininmum number of sessions:->int:1'
+ http.sslTry:'attempt to use AUTH SSL/TLS and encrypted data transfers when connecting via regular FTP protocol::->bool:false'
+ http.maxRequests:'how many HTTP requests to launch in parallel:maximum number of requests::->int:5'
+ http.minSessions:'number of curl sessions to keep across requests:minimum number of sessions::->int:1'
http.postBuffer:'maximum size of buffer used by smart HTTP transport when POSTing:maximum POST buffer size:->bytes:1m'
http.lowSpeedLimit:'lower limit for HTTP transfer-speed:low transfer-speed limit:->int'
http.lowSpeedTime:'duration for http.lowSpeedLimit:time:->int'
@@ -1882,16 +2085,22 @@ _git-config () {
instaweb.modulepath:'module path for the Apache HTTP-daemon for instaweb:module directory:_directories'
instaweb.port:'port to bind HTTP daemon to for instaweb::_ports'
interactive.singlekey:'accept one-letter input without Enter::->bool:false'
+ log.abbrevCommit:'make git-log, git-show, and git-whatchanged assume --abbrev-commit::->bool:false'
log.date:'default date-time mode::__git_date_formats'
log.decorate:'type of ref names to show::__git_log_decorate_formats'
+ log.mailmap:'make git-log, git-show, and git-whatchanged assume --use-mailmap:->bool:false'
log.showroot:'show initial commit as a diff against an empty tree::->bool:true'
mailinfo.scissors:'remove everything in body before a scissors line::->bool:false'
+ mailmap.blob:'like mailmap.file, but consider the value as a reference to a blob in the repository:blob reference:->string'
mailmap.file:'augmenting mailmap file:mailmap file:_files'
man.viewer:'man viewer to use for help in man format::__git_man_viewers'
'man.*.cmd:the command to invoke the specified man viewer:man command:_path_commands'
'man.*.path:path to use for the man viewer:absolute man tool path:_files -g "*(*)"'
+ merge.branchdesc:'populate the log message with the branch description text as well::->bool:false'
merge.conflictstyle:'style used for conflicted hunks::->merge.conflictstyle:merge'
- merge.log:'include summaries of merged commits in new merge commit messsages::->bool:false'
+ merge.defaultToUpstream:'merge the upstream branches configured for the current branch by default::->bool:false'
+ merge.ff:'allow fast-forward merges::->merge.ff:true'
+ merge.log:'include summaries of merged commits in new merge commit messages::->bool:false'
merge.renameLimit:'number of files to consider when detecting copy/renames during merge:limit:->int'
merge.renormalize:'use canonical representation of files during merge::->bool:false'
merge.stat:'print the diffstat between ORIG_HEAD and merge at end of merge::->bool:true'
@@ -1911,28 +2120,31 @@ _git-config () {
notes.rewrite.rebase:'copy notes from original to rewritten commit when running git rebase::->bool:true'
notes.rewriteMode:'what to do when target commit already has a not when rewriting::->notes.rewriteMode'
notes.rewriteRef:'refname to use when rewriting::->refname'
- pack.window:'size of window:window size:->int:10'
- pack.depth:'maximum delta depth:maximum delta depth:->int:50'
+ pack.window:'size of window:window size::->int:10'
+ pack.depth:'maximum delta depth:maximum delta depth::->int:50'
pack.windowMemory:'window size limit:maximum window size:->bytes:0'
pack.compression:'compression level::->compression:-1'
pack.deltaCacheSize:'maximum amount of memory for caching deltas:maximum delta cache size:->bytes:256m'
- pack.deltaCacheLimit:'maximum size of deltas:maximum delta size:->int:1000'
+ pack.deltaCacheLimit:'maximum size of deltas:maximum delta size::->int:1000'
pack.threads:'number of threads to use for searching for best delta matches:number of threads:->int'
pack.indexVersion:'default pack index version:index version:->string'
pack.packSizeLimit:'maximum size of packs:maximum size of packs:->bytes'
pull.octopus:'default merge strategy to use when pulling multiple branches::__git_merge_strategies'
+ pull.rebase:'rebase branches on top of the fetched branch, instead of merging::->bool:false'
pull.twohead:'default merge strategy to use when pulling a single branch::__git_merge_strategies'
- push.default:'action git push should take if no refspec is given::->push.default'
+ push.default:'action git push should take if no refspec is given::->push.default:matching'
rebase.stat:'show a diffstat of what changed upstream since last rebase::->bool:false'
rebase.autosquash:'autosquash by default::->bool:false'
receive.autogc:'run git gc --auto after receiving data::->bool:true'
receive.fsckObjects:'check all received objects::->bool:true'
+ receive.hiderefs:'string(s) receive-pack uses to decide which refs to omit from its initial advertisement:hidden refs:->string'
receive.unpackLimit:'maximum number of objects received for unpacking into loose objects:unpack limit:->int'
receive.denyDeletes:'deny a ref update that deletes a ref::->bool:false'
receive.denyDeleteCurrent:'deny a ref update that deletes currently checked out branch::->bool:false'
receive.denyCurrentBranch:'deny a ref update of currently checked out branch::->receive.denyCurrentBranch'
receive.denyNonFastForwards:'deny a ref update that is not a fast-forward::->bool:false'
receive.updateserverinfo:'run git update-server-info after receiving data::->bool:false'
+ 'remote.pushdefault:URL of a remote repository to pushto::__git_any_repositories'
'remote.*.url:URL of a remote repository::__git_any_repositories'
'remote.*.pushurl:push URL of a remote repository::__git_any_repositories'
'remote.*.proxy:URL of proxy to use for a remote repository::_urls'
@@ -1948,17 +2160,20 @@ _git-config () {
repack.usedeltabaseoffset:'use delta-base offsets::->bool:true'
rerere.autoupdate:'update index after resolution::->bool:false'
rerere.enabled:'record resolved conflicts::->bool'
+ sendemail.identity:'default identity::__git_sendemail_identities'
sendemail.smtpencryption:'encryption method to use::->sendemail.smtpencryption'
sendemail.aliasesfile:'file containing email aliases:email aliases file:_files'
sendemail.aliasfiletype:'format of aliasesfile::->sendemail.aliasfiletype'
+ sendemail.annotate:'review and edit each patch you are about to send::->bool:false'
sendemail.bcc:'value of Bcc\: header::_email_addresses'
sendemail.cc:'value of Cc\: header::_email_addresses'
sendemail.cccmd:'command to generate Cc\: header with:Cc\: command:_path_commands'
+ sendemail.toccmd:'command to generate To\: header with:To\: command:_path_commands'
sendemail.chainreplyto:'send each email as a reply to the previous one::->bool:false'
sendemail.confirm:'type of confirmation required before sending::->sendemail.confirm:auto'
sendemail.envelopesender:'envelope sender to send emails as::_email_addresses'
sendemail.from:'sender email address::_email_addresses'
- sendemail.multiedit:'edit all files at once::->bool:false'
+ sendemail.multiedit:'edit all files at once::->bool:true'
sendemail.signedoffbycc:'add Signed-off-by\: or Cc\: lines to Cc\: header::->bool:true'
sendemail.smtppass:'password to use for SMTP-AUTH:password:->string'
sendemail.suppresscc:'rules for suppressing Cc\:::->sendemail.suppresscc'
@@ -1966,15 +2181,18 @@ _git-config () {
sendemail.to:'value of To\: header::_email_addresses'
sendemail.smtpdomain:'FQDN to use for HELO/EHLO commands to SMTP server:smtp domain:_domains'
sendemail.smtpserver:'SMTP server to connect to:smtp host:_hosts'
+ sendemail.smtpserveroption:'specifies the outgoing SMTP server option to use:SMTP server option:->string'
sendemail.smtpserverport:'port to connect to SMTP server on:smtp port:_ports'
sendemail.smtpuser:'user to use for SMTP-AUTH:smtp user:_users'
sendemail.thread:'set In-Reply-To\: and References\: headers::->bool:true'
sendemail.validate:'perform sanity checks on patches::->bool:true'
'sendemail.*.aliasesfile:file containing email aliases::_files'
'sendemail.*.aliasfiletype:format of aliasesfile::->sendemail.aliasfiletype'
+ 'sendemail.*.annotate:review and edit each patch you are about to send::bool->false'
'sendemail.*.bcc:value of Bcc\: header::_email_addresses'
'sendemail.*.cc:value of Cc\: header::_email_addresses'
'sendemail.*.cccmd:command to generate Cc\: header with:Cc\: command:_path_commands'
+ 'sendemail.*.tocmd:command to generate To\: header with:To\: command:_path_commands'
'sendemail.*.chainreplyto:send each email as a reply to the previous one::->bool:false'
'sendemail.*.confirm:type of confirmation required before sending::->sendemail.confirm:auto'
'sendemail.*.envelopesender:envelope sender to send emails as::_email_addresses'
@@ -1987,15 +2205,21 @@ _git-config () {
'sendemail.*.to:value of To\: header::_email_addresses'
'sendemail.*.smtpdomain:FQDN to use for HELO/EHLO commands to SMTP server:smtp domain:_domains'
'sendemail.*.smtpserver:SMTP server to connect to:smtp host:_hosts'
+ 'sendemail.*.smtpserveroption:specifies the outgoing SMTP server option to use:SMTP server option:->string'
'sendemail.*.smtpserverport:port to connect to SMTP server on:smtp port:_ports'
'sendemail.*.smtpuser:user to use for SMTP-AUTH:smtp user:_users'
'sendemail.*.thread:set In-Reply-To\: and References\: headers::->bool:true'
'sendemail.*.validate:perform sanity checks on patches::->bool:true'
sendemail.assume8bitEncoding:'encoding to use for non-ASCII messages::__git_encodings'
+ sequence.editor:'text editor used by git rebase -i::_path_commands'
showbranch.default:'default set of branches for git show-branch::->branch'
status.relativePaths:'show paths relative to current directory::->bool:false'
status.showUntrackedFiles:'show untracked files::->status.showUntrackedFiles:normal'
status.submodulesummary:'include submodule summary::->bool:false'
+ status.branch:'show branch and tracking info in short format::->bool:false'
+ status.short:'use short format by default::->bool:false'
+ 'submodule.*.branch:remote branch name for a submodule:branch name:->string'
+ 'submodule.*.fetchRecurseSubmodules:fetch commits of submodules::->bool'
'submodule.*.path:path within project:submodule directory:_directories -qS \:'
'submodule.*.url:URL to update from::__git_any_repositories'
'submodule.*.update:update strategy to use::->submodule.update'
@@ -2009,6 +2233,7 @@ _git-config () {
svn.followparent:'follow parent commit::->bool:true'
svn.authorsFile:'default authors file:authors file:_files'
svn.quiet:'produce less output::->bool:false'
+ 'svn-remote.*.automkdirs:attempt to recreate empty directories that are in the Subversion repository::->bool:true'
'svn-remote.*.noMetadata:disable git-svn-id: lines at end of commits::->bool:false'
'svn-remote.*.useSvmProps:use remappings of URLs and UUIDs from mirrors::->bool:false'
'svn-remote.*.useSvnsyncProps:use remappings of URLs and UUIDs for the svnsync command::->bool:false'
@@ -2017,10 +2242,17 @@ _git-config () {
'svn-remote.*.ignore-paths:regular expression of paths to not check out:regular expression:->string'
'svn-remote.*.url:URL to connect to::_urls'
'svn-remote.*.fetch:fetch specification::__git_ref_specs'
+ 'svn-remote.*.pushurl:URL to push to::_urls'
'svn-remote.*.branches:branch mappings:branch mapping:->string'
'svn-remote.*.tags:tag mappings:tag mapping:->string'
+ 'tar.*.command:specify a shell command through which the tar output generated by git archive should be piped::_path_commands'
+ 'tar.*.remote:enable <format> for use by remote clients via git-upload-archive::->bool'
tar.umask:'umask to apply::->umask'
- transfer.unpackLimit:'default value for fetch.unpackLimit and receive.unpackLimit:unpack limit:->int:100'
+ transfer.unpackLimit:'default value for fetch.unpackLimit and receive.unpackLimit:unpack limit::->int:100'
+ transfer.fsckObjects:'check all objects::->bool:false'
+ transfer.hiderefs:'string(s) to decide which refs to omit from initial advertisements:hidden refs:->string'
+ uploadpack.hiderefs:'string(s) upload-pack uses to decide which refs to omit from its initial advertisement:hidden refs:->string'
+ uploadpack.allowtipsha1inwant:'allow upload-pack to accept a fetch request that asks for an object at the tip of a hidden ref::->bool:false'
'url.*.insteadOf:string to start URLs with:prefix:->string'
'url.*.pushInsteadOf:string to start URLs to push to with:prefix:->string'
user.email:'email address used for commits::_email_addresses'
@@ -2061,10 +2293,13 @@ _git-config () {
'color.grep.:git-grep-specific color option'
'color.interactive.:interaction-specific color option'
'color.status.:git-status-specific color option'
+ 'credential.*.:${${line[1]#credential.}%.*}-specific option'
+ 'filter.*.:${${line[1]#filter.}%.*} driver option'
+ 'diff.*.:${${line[1]#diff.}%.*} driver option'
'difftool.*.:${${line[1]#difftool.}%.*}-specific option'
'gc.*.:${${line[1]#gc.}%.*}-specific gc option'
'gitcvs.*.:gitcvs ${${line[1]#gitcvs.}%.*}-specific option'
- 'guitool.*.:${${line[1]#gc.}%.*}-specific option'
+ 'guitool.*.:${${line[1]#guitool.}%.*}-specific option'
'man.*.:${${line[1]#man.}%.*}-specific man option'
'merge.*.:${${line[1]#merge.}%.*}-specific merge option'
'mergetool.*.:${${line[1]#mergetool.}%.*}-specific option'
@@ -2110,6 +2345,9 @@ _git-config () {
(browser.)
__git_browsers -S . && ret=0
;;
+ (credential.)
+ _urls && ret=0
+ ;;
(difftool.)
__git_difftools -S . && ret=0
;;
@@ -2157,6 +2395,7 @@ _git-config () {
sections=(
advice:'options controlling advice'
core:'options controlling git core'
+ credential:'credential options'
add:'git add options'
alias:'command aliases'
am:'git am options'
@@ -2165,12 +2404,14 @@ _git-config () {
browser:'browser options'
clean:'git clean options'
color:'color options'
+ column:'column options'
commit:'git commit options'
diff:'diff options'
difftool:'difftools'
fetch:'git fetch options'
format:'format options'
gc:'git gc options'
+ gpg:'gpg options'
gitcvs:'git-cvs options'
gui:'git gui options'
guitool:'git gui tool options'
@@ -2204,6 +2445,7 @@ _git-config () {
submodule:'git submodule options'
tar:'git tar-tree options'
transfer:'options controlling transfers'
+ uploadpack:'git upload-pack options'
url:'URL prefixes'
user:'options controlling user identity'
web:'web options'
@@ -2330,6 +2572,22 @@ _git-config () {
always:"always $parts[2]" \
{auto,true,yes,on}:$parts[2] && ret=0
;;
+ (column)
+ __git_config_values -- "$current" "$parts[5]" \
+ always:'always show in columns' \
+ never:'never show in columns' \
+ auto:'show in columns if the output is to the terminal' \
+ column:'fill columns before rows (implies "always")' \
+ row:'fill rows before columns (implies "akways")' \
+ plain:'show in one column (implies "always")' && ret=0
+ ;;
+ (commit.cleanup)
+ __git_config_values -- "$current" "$parts[5]" \
+ strip:'remove both whitespace and commentary lines' \
+ whitespace:'remove leading and trailing whitespace lines' \
+ verbatim:'no not change the commit message at all' \
+ default:'act as '\''strip'\'' if the message is to be edited and as '\''whitespace'\'' otherwise' && ret=0
+ ;;
(compression)
__git_compression_levels && ret=0
;;
@@ -2337,6 +2595,11 @@ _git-config () {
__git_config_booleans "$current" "$parts[5]" "$parts[2]" \
input:'convert CRLFs on input only' && ret=0
;;
+ (core.checkstat)
+ __git_config_values -- "$current" "$parts[5]" \
+ default:'check all fields' \
+ minimal:'check fewer fields' && ret=0
+ ;;
(core.createObject)
__git_config_values -- "$current" "$parts[5]" \
rename:'rename source objects' \
@@ -2378,10 +2641,23 @@ _git-config () {
__git_guard_number 'number of days'
fi
;;
+ (diff.algorithm)
+ __git_config_values -- "$current" "$parts[5]" \
+ default:'basic greedy diff algorithm' \
+ myers:'basic greedy diff algorithm' \
+ minimal:'spend extra time to make sure the smallest possible diff is produced' \
+ patience:'generate diffs with patience algorithm' \
+ histogram:'generate diffs with histogram algorithm' && ret=0
+ ;;
(diff.renames)
__git_config_booleans "$current" "$parts[5]" "$parts[2]" \
{copies,copy}:'try to detect both renames and copies' && ret=0
;;
+ (diff.submodule)
+ __git_config_values -- "$current" "$parts[5]" \
+ short:'show pairs of commit name' \
+ log:'list commits like git submodule does' && ret=0
+ ;;
(encoding)
__git_encodings && ret=0
;;
@@ -2391,6 +2667,10 @@ _git-config () {
crlf:'use CR+LF' \
native:'use line ending of platform' && ret=0
;;
+ (fetch.recurseSubmodules)
+ __git_config_booleans "$current" "$parts[5]" "$parts[2]" \
+ on-demand:'only when submodule reference in superproject is updated' && ret=0
+ ;;
(format.numbered)
__git_config_booleans "$current" "$parts[5]" "$parts[2]" \
auto:'use sequence numbers if more than one patch' && ret=0
@@ -2411,12 +2691,25 @@ _git-config () {
SQLite:'use the SQLite database driver' \
Pg:'use the Pg database driver' && ret=0
;;
+ (grep.patternType)
+ __git_config_values -- "$current" "$parts[5]" \
+ basic:'use --basic-regexp' \
+ default:'use default' \
+ extended:'use --extended-regexp' \
+ fixed:'use --fixed-strings' \
+ perl:'use --perl-regexp' && ret=0
+ ;;
(help.format)
__git_config_values -- "$current" "$parts[5]" \
man:'use man' \
info:'use info' \
{web,html}:'use HTML' && ret=0
;;
+ (help.htmlpath)
+ _alternative \
+ 'path::_files -/' \
+ 'url::_urls' && ret=0
+ ;;
(imap.authMethod)
__git_config_values -- "$current" "$parts[5]" \
CRAM-MD5:'use CRAM-MD5' && ret=0
@@ -2435,11 +2728,15 @@ _git-config () {
merge:'use standard merge style' \
diff3:'use diff3 style' && ret=0
;;
+ (merge.ff)
+ __git_config_booleans "$current" "$parts[5]" "$parts[2]" \
+ only:'only allow fast-forward merges (equivalent to --ff-only)' && ret=0
+ ;;
(merge.verbosity)
__git_config_values -t verbosity-levels -l 'verbosity level' -- "$current" "$parts[5]" \
- 0:'only final error message if conflicts were detected'
- 1:'conflicts'
- 2:'conflicts and file changes'
+ 0:'only final error message if conflicts were detected' \
+ 1:'conflicts' \
+ 2:'conflicts and file changes' \
5:'debugging information' && ret=0
;;
(notes.rewriteMode)
@@ -2455,7 +2752,8 @@ _git-config () {
__git_config_values -- "$current" "$parts[5]" \
nothing:'do not push anything' \
matching:'push all matching branches' \
- tracking:'push current branch to its upstream branch' \
+ upstream:'push current branch to its upstream branch' \
+ simple:'like upstream, but only if local and remote names are the same' \
current:'push current branch to branch of same name' && ret=0
;;
(receive.denyCurrentBranch)
@@ -2513,7 +2811,7 @@ _git-config () {
(umask)
_alternative \
'values:value:(user)' \
- 'umasks::__git_guard_number umask' && ret=0
+ 'umasks: :__git_guard_number umask' && ret=0
;;
esac
;;
@@ -2548,7 +2846,9 @@ _git-fast-export () {
'-C-[detect copies as well as renames with given scope]: :__git_guard_number size' \
'--export-marks=[dump internal marks table when complete]: :_files' \
'--import-marks=[load marks before processing input]: :_files' \
+ '--import-marks-if-exists=[silently skip if files does not exist]: :_files' \
'--fake-missing-tagger=[fake a tagger when tags lack them]' \
+ '--use-done-feature[start with a "feature done" stanza, and terminate with a "done" command]' \
'--no-data[do not output blocb objects, instead referring to them via their SHA-1 hash]' \
'--full-tree[output full tree for each commit]' \
'*: :__git_commit_ranges'
@@ -2557,9 +2857,11 @@ _git-fast-export () {
(( $+functions[_git-fast-import] )) ||
_git-fast-import () {
_arguments -S -A '-*' \
+ '--cat-blob-fd=-[write responses to cat-blob and ls queries to <fd> instead of stdout]:file descriptor' \
'--date-format=-[type of dates used in input]:format:((raw\:"native Git format"
rfc2822\:"standard email format from RFC 2822"
now\:"use current time and timezone"' \
+ '--done[terminate with error if there is no "done" command at the end of the stream]' \
'--force[force updating modified existing branches]' \
'--max-pack-size=-[maximum size of each packfile]: :__git_guard_bytes' \
'--big-file-threshold=-[maximum size of blob to create deltas for]: :__git_guard_bytes' \
@@ -2601,6 +2903,7 @@ _git-mergetool () {
# TODO: Only complete files with merge conflicts.
_arguments -S -A '-*' \
'(-t --tool)'{-t,--tool=}'[merge resolution program to use]: :__git_mergetools' \
+ '--tool-help[print a list of merge tools that may be used with "--tool"]' \
'(-y --no-prompt --prompt)'{-y,--no-prompt}'[do not prompt before invocation of merge resolution program]' \
'(-y --no-prompt)--prompt[prompt before invocation of merge resolution program]' \
'*:conflicted file:_files'
@@ -2668,7 +2971,7 @@ _git-reflog () {
'--expire-unreachable=-[prune entries older than given time and unreachable]: :__git_datetimes' \
'--all[prune all refs]' \
'--updateref[update ref with SHA-1 of top reflog entry after expiring or deleting]' \
- '--rewrite[adjust reflog entries to ensure old SHA-1 points to new SHA-1 of previous entry after expring or deleting]' \
+ '--rewrite[adjust reflog entries to ensure old SHA-1 points to new SHA-1 of previous entry after expiring or deleting]' \
'--verbose[output additional information]' && ret=0
;;
(delete)
@@ -2676,7 +2979,7 @@ _git-reflog () {
_arguments -C -S \
'(-n --dry-run)'{-n,--dry-run}'[undocumented]' \
'--updateref[update ref with SHA-1 of top reflog entry after expiring or deleting]' \
- '--rewrite[adjust reflog entries to ensure old SHA-1 points to new SHA-1 of previous entry after expring or deleting]' \
+ '--rewrite[adjust reflog entries to ensure old SHA-1 points to new SHA-1 of previous entry after expiring or deleting]' \
'*:: :->reflog-entry' && ret=0
case $state in
@@ -2700,10 +3003,9 @@ _git-reflog () {
(( $+functions[_git-relink] )) ||
_git-relink () {
- # TODO: --help is undocumented.
_arguments \
'--safe[stop if two objects with the same hash exist but have different sizes]' \
- '--help[display help]' \
+ '(-)'{-h,--help}'[display usage information]' \
': :_directories' \
': :_directories' \
'*: :_directories'
@@ -2856,31 +3158,33 @@ _git-blame () {
'-l[show long rev]' \
'-t[show raw timestamp]' \
'-S[use revs from revs-file]:revs-file:_files' \
- '--reverse[walk histor forward instead of backward]' \
+ '--reverse[walk history forward instead of backward]' \
'(-p --porcelain)'{-p,--porcelain}'[show results designed for machine processing]' \
+ '--line-porcelain[show results designed for machine processing but show commit information for every line]' \
'--incremental[show results incrementally for machine processing]' \
'--contents[annotate against the given file if no rev is specified]: :_files' \
'(-h --help)'{-h,--help}'[show help message]' \
'-c[use same output format as git annotate]' \
'--score-debug[output debugging information relating to -C and -M line movement]' \
+ '(-e --show-email)'{-e,--show-email}'[show the author email instead of the author name]' \
'(-f --show-name)'{-f,--show-name}'[show the filename of the original commit]' \
'(-n --show-number)'{-n,--show-number}'[show the line number in the original commit]' \
'-s[suppress author name and timestamp]' \
'-w[ignore whitespace when finding lines]' \
$revision_options \
- ': :__git_cached_files' \
- ':: :__git_revisions' && ret=0
+ ':: :__git_revisions' \
+ ': :__git_cached_files' && ret=0
case $state in
(line-range)
if compset -P '([[:digit:]]#|/[^/]#(\\?[^/]#)#/),'; then
_alternative \
- 'line-numbers::__git_guard_number "line number"' \
+ 'line-numbers: :__git_guard_number "line number"' \
'regexes::_guard "(/[^/]#(\\?[^/]#)#(/|)|)" regex' \
'offsets::_guard "([+-][[:digit:]]#|)" "line offset"' && ret=0
else
_alternative \
- 'line-numbers::__git_guard_number "line number"' \
+ 'line-numbers: :__git_guard_number "line number"' \
'regexes::_guard "(/[^/]#(\\?[^/]#)#(/|)|)" regex' && ret=0
fi
;;
@@ -2903,17 +3207,22 @@ _git-cherry () {
(( $+functions[_git-count-objects] )) ||
_git-count-objects () {
_arguments \
- '(-v --verbose)'{-v,--verbose}'[also report number of in-pack objects and objects that can be removed]'
+ '(-v --verbose)'{-v,--verbose}'[also report number of in-pack objects and objects that can be removed]' \
+ {-H,--human-readable}'[Print sizes in human readable format]'
}
(( $+functions[_git-difftool] )) ||
_git-difftool () {
# TODO: Is this fine, or do we need to modify the context or similar?
_git-diff \
+ '--dir-diff[diff a whole tree by prepare a temporary copy]' \
'(-y --no-prompt --prompt)'{-y,--no-prompt}'[do not prompt before invocation of diff tool]' \
'(-y --no-prompt)--prompt[prompt before invocation of diff tool]' \
'(-t --tool -x --extcmd)'{-t,--tool=-}'[merge resolution program to use]: :__git_difftools' \
'(-t --tool -x --extcmd)'{-x,--extcmd=-}'[custom diff command to use]: :_path_commands' \
+ '--tool-help[print a list of diff tools that may be used with --tool]' \
+ '(--symlinks)--no-symlinks[make copies of instead of symlinks to the working tree]' \
+ '(---no-symlinks)--symlinks[make symlinks to instead of copies of the working tree]' \
'(-g --gui)'{-g,--gui}'[use diff.guitool instead of diff.tool]'
}
@@ -2922,6 +3231,8 @@ _git-fsck () {
# TODO: -v is undocumented.
_arguments -w -S -s \
'--unreachable[show objects that are unreferenced in the object database]' \
+ '(--dangling --no-dangling)--dangling[print dangling objects (default)]' \
+ '(--dangling --no-dangling)--no-dangling[do not print dangling objects]' \
'--root[show root nodes]' \
'--tags[show tags]' \
'--cache[consider objects recorded in the index as head nodes for reachability traces]' \
@@ -2941,10 +3252,11 @@ _git-get-tar-commit-id () {
(( $+functions[_git-help] )) ||
_git-help () {
_arguments -w -S -s \
- '( -i --info -m --man -w --web)'{-a,--all}'[show all available commands]' \
- '(-a --all -m --man -w --web)'{-i,--info}'[show all available commands]' \
- '(-a --all -i --info -w --web)'{-m,--man}'[show all available commands]' \
- '(-a --all -i --info -m --man )'{-w,--web}'[show all available commands]' \
+ '( -g --guides -i --info -m --man -w --web)'{-a,--all}'[show all available commands]' \
+ '(-a --all -g --guides -m --man -w --web)'{-i,--info}'[show all available commands]' \
+ '(-a --all -g --guides -i --info -w --web)'{-m,--man}'[show all available commands]' \
+ '(-a --all -g --guides -i --info -m --man )'{-w,--web}'[show all available commands]' \
+ '(-g --guides)'{-g,--guides}'[prints a list of useful guides on the standard output]' \
': :_git_commands'
}
@@ -3005,7 +3317,8 @@ _git-rerere () {
'clear[reset metadata used by rerere]' \
'forget[resets metadata used by rerere for specific conflict]: :__git_cached_files' \
'diff[output diffs for the current state of the resolution]' \
- 'status[like diff, but only output filesames]' \
+ 'status[print paths with conflicts whose merge resolution rerere will record]' \
+ 'remaining[print paths with conflicts that have not been autoresolved by rerere]' \
'gc[prune old records of conflicted merges]' && ret=0
;;
esac
@@ -3063,6 +3376,7 @@ _git-rev-parse () {
'( --symbolic-full-name)--symbolic[output in a format as true to input as possible]' \
'(--symbolic )--symbolic-full-name[same as --symbolic, but omit non-ref inputs]' \
'--abbrev-ref=-[a non-ambiguous short name of object]::mode:(strict loose)' \
+ '--disambiguate=-[show every object whose name begins with the given prefix]:prefix' \
'--all[show all refs found in refs/]' \
'--branches=-[show branch refs found in refs/heads/]::shell glob pattern' \
'--tags=-[show tag refs found in refs/tags/]::shell glob pattern' \
@@ -3078,6 +3392,7 @@ _git-rev-parse () {
'(--revs-only --no-revs --flags --no-flags --verify)--short=-[show only shorter unique name]:: :__git_guard_number length' \
'(--since --after)'{--since=-,--after=-}'[show --max-age= parameter corresponding given date string]:datestring' \
'(--until --before)'{--until=-,--before=-}'[show --min-age= parameter corresponding given date string]:datestring' \
+ '--resolve-git-dir[check if <path> is a valid repository or gitfile and print location]:git dir:_files -/' \
'*: :__git_objects' && ret=0
fi
@@ -3105,7 +3420,7 @@ _git-show-branch () {
'(--no-name )--sha1-name[name commits with unique prefix of object names]' \
'--topics[show only commits that are NOT on the first branch given]' \
'( --no-color)--color[color status sign of commits]:: :__git_color_whens' \
- '(--color )--no-color[do not color statis sign of commits]' \
+ '(--color )--no-color[do not color status sign of commits]' \
'*: :__git_revisions' \
- reflogs \
'(-g --reflog)'{-g,--reflog=}'[show reflog entries for given ref]:: :->limit-and-base' \
@@ -3115,7 +3430,7 @@ _git-show-branch () {
(limit-and-base)
if compset -P '[[:digit:]]##,'; then
_alternative \
- 'counts::__git_guard_number count' \
+ 'counts: :__git_guard_number count' \
'dates::__git_datetimes' && ret=0
else
__git_guard_number limit
@@ -3128,9 +3443,8 @@ _git-show-branch () {
(( $+functions[_git-verify-tag] )) ||
_git-verify-tag () {
- # TODO: -v and --verbose are undocumented.
_arguments -w -S -s \
- '(-v --verbose)'{-v,--verbose}'[output additional information]' \
+ '(-v --verbose)'{-v,--verbose}'[print the contents of the tag object before validating it]' \
'*: :__git_tags'
}
@@ -3257,14 +3571,18 @@ _git-send-email () {
'--subject=[specify the initial subject of the email thread]:subject' \
'--to=[specify the primary recipient of the emails]: :_email_addresses' \
'--8bit-encoding=[encoding to use for non-ASCII messages]: :__git_encodings' \
+ '--compose-encoding=[encoding to use for compose messages]: :__git_encodings' \
'--envelope-sender[specify the envelope sender used to send the emails]: :_email_addresses' \
'--smtp-encryption=[specify encryption method to use]: :__git_sendemail_smtpencryption_values' \
'--smtp-domain=[specify FQDN used in HELO/EHLO]: :_domains' \
'--smtp-pass=[specify password to use for SMTP-AUTH]::password' \
'--smtp-server=[specify SMTP server to connect to]:smtp server:_hosts' \
'--smtp-server-port=[specify port to connect to SMTP server on]:smtp port:_ports' \
+ '--smtp-server-option=[specify the outgoing SMTP server option to use]:SMPT server option' \
'--smtp-user=[specify user to use for SMTP-AUTH]:smtp user:_users' \
+ '--smtp-debug=[enable or disable debug output]:smtp debug:((0\:"disable" 1\:"enable"))' \
'--cc-cmd=[specify command to generate Cc\: header with]:Cc\: command:_path_commands' \
+ '--to-cmd=[specify command to generate To\: header with]:To\: command:_path_commands' \
'( --no-chain-reply-to)--chain-reply-to[send each email as a reply to previous one]' \
'(--chain-reply-to )--no-chain-reply-to[send all emails after first as replies to first one]' \
'--identity=[specify configuration identity]: :__git_sendemail_identities' \
@@ -3282,7 +3600,7 @@ _git-send-email () {
'--quiet[be less verbose]' \
'( --no-validate)--validate[perform sanity checks on patches]' \
'(--validate )--validate[do not perform sanity checks on patches]' \
- '--force[send emails even if safetiy checks would prevent it]' \
+ '--force[send emails even if safety checks would prevent it]' \
'*: :_files'
}
@@ -3558,8 +3876,6 @@ _git-apply () {
'--unidiff-zero[disable unified-diff-context check]' \
'--apply[apply patches that would otherwise not be applied]' \
'--no-add[ignore additions made by the patch]' \
- '*--exclude=[skip files matching specified pattern]:pattern' \
- '*--include=[include files matching specified pattern]:pattern' \
'--inaccurate-eof[work around missing-new-line-at-EOF bugs]' \
'(-v --verbose)'{-v,--verbose}'[display progress on stderr]' \
'--recount[do not trust line counts in hunk headers]' \
@@ -3749,9 +4065,10 @@ _git-prune-packed () {
(( $+functions[_git-read-tree] )) ||
_git-read-tree () {
- local trivial_opt= aggressive_opt=
+ local trivial_opt= aggressive_opt= dryrun_opt=
if (( words[(I)-m] )); then
+ dryrun_opt='--dry-run[report if a merge would fail without touching the index or the working tree]'
trivial_opt='--trivial[restrict three-way merge to only happen if no file-level merging is required]'
aggressive_opt='--aggressive[try harder to resolve merge conflicts]'
fi
@@ -3775,12 +4092,14 @@ _git-read-tree () {
'(-m --prefix)--reset[perform a merge, not just a read, ignoring unmerged entries]' \
'(-m --reset 2 3)--prefix=-[read the contents of specified tree-ish under specified directory]:prefix:_directories -r ""' \
$ui_opts \
+ $dryrun_opt \
'-v[display progress on standard error]' \
$trivial_opt \
$aggressive_opt \
$exclude_per_directory_opt \
'--index-output=[write index in the named file instead of $GIT_INDEX_FILE]: :_files' \
'--no-sparse-checkout[display sparse checkout support]' \
+ '--empty[instead of reading tree object(s) into the index, just empty it]' \
'1:first tree-ish to be read/merged:__git_tree_ishs' \
'2::second tree-ish to be read/merged:__git_tree_ishs' \
'3::third tree-ish to be read/merged:__git_tree_ishs'
@@ -3789,8 +4108,10 @@ _git-read-tree () {
(( $+functions[_git-symbolic-ref] )) ||
_git-symbolic-ref () {
_arguments -w -S -s \
+ '(-d --delete)'{-d,--delete}'[delete symbolic ref]' \
'(-q --quiet)'{-q,--quiet}'[do not issue error if specified name is not a symbolic ref]' \
- '-m[update reflog for specified name with specied reason]:reason for update' \
+ '--short[shorten the ref name (eg. refs/heads/master -> master)]' \
+ '-m[update reflog for specified name with specified reason]:reason for update' \
':symbolic reference:__git_heads' \
':: :__git_references'
}
@@ -3845,7 +4166,7 @@ _git-update-index () {
(( $+functions[_git-update-ref] )) ||
_git-update-ref () {
_arguments -w -S -s \
- '-m[update reflog for specified name with specied reason]:reason for update' \
+ '-m[update reflog for specified name with specified reason]:reason for update' \
'(:)-d[delete given reference after verifying its value]:symbolic reference:__git_revisions:old reference:__git_revisions' \
'--no-deref[overwrite ref itself, not what it points to]' \
':symbolic reference:__git_revisions' \
@@ -3871,8 +4192,8 @@ _git-cat-file () {
'(- 1)-e[exit with zero status if object exists]' \
'(- 1)-p[pretty-print given object]' \
'(- 1)--textconv[show content as transformed by a textconv filter]' \
- '(- :)--batch[print SHA1, type, size, and contents of each object provided on stdin]' \
- '(- :)--batch-check[print SHA1, type, and size of each object provided on stdin]' \
+ '(- :)--batch=-[print SHA1, type, size and contents (or in <format>) of objects given on stdin]:format' \
+ '(- :)--batch-check=-[print SHA1, type and size (or in <format>) of objects given on stdin]:format' \
'(-):object type:(blob commit tag tree)' \
': :__git_objects'
}
@@ -4015,6 +4336,8 @@ _git-ls-remote () {
'(-h --heads)'{-h,--heads}'[show only refs under refs/heads]' \
'(-t --tags)'{-t,--tags}'[show only refs under refs/tags]' \
'(-u --upload-pack)'{-u,--upload-pack=-}'[specify path to git-upload-pack on remote side]:remote path' \
+ '--exit-code[exit with status 2 when no matching refs are found in the remote repository]' \
+ '--get-url[expand the URL of the given repository taking into account any "url.<base>.insteadOf" config setting]' \
': :__git_any_repositories' \
'*: :__git_references'
}
@@ -4051,6 +4374,7 @@ _git-merge-base () {
_arguments -w -S -s \
'(-a --all)'{-a,--all}'[display all common ancestors]' \
'--octopus[compute best common ancestors of all supplied commits]' \
+ '--is-ancestor[tell if A is ancestor of B (by exit status)]' \
'(-)--independent[display minimal subset of supplied commits with same ancestors]' \
': :__git_commits' \
'*: :__git_commits'
@@ -4092,7 +4416,7 @@ _git-rev-list () {
'--timestamp[print raw commit timestamp]' \
'( --bisect-vars --bisect-all)--bisect[show only middlemost commit object]' \
'(--bisect)--bisect-vars[same as --bisect, displaying shell-evalable code]' \
- '(--bisect)--bisect-all[display all commit objects beteen included and excluded commits]' \
+ '(--bisect)--bisect-all[display all commit objects between included and excluded commits]' \
'*:: :->commit-or-path' && ret=0
case $state in
@@ -4122,7 +4446,7 @@ _git-show-ref () {
- list \
'(-h --head)'{-h,--head}'[show HEAD reference]' \
'--tags[show only refs/tags]' \
- '--heads[show only refs/heads]' \
+ '--heads[show only HEAD and refs under refs/heads]' \
'(-d --dereference)'{-d,--dereference}'[dereference tags into object IDs as well]' \
'(-s --hash)'{-s+,--hash=-}'[only show the SHA-1 hash, not the reference name]:: :__git_guard_number length' \
'--verify[enable stricter reference checking]' \
@@ -4167,6 +4491,7 @@ _git-daemon () {
# TODO: --interpolated-path should complete %H, %CH, %IP, %P, and %D.
_arguments -S \
'--strict-paths[match paths exactly]' \
+ '--access-hook=-[allow an external tool to accept or decline service]:path:_directories' \
'--base-path=-[remap all the path requests as relative to the given path]:path:_directories' \
'--base-path-relaxed[allow lookup of base path witout prefix]' \
'--interpolated-path=-[dynamically construct alternate paths]:path:_directories' \
@@ -4189,6 +4514,8 @@ _git-daemon () {
'--disable=-[disable site-wide service]: :__git_daemon_service' \
'--allow-override[allow overriding site-wide service]: :__git_daemon_service' \
'--forbid-override[forbid overriding site-wide service]: :__git_daemon_service' \
+ '(--no-informative-errors)--informative-errors[report more verbose errors to the client]' \
+ '(--informative-errors)--no-informative-errors[report all errors as "access denied" to the client]' \
'*:repository:_directories'
}
@@ -4355,7 +4682,9 @@ _git-check-attr () {
fi
_arguments -C \
+ {-a,--all}'[list all attributes that are associated with the specified paths]' \
'--stdin[read file names from stdin instead of from command line]' \
+ '--cached[consider .gitattributes in the index only, ignoring the working tree.]' \
$z_opt \
'(-)--[interpret preceding arguments as attributes and following arguments as path names]' \
'*:: :->attribute-or-file' && ret=0
@@ -4391,7 +4720,10 @@ _git-check-attr () {
_git-check-ref-format () {
_arguments \
'-h[display usage information]' \
- '--print[display canonicalized name of hypothetical reference of given name]' \
+ '(--no-allow-onelevel)--allow-onelevel[accept one-level refnames]' \
+ '(--allow-onelevel)--no-allow-onelevel[do not accept one-level refnames]' \
+ '--refspec-pattern[interpret <refname> as a reference name pattern for a refspec]' \
+ '--normalize[Normalize refname by removing leading slashes]' \
'--branch[expand previous branch syntax]' \
': :__git_references'
}
@@ -4446,7 +4778,8 @@ _git-patch-id () {
(( $+functions[_git-stripspace] )) ||
_git-stripspace () {
_arguments \
- '(-s --strip-comments)'{-s,--strip-comments}'[also strip lines starting with #]'
+ '(-s --strip-comments)'{-s,--strip-comments}'[also strip lines starting with #]' \
+ '(-c --comment-lines)'{-c,--comment-lines}'[prepend comment character and blank to each line]'
}
# INTERNAL GIT COMPLETION FUNCTIONS
@@ -4576,7 +4909,7 @@ _git_commands () {
notes:'add or inspect object notes'
pull:'fetch from and merge with another repository or local branch'
push:'update remote refs along with associated objects'
- rebase:'fasforward-port local commits to the updated upstream head'
+ rebase:'forward-port local commits to the updated upstream head'
reset:'reset current HEAD to specified state'
revert:'revert existing commits'
rm:'remove files from the working tree and from the index'
@@ -4592,7 +4925,7 @@ _git_commands () {
config:'get and set repository or global options'
fast-export:'data exporter'
fast-import:'import information into git directly'
- filter-branch:'rewrite branchers'
+ filter-branch:'rewrite branches'
mergetool:'run merge conflict resolution tools to resolve merge conflicts'
pack-refs:'pack heads and tags for efficient repository access'
prune:'prune all unreachable objects from the object database'
@@ -4692,6 +5025,8 @@ _git_commands () {
local -a plumbing_internal_helper_commands
plumbing_internal_helper_commands=(
check-attr:'display gitattributes information'
+ check-ignore:'debug gitignore/exclude files'
+ check-mailmap:'show canonical names and email addresses of contacts'
check-ref-format:'ensure that a reference name is well formed'
fmt-merge-msg:'produce merge commit message'
mailinfo:'extract patch and authorship from a single email message'
@@ -4757,7 +5092,13 @@ __git_aliases () {
(( $+functions[__git_extract_aliases] )) ||
__git_extract_aliases () {
- aliases=(${^${${(0)"$(_call_program aliases "git config -z --get-regexp '^alias.'")"}#alias.}/$'\n'/:alias for \'}\')
+ local -a tmp
+ tmp=(${${(0)"$(_call_program aliases "git config -z --get-regexp '^alias.'")"}#alias.})
+ if (( ${#tmp} > 0 )); then
+ aliases=(${^tmp/$'\n'/:alias for \'}\')
+ else
+ aliases=()
+ fi
}
(( $+functions[__git_date_formats] )) ||
@@ -4863,7 +5204,7 @@ __git_ignore_submodules_whens () {
whens=(
none:'submodule is dirty when it contains untracked or modified files'
- untracked:'submodule is dirty when it contains untracket files'
+ untracked:'submodule is dirty when it contains untracked files'
dirty:'ignore all changes to submodules, showing only changes to commits stored in superproject'
all:'ignore all changes to submodules (default)')
@@ -5070,6 +5411,17 @@ __git_remote_branch_names () {
_wanted remote-branch-names expl 'remote branch name' compadd $* - $branch_names
}
+(( $+functions[__git_remote_branch_names_noprefix] )) ||
+__git_remote_branch_names_noprefix () {
+ local expl
+ declare -a heads
+
+ branch_names=(${${${(f)"$(_call_program remote-branch-refs-noprefix git for-each-ref --format='"%(refname)"' refs/remotes 2>/dev/null)"}##*/}:#HEAD})
+ __git_command_successful $pipestatus || return 1
+
+ _wanted remote-branch-names-noprefix expl 'remote branch name' compadd $* - $branch_names
+}
+
(( $+functions[__git_commits] )) ||
__git_commits () {
# TODO: deal with things that __git_heads and __git_tags has in common (i.e.,
@@ -5267,15 +5619,6 @@ __git_remote_references () {
__git_references
}
-(( $+functions[__git_note_references] )) ||
-__git_local_references () {
- local references expl
-
- references=(${${(M)${${(f)"$(_call_program references git ls-remote ./. 2>/dev/null)"}#*$'\t'}:#refs/notes/*}#refs/notes/})
- __git_command_successful $pipestatus || return 1
-
- _wanted references expl reference compadd - $references
-}
(( $+functions[__git_notes_refs] )) ||
__git_notes_refs () {
local expl
@@ -5339,7 +5682,7 @@ __git_files () {
# TODO: --directory should probably be added to $opts when --others is given.
local pref=$gitcdup$gitprefix$PREFIX
- files=(${(0)"$(_call_program files git ls-files -z --exclude-standard $opts -- ${pref:+$pref\*} 2>/dev/null)"})
+ files=(${(0)"$(_call_program files git ls-files -z --exclude-standard $opts -- ${pref:+$pref\\\*} 2>/dev/null)"})
__git_command_successful $pipestatus || return
# _wanted $tag expl $description _files -g '{'${(j:,:)files}'}' $compadd_opts -
@@ -5559,19 +5902,29 @@ __git_setup_log_options () {
'(- *)-h[display help]'
'( --no-decorate)--decorate=-[print out ref names of any commits that are shown]: :__git_log_decorate_formats'
'(--decorate )--no-decorate[do not print out ref names of any commits that are shown]'
+ '( --no-follow)--follow[follow renames]'
+ '(--follow )--no-follow[do not follow renames]'
'--source[show which ref each commit is reached from]')
}
(( $+functions[__git_setup_diff_options] )) ||
__git_setup_diff_options () {
- local diff_types='(-p -u --patch -U --unified --raw --patch-with-raw --stat --numstat --shortstat --dirstat --dirstat-by-file --summary --patch-with-stat --name-only --name-status --cumulative)'
+ local diff_types='(-p -u --patch -U --unified --raw --patch-with-raw --stat --numstat --shortstat --dirstat --dirstat-by-file --summary --patch-with-stat --name-only --name-status --cumulative -s --no-patch)'
diff_options=(
$diff_types{-p,-u,--patch}'[generate diff in patch format]'
$diff_types{-U,--unified=}'[generate diff with given lines of context]: :__git_guard_number lines'
$diff_types'--raw[generate default raw diff output]'
$diff_types'--patch-with-raw[generate patch but also keep the default raw diff output]'
- '--patience[generate diffs with patience algorithm]'
+ $diff_types{-s,--no-patch}'[suppress diff output]'
+ '(--minimal --patience --histogram --diff-algorithm)--minimal[spend extra time to make sure the smallest possible diff is producedm]'
+ '(--minimal --patience --histogram --diff-algorithm)--patience[generate diffs with patience algorithm]'
+ '(--minimal --patience --histogram --diff-algorithm)--histogram[generate diffs with histogram algorithm]'
+ '(--minimal --patience --histogram --diff-algorithm)--diff-algorithm=[choose a diff algorithm]:diff algorithm:((default\:"basic greedy diff algorithm"
+ myers\:"basic greedy diff algorithm"
+ minimal\:"spend extra time to make sure the smallest possible diff is produced"
+ patience\:"generate diffs with patience algorithm"
+ histogram\:"generate diffs with histogram algorithm"))'
$diff_types'--stat=-[generate diffstat instead of patch]:: :__git_guard_diff-stat-width'
$diff_types'--numstat[generate more machine-friendly diffstat]'
$diff_types'--shortstat[generate summary diffstat]'
@@ -5583,7 +5936,7 @@ __git_setup_diff_options () {
$diff_types'--name-only[show only names of changed files]'
$diff_types'--name-status[show only names and status of changed files]'
'--submodule=-[select output format for submodule differences]::format:((short\:"show pairs of commit names"
- log\:"list commits like git submodule does (default)"))'
+ log\:"list commits like git submodule does"))'
'( --no-color --color-words)--color=-[show colored diff]:: :__git_color_whens'
'(--color --color-words)--no-color[turn off colored diff]'
'--word-diff=-[show word diff]::mode:((color\:"highlight changed words using color"
@@ -5597,16 +5950,15 @@ __git_setup_diff_options () {
'--full-index[show full object name of pre- and post-image blob]'
'(--full-index)--binary[in addition to --full-index, output binary diffs for git-apply]'
'--abbrev=[set minimum SHA1 display-length]: :__git_guard_number length'
- # TODO: --break-rewrites is undocumented.
'(-B --break-rewrites)'{-B-,--break-rewrites=-}'[break complete rewrite changes into pairs of given size]:: :__git_guard_number size'
- # TODO: --detect-renames is undocumented.
- '(-M --detect-renames)'{-M-,--detect-renames=-}'[detect renames with given scope]:: :__git_guard_number size'
- # TODO: --detect-copies is undocumented.
- '(-C --detect-copies)'{-C-,--detect-copies=-}'[detect copies as well as renames with given scope]:: :__git_guard_number size'
+ '(-M --find-renames)'{-M-,--find-renames=-}'[Detect renames with given scope]:: :__git_guard_number size'
+ '(-C --find-copies)'{-C-,--find-copies=-}'[detect copies as well as renames with given scope]:: :__git_guard_number size'
'--find-copies-harder[try harder to find copies]'
+ '(-D --irreversible-delete)'{-D,--irreversible-delete}'[omit the preimage for deletes]'
'-l-[limit number of rename/copy targets to run]: :__git_guard_number'
'--diff-filter=-[select certain kinds of files for diff]: :_guard "[ACDMRTUXB*]#" kinds'
- '-S-[look for differences that contain the given string]:string'
+ '-S-[look for differences that add or remove the given string]:string'
+ '-G-[look for differences whose added or removed line matches the given regex]:pattern'
'--pickaxe-all[when -S finds a change, show all changes in that changeset]'
'--pickaxe-regex[treat argument of -S as regular expression]'
'-O-[output patch in the order of glob-pattern lines in given file]: :_files'
@@ -5616,11 +5968,14 @@ __git_setup_diff_options () {
'--ignore-space-at-eol[ignore changes in whitespace at end of line]'
'(-b --ignore-space-change -w --ignore-all-space)'{-b,--ignore-space-change}'[ignore changes in amount of white space]'
'(-b --ignore-space-change -w --ignore-all-space)'{-w,--ignore-all-space}'[ignore white space when comparing lines]'
+ '--ignore-blank-lines[do not show hunks that add or remove blank lines]'
'--inter-hunk-context=[combine hunks closer than n lines]:n'
'--exit-code[report exit code 1 if differences, 0 otherwise]'
'(--exit-code)--quiet[disable all output]'
'( --no-ext-diff)--ext-diff[allow external diff helper to be executed]'
'(--ext-diff )--no-ext-diff[disallow external diff helper to be executed]'
+ '(--textconv --no-textconv)--textconv[allow external text conversion filters to be run when comparing binary files]'
+ '(--textconv --no-textconv)--no-textconv[do not allow external text conversion filters to be run when comparing binary files]'
'--ignore-submodules[ignore changes to submodules]:: :__git_ignore_submodules_whens'
'(--no-prefix)--src-prefix=[use given prefix for source]:prefix'
'(--no-prefix)--dst-prefix=[use given prefix for destination]:prefix'
@@ -5631,18 +5986,7 @@ __git_setup_diff_options () {
'(-0 -1 -2 -3 --base --ours --theirs -c --cc --no-index)'{-3,--theirs}'[diff against "their branch" version]'
'(-0 -1 -2 -3 --base --ours --theirs -c --cc --no-index)-0[omit diff output for unmerged entries]'
'(-0 -1 -2 -3 --base --ours --theirs -c --cc --no-index)'{-c,--cc}'[compare "our branch", "their branch" and working tree files]'
- '-q[remain silent even on nonexisting files]'
-
- # TODO: --cumulative is undocumented.
- '--cumulative[undocumented]'
- # TODO: --follow is undocumented.
- '--follow[undocumented]'
- # TODO: --textconv is undocumented.
- '--textconv[undocumented]'
- # TODO: --no-textconv is undocumented.
- '--no-textconv[undocumented]'
- # TODO: -G is undocumented.
- '-G[undocumented]'
+
# TODO: --output is undocumented.
'--output[undocumented]:undocumented')
}
@@ -5664,13 +6008,15 @@ __git_setup_revision_options () {
email\:"use email headers like From and Subject"
raw\:"the raw commits"
format\:"specify own format"))'
- '--abbrev-commit[show only partial prefixes of commit object names]'
+ '(--abbrev-commit --no-abbrev-commit)--abbrev-commit[show only partial prefixes of commit object names]'
+ '(--abbrev-commit --no-abbrev-commit)--no-abbrev-commit[show the full 40-byte hexadecimal commit object name]'
+ '(--abbrev --no-abbrev)--abbrev=[set minimum SHA1 display-length (for use with --abbrev-commit)]: :__git_guard_number length'
+ '(--abbrev --no-abbrev)--no-abbrev[show the full 40-byte hexadecimal commit object name]'
'--oneline[shorthand for --pretty=oneline --abbrev-commit]'
'--encoding=-[output log messages in given encoding]:: :__git_encodings'
- '(--no-notes --show-notes --standard-notes --no-standard-notes)--no-notes[do not show notes that annotate commit]'
- '(--no-notes --show-notes --standard-notes --no-standard-notes)--show-notes[do not show notes that annotate commit]:: :__git_note_references'
- '(--no-notes --show-notes --standard-notes --no-standard-notes)--no-standard-notes[enable populating notes ref list from core.notesRef and notes.displayRef]'
- '(--no-notes --show-notes --standard-notes --no-standard-notes)--no-standard-notes[disable populating notes ref list from core.notesRef and notes.displayRef]'
+ '(--no-notes --notes)--no-notes[do not show notes that annotate commit]'
+ '(--no-notes )*--notes=[show notes that annotate commit, with optional ref argument show this notes ref instead of the default notes ref(s)]:: :__git_notes_refs'
+ '--show-signature[validate GPG signature of commit]'
'( --date)--relative-date[show dates relative to current time]'
'(--relative-date )--date=-[format of date output]: :__git_date_formats'
'--parents[display parents of commit]'
@@ -5694,6 +6040,10 @@ __git_setup_revision_options () {
'--remove-empty[stop when given path disappears from tree]'
'--merges[display only merge commits]'
'--no-merges[do not display commits with more than one parent]'
+ '(--min-parents --no-min-parents)--min-parents=-[show only commits having at least <n> commits]: :__git_guard_number "minimum number of parents"'
+ '(--min-parents --no-min-parents)--no-min-parents[reset limit]'
+ '(--max-parents --no-max-parents)--max-parents=-[show only commits having at most <n> commits]: :__git_guard_number "maximum number of parents"'
+ '(--max-parents --no-max-parents)--no-max-parents[reset limit]'
'--first-parent[follow only first parent from merge commits]'
'*--not[reverses meaning of ^ prefix for revisions that follow]'
'--all[show all commits from refs]'
@@ -5702,8 +6052,8 @@ __git_setup_revision_options () {
'--remotes=[-show all commits from refs/remotes]::pattern'
'--glob=[show all commits from refs matching glob]:pattern'
'--stdin[read commit objects from standard input]'
- '--cherry-pick[omit any same-change commits]'
'(-g --walk-reflogs --reverse)'{-g,--walk-reflogs}'[walk reflog entries from most recent to oldest]'
+ '--grep-reflog=[limit commits to ones whose reflog message matches the given pattern (with -g, --walk-reflogs)]:pattern'
'--merge[after a failed merge, show refs that touch files having a conflict]'
'--boundary[output uninteresting commits at boundary]'
'--simplify-by-decoration[show only commits that are referenced by a ref]'
@@ -5712,28 +6062,28 @@ __git_setup_revision_options () {
'(--full-history --dense --simplify-merges --ancestry-path)--sparse[when paths are given, display only commits that changes any of them]'
'(--full-history --dense --sparse --ancestry-path)--simplify-merges[milder version of --full-history]'
'(--full-history --dense --sparse --simplify-merges )--ancestry-path[only display commits that exists directly on ancestry chains]'
- '( --date-order)--topo-order[display commits in topological order]'
- '(--topo-order )--date-order[display commits in date order]'
+ '( --date-order --author-date-order)--topo-order[display commits in topological order]'
+ '(--topo-order --author-date-order)--date-order[display commits in date order]'
+ '(--topo-order --date-order )--author-date-order[display commits in auhor date order]'
'(-g --walk-reflogs)--reverse[display commits in reverse order]'
'( --objects-edge)--objects[display object ids of objects referenced by listed commits]'
'(--objects )--objects-edge[display object ids of objects referenced by listed and excluded commits]'
'( --do-walk)--no-walk[only display given revs, do not traverse their ancestors]'
'(--no-walk )--do-walk[only display given revs, traversing their ancestors]'
+ '( --cherry-pick)--cherry-mark[like --cherry-pick but mark equivalent commits instead of omitting them]'
+ '(--cherry-pick )--cherry-pick[omit any commit that introduces the same change as another commit on "the other side" of a symmetric range]'
+ '( --right-only)--left-only[list only commits on the left side of a symmetric range]'
+ '(--left-only )--right-only[list only commits on the right side of a symmetric range]'
+ '(--left-only --right-only --cherry-pick --cherry-mark)--cherry[synonym for --right-only --cherry-mark --no-merges]'
+ '(-c --cc )--full-diff[show full commit diffs when using log -p, not only those affecting the given path]'
+ '--log-size[print log message size in bytes before the message]'
+ '--use-mailmap[use mailmap file to map author and committer names and email]'
- # TODO: --reflog is undocumented.
'--reflog[show all commits from reflogs]'
- # TODO: --default is undocumented.
'--default[use argument as default revision]:default revision:__git_revisions'
- # TODO: --full-diff is undocumented.
- '(-c --cc )--full-diff[undocumented]'
- # TODO: --abrev is undocumented.
- '--abbrev=[set minimum SHA1 display-length]: :__git_guard_number length'
- # TODO: --no-abbrev is undocumented.
- '--no-abbrev[undocumented]'
# TODO: --early-output is undocumented.
'--early-output=-[undocumented]::undocumented'
- # TODO: --log-size is undocumented.
- '--log-size[undocumented]')
+ )
if (( words[(I)--objects(|-edge)] )); then
revision_options+=('--unpacked[print object IDs not in packs]')
@@ -5745,6 +6095,8 @@ __git_setup_merge_options () {
merge_options=(
'( --no-commit)--commit[perform the merge and commit the result]'
'(--commit )--no-commit[perform the merge but do not commit the result]'
+ '( --no-edit)--edit[open an editor to change the commit message]'
+ '(--edit )--no-edit[do not open an editor to change the commit message]'
'( --no-ff)--ff[do not generate a merge commit if the merge resolved as a fast-forward]'
'(--ff )--no-ff[generate a merge commit even if the merge resolved as a fast-forward]'
'( --no-log)--log[fill in one-line descriptions of the commits being merged in the log message]'
@@ -5756,6 +6108,8 @@ __git_setup_merge_options () {
'--ff-only[refuse to merge unless HEAD is up to date or merge can be resolved as a fast-forward]'
'*'{-s,--strategy=}'[use given merge strategy]:merge strategy:__git_merge_strategies'
'*'{-X,--strategy-option=}'[pass merge-strategy-specific option to merge strategy]'
+ '(--verify-signatures)--no-verify-signatures[verify the commits being merged or abort]'
+ '(--no-verify-signatures)--verify-signatures[do not verify the commits being merged]'
'(-q --quiet -v --verbose)'{-q,--quiet}'[suppress all output]'
'(-q --quiet -v --verbose)'{-v,--verbose}'[output additional information]')
}
@@ -5766,6 +6120,7 @@ __git_setup_fetch_options () {
'(: *)--all[fetch all remotes]'
'(-a --append)'{-a,--append}'[append ref names and object names of fetched refs to "$GIT_DIR/FETCH_HEAD"]'
'--depth=[deepen the history of a shallow repository by the given number of commits]: :__git_guard_number depth'
+ '--unshallow[convert a shallow clone to a complete one]'
'--dry-run[show what would be done, without making any changes]'
'(-f --force)'{-f,--force}'[allow refs that are not ancestors to be updated]'
'(-k --keep)'{-k,--keep}'[keep downloaded pack]'
@@ -5774,6 +6129,13 @@ __git_setup_fetch_options () {
'(--no-tags -t --tags)'{-t,--tags}'[fetch remote tags]'
'(-u --update-head-ok)'{-u,--update-head-ok}'[allow updates of current branch head]'
'--upload-pack=[specify path to git-upload-pack on remote side]:remote path'
+ '(--no-recurse-submodules --recurse-submodules)--recurse-submodules=-[specify when to fetch commits of submodules]::recursive fetching mode:((no\:"disable recursion"
+ yes\:"always recurse"
+ on-demand\:"only when submodule reference in superproject is updated"))'
+ '(--no-recurse-submodules --recurse-submodules)--no-recurse-submodules[disable recursive fetching of submodules]'
+ '(--no-recurse-submodules)--recurse-submodules-default=-[provide internal temporary non-negative value for "--recurse-submodules"]::recursive fetching mode:((yes\:"always recurse"
+ on-demand\:"only when submodule reference in superproject is updated"))'
+ '--submodule-prefix=-[prepend <path> to paths printed in informative messages]:submodule prefix path:_files -/'
'(-q --quiet -v --verbose --progress)'{-q,--quiet}'[suppress all output]'
'(-q --quiet -v --verbose)'{-v,--verbose}'[output additional information]'
'(-q --quiet)--progress[output progress information]')
@@ -5787,7 +6149,10 @@ __git_setup_apply_options () {
'-C-[ensure at least N lines of context match before and after each change]: :_guard "[[\:digit\:]]#" "number of lines of context"'
'--reject[apply hunks that apply and leave rejected hunks in .rej files]'
'(--ignore-space-change --ignore-whitespace)'{--ignore-space-change,--ignore-whitespace}'[ignore changes in whitespace in context lines]'
- '--directory=[root to prepend to all filenames]:root:_directories')
+ '--directory=[root to prepend to all filenames]:root:_directories'
+ '*--exclude=[skip files matching specified pattern]:pattern'
+ '*--include=[include files matching specified pattern]:pattern'
+ )
}
# Git Config Helpers
@@ -5879,7 +6244,7 @@ __git_config_values () {
default=$2
shift 2
values=($*)
- [[ -n $current ]] && values[(r)$(__git_pattern_escape $default):*]+=' (current)'
+ [[ -n $current ]] && values[(r)$(__git_pattern_escape $current):*]+=' (current)'
values[(r)$(__git_pattern_escape $default):*]+=' (default)'
_describe -t ${opts[-t]:-values} ${opts[-l]:-value} values
@@ -5896,6 +6261,8 @@ __git_browsers () {
builtinbrowsers=(
firefox
iceweasel
+ google-chrome
+ chromium
konquerer
w3m
links
@@ -6039,9 +6406,10 @@ __git_sendemail_suppresscc_values () {
author:'avoid including patch author' \
self:'avoid including sender' \
cc:'avoid including anyone mentioned in Cc lines except for self' \
- bodycc:'avoid including anyone mentiond in Cc lines in patch body except for self' \
- sob:'avoid including anyone mentiond in Signed-off-by lines except for self' \
+ bodycc:'avoid including anyone mentioned in Cc lines in patch body except for self' \
+ sob:'avoid including anyone mentioned in Signed-off-by lines except for self' \
cccmd:'avoid running --cc-cmd' \
+ tocmd:'avoid running --to-cmd' \
body:'equivalent to sob + bodycc' \
all:'avoid all auto Cc values'
}
@@ -6102,13 +6470,17 @@ _git() {
'(- :)--help[display help message]' \
'-c[pass configuration parameter to command]:parameter' \
'--exec-path=-[path containing core git-programs]:: :_directories' \
- '--html-path[display path to HTML documentation and exit]' \
+ '(: -)--man-path[print the manpath for the man pages for this version of Git and exit]' \
+ '(: -)--info-path[print the path where the info files are installed and exit]' \
+ '(: -)--html-path[display path to HTML documentation and exit]' \
'(-p --paginate)'{-p,--paginate}'[pipe output into $PAGER]' \
'--no-pager[do not pipe git output into a pager]' \
'--git-dir=-[path to repository]: :_directories' \
'--work-tree=-[path to working tree]: :_directories' \
+ '--namespace=-[set the Git namespace]: :_directories' \
'--bare[use $PWD as repository]' \
'--no-replace-objects[do not use replacement refs to replace git objects]' \
+ '--literal-pathspecs[treat pathspecs literally, rather than as glob patterns]' \
'(-): :->command' \
'(-)*:: :->option-or-argument' && return