Git installer: create an annotated tag
[msysgit.git] / share / WinGit / release.sh
blob436f6da6a2536fad65e56412be7ead1948c78a04
1 #!/bin/sh
3 force=
4 case "$1" in
5 -f|--force)
6 force=t
7 shift
8 ;;
9 esac
11 test -z "$1" && {
12 echo "Usage: $0 <version>" >&2
13 exit 1
16 version=$1
18 test -z "$force" && {
19 die () {
20 echo "$*" >&2
21 echo "If that is okay, please call '$0 -f $version'" >&2
22 exit 1
25 (cd /git &&
26 git update-index --refresh &&
27 git diff-files --quiet &&
28 git diff-index --cached HEAD --) ||
29 die "Git submodule has dirty files"
30 (cd /git &&
31 test git.exe = $(ls -t git.exe $(git ls-files) | head -n 1)) ||
32 die "Git's git.exe is not up-to-date (run 'cd /git && make' to fix)"
33 for f in /bin/git* /libexec/git-core/git*
35 case "$f" in
36 *.manifest)
37 continue
39 */gitk)
40 basename=gitk-git/gitk
42 */git-citool|*/git-gui)
43 basename=git-gui/git-gui
45 */git-gui--askpass|*/git-gui.tcl)
46 basename=git-gui/$(basename "$f")
49 basename=$(basename "$f")
51 esac
52 cmp "$f" "/git/$basename" ||
53 die "Installed Git disagrees with contents of /git/"
54 done
55 (cd / &&
56 git update-index --refresh &&
57 git diff-files --quiet &&
58 git diff-index --cached HEAD --) ||
59 die "msysGit super project not up-to-date"
60 (cd /git &&
61 test ! -z "$(git tag --contains HEAD)") ||
62 die "Git's HEAD is untagged"
65 TMPDIR=/tmp/WinGit
66 unset DONT_REMOVE_BUILTINS
68 /share/WinGit/copy-files.sh $TMPDIR &&
69 sed -e '/share\/msysGit/d' -e "s/msysGit/Git (version $version)/" \
70 < /etc/motd > $TMPDIR/etc/motd &&
71 cp /share/resources/gpl-2.0.rtf /share/resources/git.bmp $TMPDIR &&
72 homewinpath=$(cd ~ ; pwd -W) &&
73 sed -e "s/%APPVERSION%/$version/" -e "s@%OUTPUTDIR%@$homewinpath@" \
74 < /share/WinGit/install.iss > $TMPDIR/install.iss &&
75 echo "Lauching Inno Setup compiler ..." &&
76 /share/InnoSetup/ISCC.exe "$TMPDIR/install.iss" /q | grep -Ev "\s*Reading|\s*Compressing" &&
77 (cd / && git tag -a -m "Git for Windows $1" Git-$1)