/usr/share/yash/completion/git-apply is in yash 2.35-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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  | # (C) 2011 magicant
# Completion script for the "git-apply" command.
# Supports Git 1.7.7.
function completion/git-apply {
	WORDS=(git apply "${WORDS[2,-1]}")
	command -f completion//reexecute
}
function completion/git::apply:arg {
	OPTIONS=( #>#
	"--allow-binary-replacement --binary"
	"--apply; force to apply patches"
	"--build-fake-ancestor:" # TODO
	"--cached; apply patches to the index without modifying the working tree"
	"--check; check if patches can be applied without errors instead of applying patches"
	"--exclude:; skip files whose names match the specified pattern"
	"--inaccurate-eof; work around diff errors about missing newlines at end of file"
	"--include:; apply to only files whose names match the specified pattern"
	"--index; apply patches to the index as well as the working tree"
	"--no-add; apply deletions but not additions"
	"--recount; ignore line counts in hunk headers"
	"R --reverse; patch in reverse"
	"--stat; print diffstat instead of applying patches"
	"--numstat; print a diffstat in the machine-friendly format instead of applying patches"
	"--summary; print summary instead of applying patches"
	"--unidiff-zero; accept unified diffs without context lines"
	"v --verbose; report progress in detail"
	"z; print a null byte after each filename"
	) #<#
	command -f completion/git::apply:getopt apply
	command -f completion//parseoptions -n
	case $ARGOPT in
		(-)
			command -f completion//completeoptions
			;;
		(''|--exclude|--include)
			complete -P "$PREFIX" -f
			;;
		(*)
			command -f completion/git::apply:compopt
			;;
	esac
}
function completion/git::apply:getopt {
	typeset apply=
	case $1 in (am|apply)
		apply=true
		OPTIONS=("$OPTIONS" #>#
		"--directory:; specify a directory to work in"
		"p:; specify the number of pathname components to strip from file names"
		"--reject; apply as much as possible and leave rejected hunks in *.rej file"
		) #<#
	esac
	OPTIONS=("$OPTIONS" #>#
	"C:; specify the number of context lines in each hunk that must match"
	"--ignore-whitespace ${apply:+--ignore-space-change}; ignore whitespaces in context when applying patches"
	"--whitespace:; specify what to do with whitespace errors"
	) #<#
}
function completion/git::apply:compopt
	case $ARGOPT in
#		([Cp])
#			;;
		(--directory)
			complete -P "$PREFIX" -S / -T -d
			command -f completion/git::completepath
			;;
		(--whitespace)
			command -f completion/git::--whitespace:arg
			;;
	esac
function completion/git::--whitespace:arg { #>>#
	complete -P "$PREFIX" -D "treat as errors and print some of them" error
	complete -P "$PREFIX" -D "treat as errors and print all of them" error-all
	complete -P "$PREFIX" -D "print warnings and fix errors" fix strip
	complete -P "$PREFIX" -D "don't print warnings about whitespace errors" nowarn
	complete -P "$PREFIX" -D "print warnings but apply the patch as is" warn
} #<#
# vim: set ft=sh ts=8 sts=8 sw=8 noet:
 |