Skip to content

Commit d9ac9df

Browse files
dschoJunio C Hamano
authored andcommitted
[PATCH] Make git-format-patch's signoff option more consistent
Since git-commit-script has a "--signoff" option, use that in git-format-patch-script, too (and since partial option names are supported,"--sign" is still valid). Also, if the message already contains the S-O-B line, silently ignore the "--signoff" request. Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2150cc9 commit d9ac9df

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

git-format-patch-script

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
. git-sh-setup-script || die "Not a git archive."
77

88
usage () {
9-
echo >&2 "usage: $0"' [-n] [-o dir] [--mbox] [--check] [--sign] [-<diff options>...] upstream [ our-head ]
9+
echo >&2 "usage: $0"' [-n] [-o dir] [--mbox] [--check] [--signoff] [-<diff options>...] upstream [ our-head ]
1010
1111
Prepare each commit with its patch since our-head forked from upstream,
1212
one file per patch, for e-mail submission. Each output file is
@@ -46,7 +46,7 @@ do
4646
date=t author=t mbox=t ;;
4747
-n|--n|--nu|--num|--numb|--numbe|--number|--numbere|--numbered)
4848
numbered=t ;;
49-
-s|--s|--si|--sig|--sign)
49+
-s|--s|--si|--sig|--sign|--signo|--signof|--signoff)
5050
signoff=t ;;
5151
-o=*|--o=*|--ou=*|--out=*|--outp=*|--outpu=*|--output=*|--output-=*|\
5252
--output-d=*|--output-di=*|--output-dir=*|--output-dire=*|\
@@ -179,9 +179,12 @@ Date: '"$ad"
179179

180180
test "$signoff" = "t" && {
181181
offsigner=`git-var GIT_COMMITTER_IDENT | sed -e 's/>.*/>/'`
182-
echo
183-
echo "Signed-off-by: $offsigner"
184-
echo
182+
line="Signed-off-by: $offsigner"
183+
grep -q "^$line\$" $commsg || {
184+
echo
185+
echo "$line"
186+
echo
187+
}
185188
}
186189

187190
echo '---'

0 commit comments

Comments
 (0)