Skip to content

Commit 3b4e395

Browse files
boklmgitster
authored andcommitted
am: add the --gpg-sign option
Signed-off-by: Nicolas Vigier <[email protected]> Signed-off-by: brian m. carlson <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 8833662 commit 3b4e395

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

Documentation/git-am.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ SYNOPSIS
1414
[--ignore-date] [--ignore-space-change | --ignore-whitespace]
1515
[--whitespace=<option>] [-C<n>] [-p<n>] [--directory=<dir>]
1616
[--exclude=<path>] [--include=<path>] [--reject] [-q | --quiet]
17-
[--[no-]scissors]
17+
[--[no-]scissors] [-S[<keyid>]]
1818
[(<mbox> | <Maildir>)...]
1919
'git am' (--continue | --skip | --abort)
2020

@@ -119,6 +119,10 @@ default. You can use `--no-utf8` to override this.
119119
Skip the current patch. This is only meaningful when
120120
restarting an aborted patch.
121121

122+
-S[<keyid>]::
123+
--gpg-sign[=<keyid>]::
124+
GPG-sign commits.
125+
122126
--continue::
123127
-r::
124128
--resolved::

git-am.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ abort restore the original branch and abort the patching operation.
3838
committer-date-is-author-date lie about committer date
3939
ignore-date use current timestamp for author date
4040
rerere-autoupdate update the index with reused conflict resolution if possible
41+
S,gpg-sign? GPG-sign commits
4142
rebasing* (internal use for git-rebase)"
4243

4344
. git-sh-setup
@@ -375,6 +376,7 @@ git_apply_opt=
375376
committer_date_is_author_date=
376377
ignore_date=
377378
allow_rerere_autoupdate=
379+
gpg_sign_opt=
378380

379381
if test "$(git config --bool --get am.keepcr)" = true
380382
then
@@ -436,6 +438,10 @@ it will be removed. Please do not use it anymore."
436438
keepcr=t ;;
437439
--no-keep-cr)
438440
keepcr=f ;;
441+
--gpg-sign)
442+
gpg_sign_opt=-S ;;
443+
--gpg-sign=*)
444+
gpg_sign_opt="-S${1#--gpg-sign=}" ;;
439445
--)
440446
shift; break ;;
441447
*)
@@ -900,7 +906,8 @@ did you forget to use 'git add'?"
900906
GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"
901907
export GIT_COMMITTER_DATE
902908
fi &&
903-
git commit-tree $tree ${parent:+-p} $parent <"$dotest/final-commit"
909+
git commit-tree ${parent:+-p} $parent ${gpg_sign_opt:+"$gpg_sign_opt"} $tree \
910+
<"$dotest/final-commit"
904911
) &&
905912
git update-ref -m "$GIT_REFLOG_ACTION: $FIRSTLINE" HEAD $commit $parent ||
906913
stop_here $this

0 commit comments

Comments
 (0)