Resolve "8 characters for git hash"

This commit is contained in:
Hari Nair
2023-03-29 18:13:28 +00:00
parent 32766e3701
commit 8cae62ae69
2 changed files with 4 additions and 5 deletions

View File

@@ -5,17 +5,16 @@
package=jackfruit
srcFile="../java/jackfruit/JackfruitVersion.java"
cd $(dirname "$0")
cd "$(dirname "$0")"
date=$(date -u +"%y.%m.%d")
rev=$(git rev-parse --verify --short HEAD)
rev=$(git rev-parse --verify --short=8 HEAD)
if [ $? -gt 0 ]; then
lastCommit=$(date -u +"%y.%m.%d")
rev="UNVERSIONED"
else
lastCommit=$(git log -1 --format=%cd --date=format:%y.%m.%d)
rev=$(git rev-parse --verify --short HEAD)
if [[ $(git diff --stat) != '' ]]; then
if [[ $(git status -s | grep -v pom.xml | grep -v pom.bak | grep -v .m2 | grep -v $srcFile) != '' ]]; then
@@ -24,7 +23,7 @@ else
fi
fi
mkdir -p $(dirname "$srcFile")
mkdir -p "$(dirname "$srcFile")"
touch $srcFile

View File

@@ -4,7 +4,7 @@ package jackfruit;
public class JackfruitVersion {
public final static String lastCommit = "23.03.29";
// an M at the end of gitRevision means this was built from a "dirty" git repository
public final static String rev = "b200487M";
public final static String rev = "32766e37M";
public final static String packageName = "jackfruit";
public final static String dateString = "23.03.29";
}