am: add the --gpg-sign option

Signed-off-by: Nicolas Vigier <boklm@mars-attacks.org> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Nicolas Vigier committed Feb 1, 2014 at 02:18 UTC 3b4e395f510c0193be06f264ec53271a6baf0414
2 files changed +13 -2
Documentation/git-am.txt
+5 -1
@@ -14,7 +14,7 @@ SYNOPSIS
14 [--ignore-date] [--ignore-space-change | --ignore-whitespace]
15 [--whitespace=<option>] [-C<n>] [-p<n>] [--directory=<dir>]
16 [--exclude=<path>] [--include=<path>] [--reject] [-q | --quiet]
17 - [--[no-]scissors]
17 + [--[no-]scissors] [-S[<keyid>]]
18 [(<mbox> | <Maildir>)...]
19 'git am' (--continue | --skip | --abort)
20
@@ -119,6 +119,10 @@ default. You can use `--no-utf8` to override this.
119 Skip the current patch. This is only meaningful when
120 restarting an aborted patch.
121
122 +-S[<keyid>]::
123 +--gpg-sign[=<keyid>]::
124 + GPG-sign commits.
125 +
126 --continue::
127 -r::
128 --resolved::
git-am.sh
+8 -1
@@ -38,6 +38,7 @@ abort restore the original branch and abort the patching operation.
38 committer-date-is-author-date lie about committer date
39 ignore-date use current timestamp for author date
40 rerere-autoupdate update the index with reused conflict resolution if possible
41 +S,gpg-sign? GPG-sign commits
42 rebasing* (internal use for git-rebase)"
43
44 . git-sh-setup
@@ -375,6 +376,7 @@ git_apply_opt=
376 committer_date_is_author_date=
377 ignore_date=
378 allow_rerere_autoupdate=
379 +gpg_sign_opt=
380
381 if test "$(git config --bool --get am.keepcr)" = true
382 then
@@ -436,6 +438,10 @@ it will be removed. Please do not use it anymore."
438 keepcr=t ;;
439 --no-keep-cr)
440 keepcr=f ;;
441 + --gpg-sign)
442 + gpg_sign_opt=-S ;;
443 + --gpg-sign=*)
444 + gpg_sign_opt="-S${1#--gpg-sign=}" ;;
445 --)
446 shift; break ;;
447 *)
@@ -900,7 +906,8 @@ did you forget to use 'git add'?"
906 GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"
907 export GIT_COMMITTER_DATE
908 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"
911 ) &&
912 git update-ref -m "$GIT_REFLOG_ACTION: $FIRSTLINE" HEAD $commit $parent ||
913 stop_here $this