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
|
# (C) 2011-2025 magicant
# Completion script for the "git-format-patch" command.
# Supports Git 2.48.1.
function completion/git-format-patch {
WORDS=(git format-patch "${WORDS[2,-1]}")
command -f completion//reexecute
}
function completion/git::format-patch:arg {
OPTIONS=( #>#
"--add-header:; specify an additional header string"
"--always; produce patches even for empty commits"
"--attach::; make patch contents an mail attachment"
"--base:; insert base commit info"
"--cc:; specify an additional receiver"
"--cover-from-description:; specify which part of cover letter is auto-filled"
"--cover-letter; create a file containing overall diffstat"
"--creation-factor:; specify the creation factor for the range-diff"
"--description-file:; specify a file containing the cover letter"
"--encode-email-headers; encode non-ASCII email headers"
"--filename-max-length:; specify the maximum length of the filenames"
"--force-in-body-from; always output an in-body 'From:' line"
"--from::; specify the email sender"
"--ignore-if-in-upstream"
"--inline::; like --attach, but use \"Content-Disposition: inline\""
"--in-reply-to:"
"--interdiff:; specify a revision to compare with and produce an interdiff"
"k --keep-subject; don't add/remove \"[PATCH]\""
"--no-attach; cancel the --attach option"
"--no-base; don't insert base commit info"
"--no-binary; don't include diffs for binary files"
"--no-cover-letter; don't create a cover letter"
"--no-encode-email-headers; keep non-ASCII email headers as-is"
"--no-force-in-body-from; cancel the --force-in-body-from option"
"--no-notes; don't append notes for each commit"
"N --no-numbered; name output in \"[PATCH]\" format"
"--no-signature; don't append a signature to results"
"p --no-stat; create plain patches without diffstats"
"--notes::; append notes for each commit"
"--no-thread; don't thread mails"
"n --numbered; name output in \"[PATCH n/m]\" format"
"--numbered-files; use simple integers for output filenames"
"o: --output-directory:; specify the directory to place the results in"
"--progress; report progress"
"q --quiet; don't print created patch filenames"
"--range-diff:; specify a revision to compare with and produce a range-diff"
"v: --reroll-count:; mark patches with a specified version"
"--rfc::; prepend an additional subject prefix"
"--root; treat the operand as a revision range"
"--signature:; specify a signature appended to each message"
"--signature-file:; specify a file containing a signature"
"s --signoff; include a signed-off-by line"
"--start-number:; specify a number to start numbering patches from"
"--stdout; output results to the standard output rather than files"
"--subject-prefix:; specify a string prefix to the subject"
"--suffix:; specify a suffix appended to result filenames"
"--thread::; specify mail threading behavior"
"--to:; specify an additional receiver"
"--zero-commit; replace commit hashes with zeros"
) #<#
if command -vf completion/git::diff:getopt >/dev/null 2>&1 ||
. -AL completion/git-diff; then
command -f completion/git::diff:getopt
fi
command -f completion//parseoptions -n
case $ARGOPT in
(-)
command -f completion//completeoptions
;;
(--add-header)
;;
(--attach|--inline)
;;
(--base)
complete -P "$PREFIX" auto
command -f completion/git::completeref
;;
(--cover-from-description) #>>#
complete -P "$PREFIX" -D "auto-fill message body" message default
complete -P "$PREFIX" -D "auto-fill message subject and body" subject
complete -P "$PREFIX" -D "based on description length" auto
complete -P "$PREFIX" none
;; #<<#
(--in-reply-to)
;;
(--interdiff|--range-diff)
command -f completion/git::completeref
;;
(--notes)
command -f completion/git::completeref \
abbrprefixes=refs/notes/ dontcompletefull=true \
--glob=refs/notes/\*
;;
(o|--output-directory)
complete -P "$PREFIX" -S / -T -d
;;
(--rfc)
;;
(--signature)
;;
(--signature-file)
complete -P "$PREFIX" -f
;;
(--start-number)
;;
(--subject-prefix)
;;
(--suffix)
;;
(--to|--cc)
;;
('')
command -f completion/git::completeref range=true
;;
(*)
command -f completion/git::diff:compopt
;;
esac
}
# vim: set ft=sh ts=8 sts=8 sw=8 et:
|