Maven fails on uncomitted changes, so exit early to not create branches 
unnecessary.,


Project: http://git-wip-us.apache.org/repos/asf/logging-log4cxx/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4cxx/commit/53d7fdec
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4cxx/tree/53d7fdec
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4cxx/diff/53d7fdec

Branch: refs/heads/next_stable
Commit: 53d7fdec3fd8ac07a6e635548ac8658715b3af40
Parents: d26e229
Author: Thorsten Schöning <[email protected]>
Authored: Wed Aug 16 10:05:33 2017 +0200
Committer: Thorsten Schöning <[email protected]>
Committed: Wed Aug 16 10:05:33 2017 +0200

----------------------------------------------------------------------
 releasePrepare.sh | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4cxx/blob/53d7fdec/releasePrepare.sh
----------------------------------------------------------------------
diff --git a/releasePrepare.sh b/releasePrepare.sh
index cd02a34..0657465 100755
--- a/releasePrepare.sh
+++ b/releasePrepare.sh
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # Licensed to the Apache Software Foundation (ASF) under one or more
 # contributor license agreements.  See the NOTICE file distributed with
 # this work for additional information regarding copyright ownership.
@@ -22,8 +22,15 @@
 # and quite a lot of the needed changes are possible in this script, so that is
 # preferred over manually following some docs in the wiki.
 #
-branch_starting=$(      git branch | grep "\*" | cut -d " " -f 2)
-branch_starting_is_ns=$(git branch | grep "\* next_stable")
+
+if [[ -n $(git status) || $(git diff-index HEAD) ]]
+then
+  echo Maven release process requires committed changes!
+  exit 1
+fi
+
+branch_starting=$(         git branch | grep "\*" | cut -d " " -f 2)
+branch_starting_is_ns=$(   git branch | grep "\* next_stable")
 
 if [ -z "${branch_starting_is_ns}" ]
 then
@@ -43,8 +50,8 @@ then
   git checkout "next_stable"
 fi
 
-mvn clean                          || exit 1
-mvn release:prepare -Dresume=false || exit 1
+#mvn clean                          || exit 1
+#mvn release:prepare -Dresume=false || exit 1
 
 if [ -z "${branch_starting_is_ns}" ]
 then

Reply via email to