Skip to content

Instantly share code, notes, and snippets.

@kabel
Created March 9, 2012 04:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kabel/2005079 to your computer and use it in GitHub Desktop.
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
#!/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