9 lines
467 B
Bash
Executable file
9 lines
467 B
Bash
Executable file
#! /bin/bash
|
|
# encoding: utf-8
|
|
|
|
echo "version.py filter=version" >> .git/info/attributes
|
|
ln -fs ../version-tool.py .git/version-tool.py
|
|
git config --local filter.version.clean "python3 ./.git/version-tool.py --clean"
|
|
git config --local filter.version.smudge "python3 ./.git/version-tool.py --set \$(git rev-list HEAD --count) \$(git rev-parse HEAD)"
|
|
echo '#! /bin/bash\n\nexec git checkout HEAD -- version.py' > .git/hooks/post-commit
|
|
chmod +x .git/hooks/post-commit
|