Skip to content

Commit f1c62ee

Browse files
committed
Merge branch 'maint'
* maint: Documentation: Document signature showing options completion: fix shell expansion of items
2 parents b0576a6 + 8ef2794 commit f1c62ee

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

Documentation/pretty-formats.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ The placeholders are:
130130
- '%b': body
131131
- '%B': raw body (unwrapped subject and body)
132132
- '%N': commit notes
133+
- '%GG': raw verification message from GPG for a signed commit
134+
- '%G?': show either "G" for Good or "B" for Bad for a signed commit
135+
- '%GS': show the name of the signer for a signed commit
133136
- '%gD': reflog selector, e.g., `refs/stash@{1}`
134137
- '%gd': shortened reflog selector, e.g., `stash@{1}`
135138
- '%gn': reflog identity name

Documentation/pretty-options.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,7 @@ being displayed. Examples: "--notes=foo" will show only notes from
6666
--[no-]standard-notes::
6767
These options are deprecated. Use the above --notes/--no-notes
6868
options instead.
69+
70+
--show-signature::
71+
Check the validity of a signed commit object by passing the signature
72+
to `gpg --verify` and show the output.

contrib/completion/git-completion.bash

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,13 @@ _get_comp_words_by_ref ()
225225
fi
226226
fi
227227

228+
# Quotes the argument for shell reuse
229+
__git_quote()
230+
{
231+
local quoted=${1//\'/\'\\\'\'}
232+
printf "'%s'" "$quoted"
233+
}
234+
228235
# Generates completion reply with compgen, appending a space to possible
229236
# completion words, if necessary.
230237
# It accepts 1 to 4 arguments:
@@ -261,7 +268,7 @@ __gitcomp ()
261268
__gitcomp_nl ()
262269
{
263270
local IFS=$'\n'
264-
COMPREPLY=($(compgen -P "${2-}" -S "${4- }" -W "$1" -- "${3-$cur}"))
271+
COMPREPLY=($(compgen -P "${2-}" -S "${4- }" -W "$(__git_quote "$1")" -- "${3-$cur}"))
265272
}
266273

267274
__git_heads ()

0 commit comments

Comments
 (0)