1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978
|
# (C) 2011-2025 magicant
# Completion script for the "git-config" command.
# Supports Git 2.48.1.
function completion/git-config {
WORDS=(git config "${WORDS[2,-1]}")
command -f completion//reexecute
}
function completion/git::config:arg {
OPTIONS=( #>#
"--add; add a new line to the option value"
"--blob:; specify an object to save config"
"--bool; ensure the option value is a boolean"
"--bool-or-int; ensure the option value is a boolean or integer"
"--default:; specify a default to show if the option is not set"
"e --edit; start an editor to edit the config file"
"--expiry-date; expand the date value to a timestamp"
"f: --file:; specify the config file path"
"--get; show an option value"
"--get-all; show all values for an option"
"--get-color; show ANSI color escape sequence"
"--get-colorbool; check if output should be colored"
"--get-regexp; show options whose keys match the specified regular expression"
"--get-urlmatch; show option with a key matching the specified URL"
"--global; get or set the global options"
"--includes; apply include.* directives"
"--int; ensure the option value is an integer"
"l --list; show all options set"
"--local; get or set the repository-specific options"
"--name-only; show only the names of options"
"--no-includes; do not apply include.* directives"
"--no-type; do not canonicalize values"
"z --null; print a null byte after each key-value pair"
"--path; perform tilde expansion when printing option values"
"--remove-section; remove a section"
"--rename-section; rename a section"
"--replace-all; replace all matching values"
"--show-origin; show options with their specifying file"
"--show-scope; show options with their scope"
"--system; get or set the system-wide options"
"--type:; canonicalize values under specified constraint"
"--unset; remove (part of) an option"
"--unset-all; remove (all matching parts of) an option"
"--worktree; get or set the worktree-specific options"
) #<#
command -f completion//parseoptions -es
case $ARGOPT in
(-)
command -f completion//getoperands
case "${WORDS[1]}" in ([gs]et|unset)
OPTIONS=("$OPTIONS" #>#
"--all; operate on all values of multi-valued options"
"--value:; specify the option value to operate on"
"--fixed-value; match the option value exactly (with --value)"
) #<#
esac
case "${WORDS[1]}" in
(get)
OPTIONS=("$OPTIONS" #>#
"--regexp; show options whose keys match the specified regular expression"
"--url:; show option with a section name matching the specified URL"
) #<#
;;
(set)
OPTIONS=("$OPTIONS" #>#
"--append; add a new value to a multi-valued option"
) #<#
;;
esac
command -f completion//completeoptions
;;
(f|--file)
complete -P "$PREFIX" -f
;;
(--type)
complete -P "$PREFIX" bool int bool-or-int path expiry-date color
;;
('')
command -f completion//getoperands
if [ "${WORDS[#]}" -eq 0 ]; then #>>#
complete -P "$PREFIX" -D "modify value with an editor" edit
complete -P "$PREFIX" -D "show value for specific key" get
complete -P "$PREFIX" -D "show all key-value pairs" list
complete -P "$PREFIX" -D "rename group of keys" rename-section
complete -P "$PREFIX" -D "remove group of keys" remove-section
complete -P "$PREFIX" -D "set value for specific key" set
complete -P "$PREFIX" -D "remove value for specific key" unset
fi #<<#
command -f completion//git::completeoptionname
;;
esac
}
function completion//git::completeoptionname {
typeset usesuffix= suffix
if [ $# -gt 0 ]; then
usesuffix=true suffix=$1
fi
typeset word="${TARGETWORD#"$PREFIX"}"
# complete existing settings
typeset word2 prefix2 name value
word2="${word##*.}"
prefix2="${TARGETWORD%"$word2"}"
while read -r name value; do
name=${name#"$prefix2"}
case $name in
(*.*)
name=${name%%.*}
complete -P "$prefix2" -S . -T -- "$name"
;;
(*)
complete -P "$prefix2" ${usesuffix:+-S "$suffix" -T} -- \
"$name"
;;
esac
done 2>/dev/null <(git config --get-regexp "${word//./'\.'}.*")
case $word in
(add.*)
PREFIX=${PREFIX}add. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
ignoreErrors
;; #<<#
(advice.*)
PREFIX=${PREFIX}advice. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
addEmbeddedRepo addEmbeddedRepo addIgnoredFile \
amWorkDir ambiguousFetchRefspec \
checkoutAmbiguousRemoteBranchName \
commitBeforeMerge detachedHead diverging \
fetchShowForcedUpdates forceDeleteBranch \
ignoredHook implicitIdentity mergeConflict \
nestedTag pushAlreadyExists pushFetchFirst \
pushNeedsForce pushNonFFCurrent \
pushNonFFMatching pushRefNeedsUpdate \
pushUnqualifiedRefname pushUpdateRejected \
rebaseTodoError refSyntax resetNoRefresh \
resolveConflict rmHints sequencerInUse \
skippedCherryPicks sparseIndexExpanded \
statusAheadBehind statusHints statusUoption \
submoduleAlternateErrorStrategyDie \
submoduleMergeConflict submodulesNotUpdated \
suggestDetachingHead updateSparsePath \
waitingForEditor worktreeAddOrphan
;; #<<#
(alias.*)
PREFIX=${PREFIX}alias. #>>#
command -f completion/git::completealias ${usesuffix:+"$suffix"}
;;
(am.*)
PREFIX=${PREFIX}am. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
keepcr threeWay
;; #<<#
(apply.*)
PREFIX=${PREFIX}apply. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
ignorewhitespace whitespace
;; #<<#
(attr.*)
PREFIX=${PREFIX}attr. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
tree
;; #<<#
(author.*|committer.*)
word=${word#*.}
PREFIX=${TARGETWORD%"$word"} #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
email name
;; #<<#
(bitmapPseudoMerge.*.*)
word=${word#bitmapPseudoMerge.*.}
PREFIX=${TARGETWORD%"$word"} #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
pattern decay sampleRate threshold maxMerges \
stableThreshold stableSize
;; #<<#
(blame.*)
PREFIX=${PREFIX}blame. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
blankBoundary coloring date showEmail showRoot \
ignoreRevsFile markUnblamableLines \
markIgnoredLines
;; #<<#
(branch.*.*)
word=${word#branch.*.}
PREFIX=${TARGETWORD%"$word"} #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
remote pushRemote merge mergeOptions rebase \
description
;; #<<#
(branch.*)
PREFIX=${PREFIX}branch. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
autoSetupMerge autoSetupRebase sort
#<<#
command -f completion/git::completeref \
abbrprefixes=refs/heads/ dontcompletefull=true \
suffix=. --branches
;;
(browser.*.*|difftool.*.*|man.*.*)
word=${word#*.*.}
PREFIX=${TARGETWORD%"$word"} #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
cmd path
;; #<<#
# (bundle.*) not yet supported
(checkout.*)
PREFIX=${PREFIX}checkout. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
defaultRemote guess workers \
thresholdForParallelism
;; #<<#
(clean.*)
PREFIX=${PREFIX}clean. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
requireForce
;; #<<#
(clone.*)
PREFIX=${PREFIX}clone. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
defaultRemoteName rejectShallow filterSubmodules
;; #<<#
(color.advice.*)
PREFIX=${PREFIX}color.advice. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
hint
;; #<<#
(color.blame.*)
PREFIX=${PREFIX}color.blame. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
highlightRecent repeatedLines
;; #<<#
(color.branch.*)
PREFIX=${PREFIX}color.branch. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
current local plain remote
;; #<<#
(color.diff.*)
PREFIX=${PREFIX}color.diff. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
context contextBold contextDimmed commit frag \
func meta new newBold newDimmed newMoved \
newMovedDimmed newMovedAlternative \
newMovedAlternativeDimmed old oldBold oldDimmed\
oldMoved oldMovedDimmed oldMovedAlternative \
oldMovedAlternativeDimmed plain whitespace
;; #<<#
(color.decorate.*)
PREFIX=${PREFIX}color.decorate. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
branch HEAD remoteBranch stash tag grafted
;; #<<#
(color.grep.*)
PREFIX=${PREFIX}color.grep. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
context filename function lineNumber column \
match matchContext matchSelected selected \
separator
;; #<<#
(color.interactive.*)
PREFIX=${PREFIX}color.interactive. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
error header help prompt
;; #<<#
(color.push.*)
PREFIX=${PREFIX}color.push. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
error
;; #<<#
(color.remote.*)
PREFIX=${PREFIX}color.remote. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
error hint success warning
;; #<<#
(color.status.*)
PREFIX=${PREFIX}color.status. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
added branch changed header localBranch \
nobranch remoteBranch unmerged untracked updated
;; #<<#
(color.transport.*)
PREFIX=${PREFIX}color.transport. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
rejected
;; #<<#
(color.*)
PREFIX=${PREFIX}color. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
advice branch diff grep interactive pager push \
remote showBranch status transport ui
complete -P "$PREFIX" -S . -T -- \
advice blame branch diff decorate grep \
interactive push status transport
;; #<<#
(column.*)
PREFIX=${PREFIX}column. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
ui branch clean status tag
;; #<<#
(commit.*)
PREFIX=${PREFIX}commit. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
cleanup gpgSign status template verbose
;; #<<#
(commitGraph.*)
PREFIX=${PREFIX}commitGraph. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
generationVersion maxNewFilters \
readChangedPaths changedPathsVersion
;; #<<#
(completion.*)
PREFIX=${PREFIX}completion. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
commands
;; #<<#
(core.*)
PREFIX=${PREFIX}core. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
abbrev alternateRefsCommand \
alternateRefsPrefixes askPass attributesFile \
autocrlf bare bigFileThreshold \
checkRoundtripEncoding checkStat commentChar \
commentString commitGraph compression \
createObject deltaBaseCacheLimit editor eol \
excludesFile fileMode filesRefLockTimeout \
fsmonitor fsmonitorHookVersion fsync \
fsyncMethod fsyncObjectFiles gitProxy \
hideDotFiles hooksPath ignoreCase \
ignoreCygwinFSTricks ignoreStat ignorecase \
logAllRefUpdates looseCompression maxTreeDepth \
multiPackIndex notesRef packedGitLimit \
packedGitWindowSize packedRefsTimeout pager \
precomposeUnicode preferSymlinkRefs \
preloadIndex protectHFS quotePath \
repositoryFormatVersion \
restrictinheritedhandles safecrlf \
sharedRepository sparseCheckout \
sparseCheckoutCone splitIndex sshCommand \
symlinks trustctime unsetenvvars untrackedCache\
useReplaceRefs warnAmbiguousRefs whitespace \
worktree
;; #<<#
(credential.*)
word=${word#credential.*.}
PREFIX=${TARGETWORD%"$word"} #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
helper interactive useHttpPath sanitizePrompt \
protectProtocol username
;; #<<#
(credentialCache.*)
PREFIX=${PREFIX}credentialCache. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
ignoreSIGHUP
;; #<<#
(credentialStore.*)
PREFIX=${PREFIX}credentialStore. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
lockTimeoutMS
;; #<<#
(diff.*.*)
word=${word#diff.*.}
PREFIX=${TARGETWORD%"$word"} #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
binary cachetextconv command textconv \
trustExitCode wordregex xfuncname
;; #<<#
(diff.*)
PREFIX=${PREFIX}diff. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
algorithm autoRefreshIndex colorMoved \
colorMovedWS context dirstat dstPrefix external\
guitool ignoreSubmodules indentHeuristic \
interHunkContext mnemonicPrefix noPrefix \
orderFile relative renameLimit renames \
srcPrefix statGraphWidth statNameWidth \
submodule suppressBlankEmpty tool trustExitCode\
wordRegex wsErrorHighlight
;; #<<#
# (difftool.*.*) -> (browser.*.*)
(difftool.*)
PREFIX=${PREFIX}difftool. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
guiDefault prompt trustExitCode
;; #<<#
(extensions.*)
PREFIX=${PREFIX}extensions. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
compatObjectFormat noop noop-v1 objectFormat \
partialClone preciousObjects refStorage \
relativeWorktrees worktreeConfig
;; #<<#
(fastimport.*)
PREFIX=${PREFIX}fastimport. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
unpackLimit
;; #<<#
(feature.*)
PREFIX=${PREFIX}feature. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
experimental manyFiles
;; #<<#
(fetch.fsck.*|fsck.*|receive.fsck.*)
word=${word#*fsck.}
PREFIX=${TARGETWORD%"$word"} #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
skipList # TODO msg-id
;; #<<#
(fetch.*)
PREFIX=${PREFIX}fetch. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
all bundleURI bundleCreationToken fsckObjects \
negotiationAlgorithm output parallel prune \
pruneTags recurseSubmodules showForcedUpdates \
unpackLimit writeCommitGraph
complete -P "$PREFIX" -S . -T -- fsck
;; #<<#
(filter.*.*)
word=${word#filter.*.}
PREFIX=${TARGETWORD%"$word"} #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
clean smudge
;; #<<#
(format.*)
PREFIX=${PREFIX}format. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
attach cc coverFromDescription coverLetter \
encodeEmailHeaders filenameMaxLength \
forceInBodyFrom from mboxrd noprefix notes \
numbered headers outputDirectory pretty \
signature signatureFile signOff subjectPrefix \
suffix thread to useAutoBase
;; #<<#
# (fsck.*) -> (fetch.fsck.*)
(fsmonitor.*)
PREFIX=${PREFIX}fsmonitor. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
allowRemote socketDir
;; #<<#
(gc.*.*)
word=${word#gc.*.}
PREFIX=${TARGETWORD%"$word"} #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
reflogExpire reflogExpireUnreachable
;; #<<#
(gc.*)
PREFIX=${PREFIX}gc. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
aggressiveDepth aggressiveWindow auto \
autoDetach autoPackLimit bigPackThreshold \
cruftPacks logExpiry maxCruftSize packRefs \
pruneExpire recentObjectsHook reflogExpire \
reflogExpireUnreachable repackFilter \
repackFilterTo rerereResolved rerereUnresolved \
worktreePruneExpire writeCommitGraph
;; #<<#
(gitcvs.*)
PREFIX=${PREFIX}gitcvs. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
allBinary commitMsgAnnotation \
dbTableNamePrefix dbDriver dbName dbPass \
dbUser enabled logFile usecrlfattr
;; #<<#
(gitweb.*)
PREFIX=${PREFIX}gitweb. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
category description owner url
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
avatar blame grep highlight patches pickaxe \
remote_heads showSizes snapshot
;; #<<#
(gpg.ssh.*)
word=${word#gpg.ssh.*}
PREFIX=${TARGETWORD%"$word"} #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
allowedSignersFile defaultKeyCommand program \
revocationFile
;; #<<#
(gpg.*.*)
word=${word#gpg.*.}
PREFIX=${TARGETWORD%"$word"} #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
program
;; #<<#
(gpg.*)
PREFIX=${PREFIX}gpg. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
format minTrustLevel program
complete -P "$PREFIX" -S . -T -- openpgp ssh x509
;; #>>#
(grep.*)
PREFIX=${PREFIX}grep. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
column extendedRegexp fallbackToNoIndex \
fullName lineNumber patternType threads
;; #<<#
(gui.*)
PREFIX=${PREFIX}gui. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
blamehistoryctx commitMsgWidth \
copyBlameThreshold diffContext displayUntracked\
encoding fastCopyBlame matchTrackingBranch \
newBranchTemplate pruneDuringFetch \
spellingDictionary trustmtime
;; #<<#
(guitool.*.*)
word=${word#guitool.*.}
PREFIX=${TARGETWORD%"$word"} #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
argPrompt cmd confirm needsFile noConsole \
noRescan prompt revPrompt revUnmerged title
;; #<<#
(help.*)
PREFIX=${PREFIX}help. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
autoCorrect browser format htmlPath
;; #<<#
(http.*)
word=${word##*.}
PREFIX=${TARGETWORD%"$word"} #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
cookieFile curloptResolve delegation emptyAuth \
extraHeader followRedirects lowSpeedLimit \
lowSpeedTime maxRequests minSessions noEPSV \
pinnedPubkey postBuffer proactiveAuth proxy \
proxyAuthMethod proxySSLCAInfo proxySSLCert \
proxySSLCertPasswordProtected proxySSLKey \
saveCookies schannelCheckRevoke \
schannelUseSSLCAInfo sslBackend sslCAInfo \
sslCAPath sslCert sslCertPasswordProtected \
sslCipherList sslKey sslTry sslVerify \
sslVersion userAgent version
;; #<<#
(i18n.*)
PREFIX=${PREFIX}i18n. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
commitEncoding logOutputEncoding
;; #<<#
(imap.*)
PREFIX=${PREFIX}imap. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
authMethod folder host pass port \
preformattedHTML sslverify tunnel user
;; #<<#
(include.*)
PREFIX=${PREFIX}include. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
path
;; #<<#
(includeIf.*.*)
word=${word#includeIf.*.}
PREFIX=${TARGETWORD%"$word"} #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
path
;; #<<#
(index.*)
PREFIX=${PREFIX}index. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
recordEndOfIndexEntries recordOffsetTable \
skipHash sparse threads version
;; #<<#
(init.*)
PREFIX=${PREFIX}init. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
defaultBranch defaultObjectFormat \
defaultRefFormat templateDir
;; #<<#
(instaweb.*)
PREFIX=${PREFIX}instaweb. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
browser httpd local modulepath port
;; #<<#
(interactive.*)
PREFIX=${PREFIX}interactive. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
diffFilter singleKey
;; #<<#
(log.*)
PREFIX=${PREFIX}log. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
abbrevCommit date decorate diffMerges \
excludeDecoration follow graphColors \
initialDecorationSet mailmap showRoot \
showSignature
;; #<<#
(lsrefs.*)
PREFIX=${PREFIX}lsrefs. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
unborn
;; #<<#
(mailinfo.*)
PREFIX=${PREFIX}mailinfo. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
scissors
;; #<<#
(mailmap.*|sendemail.mailmap.*|sendemail.*.mailmap.*)
word=${word#*mailmap.*}
PREFIX=${TARGETWORD%"$word"} #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
blob file
;; #<<#
(maintenance.*.*)
word=${word#maintenance.*.}
PREFIX=${TARGETWORD%"$word"} #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
auto enabled schedule
;; #<<#
(maintenance.*)
PREFIX=${PREFIX}maintenance. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
auto autoDetach strategy
complete -P "$PREFIX" -S . -T -- \
commit-graph prefetch gc loose-objects \
incremental-repack pack-refs
;; #<<#
# (man.*.*) -> (browser.*.*)
(man.*)
PREFIX=${PREFIX}man. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
viewer
;; #<<#
(merge.*.*)
word=${word#merge.*.}
PREFIX=${TARGETWORD%"$word"} #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
driver name recursive
;; #<<#
(merge.*)
PREFIX=${PREFIX}merge. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
autoStash branchdesc conflictStyle \
defaultToUpstream directoryRenames ff guitool \
log renameLimit renames renormalize stat \
suppressDest tool verbosity verifySignatures
;; #<<#
(mergetool.*.*)
word=${word#mergetool.*.}
PREFIX=${TARGETWORD%"$word"} #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
cmd hasOutput hideResolved layout path \
trustExitCode useAutoMerge
;; #<<#
(mergetool.*)
PREFIX=${PREFIX}mergetool. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
guiDefault hideResolved keepBackup \
keepTemporaries prompt writeToTemp
;; #<<#
(notes.rewrite.*)
PREFIX=${PREFIX}notes.rewrite. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
amend rebase
;; #<<#
(notes.*.*)
word=${word#notes.*.}
PREFIX=${TARGETWORD%"$word"} #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
mergeStrategy
;; #<<#
(notes.*)
PREFIX=${PREFIX}notes. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
displayRef mergeStrategy rewriteMode rewriteRef
complete -P "$PREFIX" -S . -T -- rewrite
#<<#
command -f completion/git::completeref \
abbrprefixes=refs/notes/ dontcompletefull=true \
suffix=. --glob=refs/notes/\*
;;
(pack.*)
PREFIX=${PREFIX}pack. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
allowPackReuse compression deltaCacheLimit \
deltaCacheSize depth indexVersion island \
islandCore packSizeLimit preferBitmapTips \
readReverseIndex threads useBitmaps \
useBitmapBoundaryTraversal useSparse window \
windowMemory writeBitmaps writeBitmapHashCache \
writeBitmapLookupTable writeReverseIndex
;; #<<#
(pager.*)
PREFIX=${PREFIX}pager.
command -f completion/git::completecmd
;;
(promisor.*)
PREFIX=${PREFIX}promisor. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
quiet
;; #<<#
(protocol.*.*)
word=${word#protocol.*.}
PREFIX=${TARGETWORD%"$word"} #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
allow
;; #<<#
(protocol.*)
PREFIX=${PREFIX}protocol. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
allow version
complete -P "$PREFIX" -S . -T -- file git ssh http
;; #<<#
(pull.*)
PREFIX=${PREFIX}pull. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
ff octopus rebase twohead
;; #<<#
(push.*)
PREFIX=${PREFIX}push. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
autoSetupRemote default followTags gpgSign \
negotiate pushOption recurseSubmodules \
useBitmaps useForceIfIncludes
;; #<<#
(rebase.*)
PREFIX=${PREFIX}rebase. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
abbreviateCommands autoSquash autoStash backend\
forkPoint instructionFormat maxLabelLength \
missingCommitsCheck rebaseMerges \
rescheduleFailedExec stat updateRefs
;; #<<#
# (receive.fsck.*) -> (fetch.fsck.*)
(receive.*)
PREFIX=${PREFIX}receive. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
advertiseAtomic advertisePushOptions autogc \
certNonceSeed certNonceSlop denyCurrentBranch \
denyDeleteCurrent denyDeletes \
denyNonFastForwards fsckObjects hideRefs \
keepAlive maxInputSize procReceiveRefs \
shallowUpdate unpackLimit updateServerInfo
;; #<<#
(reftable.*)
PREFIX=${PREFIX}reftable. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
blockSize geometricFactor indexObjects \
lockTimeout restartInterval
(remote.*.*)
word=${word#remote.*.}
PREFIX=${TARGETWORD%"$word"} #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
fetch followRemoteHEAD mirror \
partialclonefilter promisor proxy \
proxyAuthMethod prune pruneTags push pushurl \
receivepack serverOption skipDefaultUpdate \
skipFetchAll tagOpt uploadpack url vcs
;; #<<#
(remote.*)
PREFIX=${PREFIX}remote. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
pushDefault
;; #<<#
(repack.*)
PREFIX=${PREFIX}repack. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
cruftDepth cruftThreads cruftWindow \
cruftWindowMemory packKeptObjects \
updateServerInfo useDeltaBaseOffset \
useDeltaIslands writeBitmaps
;; #<<#
(rerere.*)
PREFIX=${PREFIX}rerere. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
autoUpdate enabled
;; #<<#
(safe.*)
PREFIX=${PREFIX}safe. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
bareRepository directory
;; #<<#
# (sendemail.mailmap.*|sendemail.*.mailmap.*) -> (mailmap.*)
(sendemail.*.*)
word=${word#sendemail.*.}
PREFIX=${TARGETWORD%"$word"}
command -f completion//git::completesendemailoptionname
;;
(sendemail.*)
PREFIX=${PREFIX}sendemail. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
identity smtpEncryption smtpSSLCertPath
#<<#
command -f completion//git::completesendemailoptionname
;;
(sequence.*)
PREFIX=${PREFIX}sequence. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
editor
;; #<<#
(showBranch.*)
PREFIX=${PREFIX}showBranch. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
default
;; #<<#
(sparse.*)
PREFIX=${PREFIX}sparse. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
expectFilesOutsideOfPatterns
;; #<<#
(splitIndex.*)
PREFIX=${PREFIX}splitIndex. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
maxPercentChange sharedIndexExpire
;; #<<#
(ssh.*)
PREFIX=${PREFIX}ssh. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
variant
;; #<<#
(stash.*)
PREFIX=${PREFIX}stash. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
showIncludeUntracked showPatch showStat
;; #<<#
(status.*)
PREFIX=${PREFIX}status. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
aheadBehind branch displayCommentPrefix \
relativePaths renameLimit renames short \
showStash showUntrackedFiles submoduleSummary
;; #<<#
(submodule.*.*)
word=${word#submodule.*.}
PREFIX=${TARGETWORD%"$word"} #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
active \
fetchRecurseSubmodules ignore path update url
;; #<<#
(submodule.*)
PREFIX=${PREFIX}submodule. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
active alternateErrorStrategy alternateLocation\
fetchJobs propagateBranches recurse
;; #<<#
(svn-remote.*.*)
word=${word#svn-remote.*.}
PREFIX=${TARGETWORD%"$word"} #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
automkdirs branches commiturl fetch \
ignore-paths noMetadata pushurl rewriteRoot \
rewriteUUID tags url useSvmProps useSvnsyncprops
;; #<<#
(svn.*)
PREFIX=${PREFIX}svn. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
automkdirs authorsfile brokenSymlinkWorkaround \
commiturl edit findcopiesharder followparent l \
noMetadata pathnameencoding pushmergeinfo \
repack repackflags rmdir useSvmProps \
useSvnsyncprops
;; #<<#
(tag.*)
PREFIX=${PREFIX}tag. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
forceSignAnnotated gpgSign sort
;; #<<#
(tar.*)
PREFIX=${PREFIX}tar. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
umask
;; #<<#
(trace2.*)
PREFIX=${PREFIX}trace2. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
configParams destinationDebug envVars \
eventBrief eventNesting eventTarget maxFiles \
normalBrief normalTarget perfBrief perfTarget
;; #<<#
(transfer.*)
PREFIX=${PREFIX}transfer. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
advertiseObjectInfo advertiseSID bundleURI \
credentialsInUrl fsckObjects hideRefs \
unpackLimit
;; #<<#
(uploadarchive.*)
PREFIX=${PREFIX}uploadarchive. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
allowUnreachable
;; #<<#
(uploadpack.*)
PREFIX=${PREFIX}uploadpack. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
allowAnySHA1InWant allowFilter \
allowReachableSHA1InWant allowRefInWant \
allowTipSHA1InWant hideRefs keepAlive \
packObjectsHook
;; #<<#
(uploadpackfilter.tree.*)
word=${word#uploadpackfilter.tree.*.}
PREFIX=${TARGETWORD%"$word"} #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
allow maxDepth
;; #<<#
(uploadpackfilter.*.*)
word=${word#uploadpackfilter.*.}
PREFIX=${TARGETWORD%"$word"} #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
allow
;; #<<#
(uploadpackfilter.*)
PREFIX=${PREFIX}uploadpackfilter. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
allow
complete -P "$PREFIX" -S . -T -- tree \
blob:none blob:limit combine object:type \
sparse:oid tree
;; #<<#
(url.*.*)
word=${word#url.*.}
PREFIX=${TARGETWORD%"$word"} #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
insteadOf pushInsteadOf
;; #<<#
(user.*)
PREFIX=${PREFIX}user. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
email name signingkey useConfigOnly
;; #<<#
(versionsort.*)
PREFIX=${PREFIX}versionsort. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
suffix
;; #<<#
(web.*)
PREFIX=${PREFIX}web. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
browser
;; #<<#
(worktree.*)
PREFIX=${PREFIX}worktree. #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
guessRemote useRelativePaths
;; #<<#
(*) #>>#
complete -P "$PREFIX" -S . -T -- \
add advice alias am apply attr author \
bitmapPseudoMerge blame branch browser bundle \
checkout clean clone color column commit \
commitGraph committer completion core \
credential credentialCache credentialStore \
diff difftool extensions fastimport feature \
fetch format filter fsck fsmonitor gc gitcvs \
gitweb gpg grep gui guitool help http \
i18n imap include includeIf index init instaweb\
interactive log lsrefs mailinfo mailmap man \
merge mergetool notes pack pager pretty \
promisor protocol pull push rebase receive \
reftable remote remotes repack rerere safe \
sendemail sequence showBranch sparse splitIndex\
ssh stash status submodule svn svn-remote tag \
tar trace2 transfer uploadarchive uploadpack \
uploadpackfilter url user versionsort web \
worktree
;; #<<#
esac
}
function completion//git::completesendemailoptionname { #>>#
complete -P "$PREFIX" ${usesuffix:+-S "$suffix" -T} -- \
aliasesFile aliasFileType annotate bcc cc ccCmd chainReplyTo \
confirm envelopeSender forbidSendmailVariables from headerCmd \
mailmap multiEdit signedOffByCc smtpBatchSize smtpDomain \
smtpPass smtpReloginDelay smtpServer smtpServerOption \
smtpServerPort smtpUser suppressCc suppressFrom thread to toCmd\
transferEncoding validate xmailer
complete -P "$PREFIX" -S . -T -- mailmap
} #<<#
# vim: set ft=sh ts=8 sts=8 sw=8 et:
|