aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2014-01-16 11:53:17 +0200
committerMichael S. Tsirkin <mst@redhat.com>2014-05-18 23:24:34 +0300
commit1a23b6e073d663b35d5abed2c0331f9825785240 (patch)
treed310415a064deac130db2668a1ba951fc0253f84
parente1af31bea9f8296fae60f7feda53654839e20913 (diff)
downloadgit-1a23b6e073d663b35d5abed2c0331f9825785240.tar.gz
git-am: support any number of signatures
Add new flag -a which can add any signature, and any number of them. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
-rwxr-xr-xgit-am.sh23
1 files changed, 20 insertions, 3 deletions
diff --git a/git-am.sh b/git-am.sh
index ee61a77d71..16fb337abb 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -31,6 +31,7 @@ p= pass it through git-apply
patch-format= format the patch(es) are in
reject pass it through git-apply
resolvemsg= override error message when patch failure occurs
+a,ack= add an ack line to the commit message
continue continue applying patches after resolving a conflict
r,resolved synonyms for --continue
skip skip the current patch
@@ -377,6 +378,7 @@ committer_date_is_author_date=
ignore_date=
allow_rerere_autoupdate=
gpg_sign_opt=
+SIGNOFF=
if test "$(git config --bool --get am.keepcr)" = true
then
@@ -418,6 +420,19 @@ it will be removed. Please do not use it anymore."
rebasing=t threeway=t ;;
--resolvemsg=*)
resolvemsg="${1#--resolvemsg=}" ;;
+ -a|--ack)
+ shift
+ ack=$1
+ acks=`git config --get-all am.ack-$ack`
+ if test "acks"
+ then
+ if test "$SIGNOFF"
+ then
+ SIGNOFF=$SIGNOFF"
+"
+ fi
+ SIGNOFF=$SIGNOFF$acks
+ fi;;
--whitespace=*|--directory=*|--exclude=*|--include=*)
git_apply_opt="$git_apply_opt $(sq "$1")" ;;
-C*|-p*)
@@ -644,12 +659,14 @@ fi
git_apply_opt=$(cat "$dotest/apply-opt")
if test "$(cat "$dotest/sign")" = t
then
- SIGNOFF=$(git var GIT_COMMITTER_IDENT | sed -e '
+ if test "$SIGNOFF"
+ then
+ SIGNOFF=$SIGNOFF"\n"
+ fi
+ SIGNOFF=$SIGNOFF$(git var GIT_COMMITTER_IDENT | sed -e '
s/>.*/>/
s/^/Signed-off-by: /'
)
-else
- SIGNOFF=
fi
last=$(cat "$dotest/last")