Re: [PATCH v2 8/9] rebase: add the --gpg-sign option

2014-01-27 Thread Junio C Hamano
brian m. carlson sand...@crustytoothpaste.net writes:

 diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
 index 43c19e0..73d32dd 100644
 --- a/git-rebase--interactive.sh
 +++ b/git-rebase--interactive.sh
 @@ -181,7 +181,7 @@ exit_with_patch () {
   git rev-parse --verify HEAD  $amend
   warn You can amend the commit now, with
   warn
 - warn   git commit --amend
 + warn   git commit --amend $gpg_sign_opt

I think this is meant to be cut--pasted, so you may have to quote
the RHS of --gpg-sign=key (or the key part of -Skey).

The same comment as the one for 'git pull' patch applies around
'eval's in the remainder of the patch.

 @@ -248,7 +248,8 @@ pick_one () {
  
   test -d $rewritten 
   pick_one_preserving_merges $@  return
 - output eval git cherry-pick $strategy_args $empty_args $ff $@
 + output eval git cherry-pick ${gpg_sign_opt:+$gpg_sign_opt} \
 + $strategy_args $empty_args $ff $@
  }
 [rest snipped]

Thanks.

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 8/9] rebase: add the --gpg-sign option

2014-01-27 Thread brian m. carlson
On Mon, Jan 27, 2014 at 03:36:44PM -0800, Junio C Hamano wrote:
 brian m. carlson sand...@crustytoothpaste.net writes:
 
  diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
  index 43c19e0..73d32dd 100644
  --- a/git-rebase--interactive.sh
  +++ b/git-rebase--interactive.sh
  @@ -181,7 +181,7 @@ exit_with_patch () {
  git rev-parse --verify HEAD  $amend
  warn You can amend the commit now, with
  warn
  -   warn   git commit --amend
  +   warn   git commit --amend $gpg_sign_opt
 
 I think this is meant to be cut--pasted, so you may have to quote
 the RHS of --gpg-sign=key (or the key part of -Skey).
 
 The same comment as the one for 'git pull' patch applies around
 'eval's in the remainder of the patch.
 
  @@ -248,7 +248,8 @@ pick_one () {
   
  test -d $rewritten 
  pick_one_preserving_merges $@  return
  -   output eval git cherry-pick $strategy_args $empty_args $ff $@
  +   output eval git cherry-pick ${gpg_sign_opt:+$gpg_sign_opt} \
  +   $strategy_args $empty_args $ff $@
   }
  [rest snipped]
 
 Thanks.

Thanks for the review.  I'll get working on a reroll.

-- 
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187


signature.asc
Description: Digital signature


[PATCH v2 8/9] rebase: add the --gpg-sign option

2014-01-23 Thread brian m. carlson
From: Nicolas Vigier bo...@mars-attacks.org

Signed-off-by: Nicolas Vigier bo...@mars-attacks.org
Signed-off-by: brian m. carlson sand...@crustytoothpaste.net
---
 Documentation/git-rebase.txt |  4 
 git-rebase--am.sh|  8 +---
 git-rebase--interactive.sh   | 32 
 git-rebase--merge.sh |  2 +-
 git-rebase.sh| 11 +++
 5 files changed, 41 insertions(+), 16 deletions(-)

diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
index 2889be6..2a93c64 100644
--- a/Documentation/git-rebase.txt
+++ b/Documentation/git-rebase.txt
@@ -281,6 +281,10 @@ which makes little sense.
specified, `-s recursive`.  Note the reversal of 'ours' and
'theirs' as noted above for the `-m` option.
 
+-S[keyid]::
+--gpg-sign[=keyid]::
+   GPG-sign commits.
+
 -q::
 --quiet::
Be quiet. Implies --no-stat.
diff --git a/git-rebase--am.sh b/git-rebase--am.sh
index a4f683a..df46f4c 100644
--- a/git-rebase--am.sh
+++ b/git-rebase--am.sh
@@ -6,7 +6,8 @@
 
 case $action in
 continue)
-   git am --resolved --resolvemsg=$resolvemsg 
+   git am --resolved --resolvemsg=$resolvemsg \
+   ${gpg_sign_opt:+$gpg_sign_opt} 
move_to_original_branch
return
;;
@@ -26,7 +27,7 @@ then
# empty commits and even if it didn't the format doesn't really lend
# itself well to recording empty patches.  fortunately, cherry-pick
# makes this easy
-   git cherry-pick --allow-empty $revisions
+   git cherry-pick ${gpg_sign_opt:+$gpg_sign_opt} --allow-empty 
$revisions
ret=$?
 else
rm -f $GIT_DIR/rebased-patches
@@ -60,7 +61,8 @@ else
return $?
fi
 
-   git am $git_am_opt --rebasing --resolvemsg=$resolvemsg 
$GIT_DIR/rebased-patches
+   git am $git_am_opt --rebasing --resolvemsg=$resolvemsg \
+   ${gpg_sign_opt:+$gpg_sign_opt} $GIT_DIR/rebased-patches
ret=$?
 
rm -f $GIT_DIR/rebased-patches
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 43c19e0..73d32dd 100644
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -181,7 +181,7 @@ exit_with_patch () {
git rev-parse --verify HEAD  $amend
warn You can amend the commit now, with
warn
-   warn   git commit --amend
+   warn   git commit --amend $gpg_sign_opt
warn
warn Once you are satisfied with your changes, run
warn
@@ -248,7 +248,8 @@ pick_one () {
 
test -d $rewritten 
pick_one_preserving_merges $@  return
-   output eval git cherry-pick $strategy_args $empty_args $ff $@
+   output eval git cherry-pick ${gpg_sign_opt:+$gpg_sign_opt} \
+   $strategy_args $empty_args $ff $@
 }
 
 pick_one_preserving_merges () {
@@ -359,7 +360,8 @@ pick_one_preserving_merges () {
echo $sha1 $(git rev-parse HEAD^0)  
$rewritten_list
;;
*)
-   output eval git cherry-pick $strategy_args $@ ||
+   output eval git cherry-pick 
${gpg_sign_opt:+$gpg_sign_opt} \
+   $strategy_args $@ ||
die_with_patch $sha1 Could not pick $sha1
;;
esac
@@ -470,7 +472,8 @@ do_pick () {
   --no-post-rewrite -n -q -C $1 
pick_one -n $1 
git commit --allow-empty --allow-empty-message \
-  --amend --no-post-rewrite -n -q -C $1 ||
+  --amend --no-post-rewrite -n -q -C $1 \
+  ${gpg_sign_opt:+$gpg_sign_opt} ||
die_with_patch $1 Could not apply $1... $2
else
pick_one $1 ||
@@ -497,7 +500,7 @@ do_next () {
 
mark_action_done
do_pick $sha1 $rest
-   git commit --amend --no-post-rewrite || {
+   git commit --amend --no-post-rewrite 
${gpg_sign_opt:+$gpg_sign_opt} || {
warn Could not amend commit after successfully picking 
$sha1... $rest
warn This is most likely due to an empty commit 
message, or the pre-commit hook
warn failed. If the pre-commit hook failed, you may 
need to resolve the issue before
@@ -542,19 +545,22 @@ do_next () {
squash|s|fixup|f)
# This is an intermediate commit; its message will only 
be
# used in case of trouble.  So use the long version:
-   do_with_author output git commit --amend --no-verify -F 
$squash_msg ||
+   do_with_author output git commit --amend --no-verify -F 
$squash_msg \
+   ${gpg_sign_opt:+$gpg_sign_opt} ||