git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolas Vigier <boklm@mars-attacks.org>
To: git@vger.kernel.org
Cc: Nicolas Vigier <boklm@mars-attacks.org>
Subject: [PATCH 4/8] am: add the --gpg-sign option
Date: Sun,  3 Nov 2013 16:54:20 +0100	[thread overview]
Message-ID: <1383494064-5653-5-git-send-email-boklm@mars-attacks.org> (raw)
In-Reply-To: <1383494064-5653-1-git-send-email-boklm@mars-attacks.org>

Signed-off-by: Nicolas Vigier <boklm@mars-attacks.org>
---
 Documentation/git-am.txt | 6 +++++-
 git-am.sh                | 9 ++++++++-
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/Documentation/git-am.txt b/Documentation/git-am.txt
index 54d8461d61b2..17924d0f3ff3 100644
--- a/Documentation/git-am.txt
+++ b/Documentation/git-am.txt
@@ -14,7 +14,7 @@ SYNOPSIS
 	 [--ignore-date] [--ignore-space-change | --ignore-whitespace]
 	 [--whitespace=<option>] [-C<n>] [-p<n>] [--directory=<dir>]
 	 [--exclude=<path>] [--include=<path>] [--reject] [-q | --quiet]
-	 [--[no-]scissors]
+	 [--[no-]scissors] [-S[<keyid>]]
 	 [(<mbox> | <Maildir>)...]
 'git am' (--continue | --skip | --abort)
 
@@ -119,6 +119,10 @@ default.   You can use `--no-utf8` to override this.
 	Skip the current patch.  This is only meaningful when
 	restarting an aborted patch.
 
+-S[<keyid>]::
+--gpg-sign[=<keyid>]::
+	GPG-sign commits.
+
 --continue::
 -r::
 --resolved::
diff --git a/git-am.sh b/git-am.sh
index 020abf6940bd..dccbae2af0de 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -38,6 +38,7 @@ abort           restore the original branch and abort the patching operation.
 committer-date-is-author-date    lie about committer date
 ignore-date     use current timestamp for author date
 rerere-autoupdate update the index with reused conflict resolution if possible
+S,gpg-sign?     GPG-sign commits
 rebasing*       (internal use for git-rebase)"
 
 . git-sh-setup
@@ -375,6 +376,7 @@ git_apply_opt=
 committer_date_is_author_date=
 ignore_date=
 allow_rerere_autoupdate=
+gpg_sign_opt=
 
 if test "$(git config --bool --get am.keepcr)" = true
 then
@@ -436,6 +438,10 @@ it will be removed. Please do not use it anymore."
 		keepcr=t ;;
 	--no-keep-cr)
 		keepcr=f ;;
+	--gpg-sign)
+		gpg_sign_opt=-S ;;
+	--gpg-sign=*)
+		gpg_sign_opt="-S${1#--gpg-sign=}" ;;
 	--)
 		shift; break ;;
 	*)
@@ -900,7 +906,8 @@ did you forget to use 'git add'?"
 			GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"
 			export GIT_COMMITTER_DATE
 		fi &&
-		git commit-tree $tree ${parent:+-p} $parent <"$dotest/final-commit"
+		git commit-tree ${gpg_sign_opt:+"$gpg_sign_opt"} $tree ${parent:+-p} $parent \
+			<"$dotest/final-commit"
 	) &&
 	git update-ref -m "$GIT_REFLOG_ACTION: $FIRSTLINE" HEAD $commit $parent ||
 	stop_here $this
-- 
1.8.4.2

  parent reply	other threads:[~2013-11-03 15:55 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-03 15:54 Adding --gpg-sign to cherry-pick, revert, am, rebase Nicolas Vigier
2013-11-03 15:54 ` [PATCH 1/8] cherry-pick, revert: add the --gpg-sign option Nicolas Vigier
2013-11-03 17:50   ` brian m. carlson
2013-11-03 18:00     ` Nicolas Vigier
2013-11-03 18:46     ` [PATCH] " Nicolas Vigier
2013-11-03 18:48       ` brian m. carlson
2013-11-03 15:54 ` [PATCH 2/8] git-sh-setup.sh: add variable to use the stuck-long mode Nicolas Vigier
2013-11-03 15:54 ` [PATCH 3/8] am: parse options in " Nicolas Vigier
2013-11-03 15:54 ` Nicolas Vigier [this message]
2013-11-03 19:30   ` [PATCH] am: add the --gpg-sign option Nicolas Vigier
2013-11-03 15:54 ` [PATCH 5/8] rebase: remove useless arguments check Nicolas Vigier
2013-11-03 15:54 ` [PATCH 6/8] rebase: don't try to match -M option Nicolas Vigier
2013-11-03 15:54 ` [PATCH 7/8] rebase: parse options in stuck-long mode Nicolas Vigier
2013-11-03 15:54 ` [PATCH 8/8] rebase: add the --gpg-sign option Nicolas Vigier
2013-12-08 20:40 ` Adding --gpg-sign to cherry-pick, revert, am, rebase brian m. carlson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1383494064-5653-5-git-send-email-boklm@mars-attacks.org \
    --to=boklm@mars-attacks.org \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).