Skip to content

Commit

Permalink
Merge pull request #7781 from tkelman/date-format
Browse files Browse the repository at this point in the history
workaround old version of /bin/date in msysgit
  • Loading branch information
Keno committed Jul 30, 2014
2 parents e717601 + 8a4bd17 commit ff8fe5d
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions base/version_git.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,18 @@ branch=$(git branch | sed -n '/\* /s///p')
build_number=$(git rev-list HEAD ^$last_tag | wc -l | sed -e 's/[^[:digit:]]//g')

date_string=$git_time
if [ "$(uname)" = "Darwin" ] || [ "$(uname)" = "FreeBSD" ]; then
case $(uname) in
Darwin | FreeBSD)
date_string="$(/bin/date -jr $git_time -u '+%Y-%m-%d %H:%M %Z')"
else
;;
MINGW*)
git_time=$(git log -1 --pretty=format:%ci)
date_string="$(/bin/date --date="$git_time" -u '+%Y-%m-%d %H:%M %Z')"
;;
*)
date_string="$(/bin/date --date="@$git_time" -u '+%Y-%m-%d %H:%M %Z')"
fi
;;
esac
if [ $(git describe --tags --exact-match 2> /dev/null) ]; then
tagged_commit="true"
else
Expand Down

0 comments on commit ff8fe5d

Please sign in to comment.