From 0393beffaa4933a0f0944c1cefe473670bcbd32e Mon Sep 17 00:00:00 2001 From: Heiko Voigt Date: Tue, 22 Dec 2009 22:12:16 +0100 Subject: [PATCH] installer: further automate release script Necessary steps like editing the release notes, compiling and so on can be automated as part of the standard release script. Signed-off-by: Heiko Voigt --- share/WinGit/release.sh | 50 ++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 43 insertions(+), 7 deletions(-) diff --git a/share/WinGit/release.sh b/share/WinGit/release.sh index 3bd8b30b..ab7f55ac 100644 --- a/share/WinGit/release.sh +++ b/share/WinGit/release.sh @@ -1,20 +1,56 @@ #!/bin/sh force= -case "$1" in --f|--force) - force=t - shift - ;; -esac +do_compile=t +while test $# -gt 0 +do + case "$1" in + -f|--force) + force=t + shift + ;; + -n|--no-compile) + do_compile= + shift + ;; + *) + break + esac +done test -z "$1" && { - echo "Usage: $0 " >&2 + echo "Usage: $0 [-f] [-n] " >&2 exit 1 } version=$1 +create_msysgit_tag () { + i=0 && + while ! git tag -a -m "Git for Windows $1" \ + $(git describe HEAD | cut -d- -f1).msysgit.$i + do + i=$[$i+1] + done +} + +# compile everything needed for standard setup +test "$do_compile" && { + start /share/WinGit/ReleaseNotes.rtf && + echo "Press enter to continue (Ctrl-C to stop)" && + read && { + # create a commit if ReleaseNotes changed + test "$(git diff /share/WinGit/ReleaseNotes.rtf)" && { + git add /share/WinGit/ReleaseNotes.rtf && + git commit -m "Git for Windows $version" + } + (cd /git && + create_msysgit_tag $version && + make install) && + (cd /src/git-cheetah/explorer/ && make) + } || exit 1 +} + test -z "$force" && { die () { echo "$*" >&2 -- 2.11.4.GIT