Commit 9b27050f authored by Mathieu Giraud's avatar Mathieu Giraud

tools/create-git-sha1.sh, algo/create-git-version-h.sh: more generic generation of 'git-version.h'

See #1847.
parent 16213774
#!/bin/sh
GITV_H=git-version.h
GITV_H_TMP=git-version.h.tmp
touch ${GITV_H}
git log -1 --pretty=format:'#define GIT_VERSION "%h (%cd)"' --date=short --abbrev-commit > ${GITV_H_TMP} 2> /dev/null
# Replace the file only when the new file is different
diff ${GITV_H} ${GITV_H_TMP} || mv ${GITV_H_TMP} ${GITV_H}
../tools/create-git-sha1.sh git-version.h "#define GIT_VERSION"
#!/bin/sh
# Create a file with the current sha1
# sh create-git-sha1.sh ../algo/git-version.h "#define GIT_VERSION"
# sh create-git-sha1.sh ../browser/js/git-sha1.js "git_sha1 ="
GITV_H=$1
GITV_H_TMP=${GITV_H}.tmp
PRETTY_PREFIX=$2
touch ${GITV_H}
git log -1 --pretty=format:"${PRETTY_PREFIX} \"%h (%cd)\"" --date=short --abbrev-commit > ${GITV_H_TMP} 2> /dev/null
# Replace the file only when the new file is different
diff ${GITV_H} ${GITV_H_TMP} || mv ${GITV_H_TMP} ${GITV_H}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment