From 5efa123f36a12259166e4664722046e3b1e52932 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Sun, 17 Jan 2016 20:04:34 +0100 Subject: [PATCH] bump.sh: skip bump commit when empty --- scripts/bump.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/bump.sh b/scripts/bump.sh index 04a9616..6b95d5e 100755 --- a/scripts/bump.sh +++ b/scripts/bump.sh @@ -9,7 +9,7 @@ fi VERSION=$1 -if ! echo $VERSION | grep -q "^[0-9.]-?.*?$"; then +if ! echo $VERSION | grep -Eq "^[0-9.]*(-.+)?$"; then echo "invalid version"; exit 1 fi @@ -24,7 +24,13 @@ sed -i 's/(defconst ghc-version ".*")/(defconst ghc-version "'"$VERSION"'")/' \ sed -r -i 's/^(Version:[[:space:]]*)[0-9.]+/\1'"$VERSION"'/' ghc-mod.cabal git add elisp/ghc.el ghc-mod.cabal -git commit -m "Bump version to $VERSION" + +git update-index -q --ignore-submodules --refresh +# If there are uncommitted changes do the bump commit +if ! git diff-index --cached --quiet HEAD --ignore-submodules -- +then + git commit -m "Bump version to $VERSION" --allow-empty +fi git checkout release #git merge master