Support extracting emails from Signed-off-by lines
[jgit.git] / tag_jgit.sh
blob805f9689243269a07d1742d8e48447d2ef8d6be8
1 #!/bin/sh
3 # Updates MANIFEST.MF files for EGit plugins.
5 v=$1
6 if [ -z "$v" ]
7 then
8 echo >&2 "usage: $0 version"
9 exit 1
12 MF=$(git ls-files | grep META-INF/MANIFEST.MF)
13 MV=jgit-maven/jgit/pom.xml
14 ALL="$MF $MV"
16 replace() {
17 version=$1
19 perl -pi -e 's/^(Bundle-Version:).*/$1 '$version/ $MF
20 perl -pi -e 's,^ <version>.*</version>, <version>'$2'</version>,' $MV
23 replace $v $v
24 git commit -s -m "JGit $v" $ALL &&
25 c=$(git rev-parse HEAD) &&
27 replace $v.qualifier $v-SNAPSHOT &&
28 git commit -s -m "Re-add version qualifier suffix to $v" $ALL &&
30 echo &&
31 tagcmd="git tag -s -m 'JGit $v' v$v $c" &&
32 if ! eval $tagcmd
33 then
34 echo >&2
35 echo >&2 "Tag with:"
36 echo >&2 " $tagcmd"
37 exit 1
38 fi || exit