Created
March 9, 2012 04:44
-
-
Save kabel/2005079 to your computer and use it in GitHub Desktop.
A shell script to install/remove rcs-keywords filter to/from local repo git-config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Use this tool to install rcs-keywords filters | |
section="filter.rcs-keywords" | |
clean=".git_filters/rcs-keywords.clean" | |
smudge=".git_filters/rcs-keywords.smudge %f" | |
if [ "$1" = "remove" ]; then | |
echo "Removing rcs-keywords filter from git-config" | |
git config --remove-section $section | |
echo "Done" | |
exit | |
fi | |
if [ -z "`git config $section.clean`" -o -z "`git config $section.smudge`" ]; then | |
echo "Writing rcs-keywords filter to git-config" | |
git config $section.clean $clean | |
git config $section.smudge "$smudge" | |
echo "Done" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment