forked from pEp.foundation/pEpEngine
parent
e67f0ce68d
commit
7abcfd2e8a
@ -0,0 +1 @@
|
||||
*.h filter=commit_hash
|
@ -0,0 +1,21 @@
|
||||
#! /bin/bash
|
||||
|
||||
#
|
||||
# Clean filter for pEpEngine's commit-hash header.
|
||||
#
|
||||
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
SED='sed -i '"'""'"
|
||||
else
|
||||
SED="sed -i"
|
||||
fi
|
||||
|
||||
echo "FILE is $1"
|
||||
echo "Replacing PEP_CURRENT_COMMIT_HASH value in src/commit_hash.h with DUMMY_COMMIT_HASH_ERROR. See you next checkout or after the commit!"
|
||||
|
||||
$($SED "s/\(PEP_CURRENT_COMMIT_HASH=\).*/\1\DUMMY_COMMIT_HASH_ERROR\"/" $1)
|
||||
|
||||
# Honestly, I have no idea what git is doing with the stupid empty '' for sed, but I give up. It makes a commit_hash.h'' backup for no reason. So we eat it.
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
rm $1"'""'"
|
||||
else
|
@ -0,0 +1,19 @@
|
||||
#! /bin/sh
|
||||
|
||||
echo "HELLO????" >&2
|
||||
|
||||
#
|
||||
# Smudge file for pEpEngine's commit-hash header
|
||||
#
|
||||
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
SED="sed -i ''"
|
||||
else
|
||||
SED="sed -i"
|
||||
fi
|
||||
|
||||
commit_hash="$(git rev-parse HEAD)"
|
||||
echo "Replacing PEP_CURRENT_COMMIT_HASH value in src/commit_hash.h with current HEAD commit hash, $commit_hash. Will clean on commit or checkout."
|
||||
|
||||
$($SED "s/\(PEP_CURRENT_COMMIT_HASH=\).*/\1\"$commit_hash\"/" $1)
|
||||
|
@ -0,0 +1,25 @@
|
||||
#! /bin/sh
|
||||
|
||||
#
|
||||
# Pseudo-smudge file for pEpEngine's commit-hash header
|
||||
#
|
||||
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
SED='sed -i '"'""'"
|
||||
else
|
||||
SED="sed -i"
|
||||
fi
|
||||
|
||||
|
||||
if test -f "src/commit_hash.h"; then
|
||||
commit_hash="$(git rev-parse HEAD)"
|
||||
echo "Replacing PEP_CURRENT_COMMIT_HASH value in src/commit_hash.h with current HEAD commit hash, $commit_hash. Will clean on commit or checkout."
|
||||
|
||||
$($SED "s/\(PEP_CURRENT_COMMIT_HASH=\).*/\1\"$commit_hash\"/" src/commit_hash.h)
|
||||
|
||||
# Whatever. You win, MacOS. You win.
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
rm src/commit_hash.h"'""'"
|
||||
fi
|
||||
fi
|
||||
|
@ -0,0 +1,7 @@
|
||||
#ifndef COMMIT_HASH_H
|
||||
#define COMMIT_HASH_H
|
||||
|
||||
#define PEP_CURRENT_COMMIT_HASH="DUMMY_COMMIT_HASH_ERROR"
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in new issue