Skip to content

Commit

Permalink
Merge #557: [Build] Revert #402 "Change git info in genbuild.sh"
Browse files Browse the repository at this point in the history
b5be194 Revert #402 "Change git info in genbuild.sh" (Fuzzbawls)

Tree-SHA512: dfd8e99be8457a1c6973e4dd4883dc8c1f34541e68a10fcc9d3600abebba008474c13aa5de00a556f51f4d83bdcd95942cd5a1eb6fd2b031a9cd12daba1458a8
  • Loading branch information
Mrs-X committed Mar 6, 2018
2 parents 456bcfe + b5be194 commit a471f70
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions share/genbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,23 @@ if [ -e "$(which git 2>/dev/null)" -a "$(git rev-parse --is-inside-work-tree 2>/
git diff >/dev/null 2>/dev/null

# if latest commit is tagged and not dirty, then override using the tag name
DESC=$(git describe 2>/dev/null)
RAWDESC=$(git describe --abbrev=0 2>/dev/null)
git diff-index --quiet HEAD -- || DESC="$DESC-dirty"
if [ "$(git rev-parse HEAD)" = "$(git rev-list -1 $RAWDESC)" ]; then
git diff-index --quiet HEAD -- && DESC=$RAWDESC
fi

# otherwise generate suffix from git, i.e. string like "59887e8-dirty"
SUFFIX=$(git rev-parse --short HEAD)
git diff-index --quiet HEAD -- || SUFFIX="$SUFFIX-dirty"

# get a string like "2012-04-10 16:27:19 +0200"
LAST_COMMIT_DATE="$(git log -n 1 --format="%ci")"
fi

if [ -n "$DESC" ]; then
NEWINFO="#define BUILD_DESC \"$DESC\""
elif [ -n "$SUFFIX" ]; then
NEWINFO="#define BUILD_SUFFIX $SUFFIX"
else
NEWINFO="// No build information available"
fi
Expand Down

0 comments on commit a471f70

Please sign in to comment.