Skip to content

Instantly share code, notes, and snippets.

@catsby
Created May 11, 2011 20:12
Show Gist options
  • Save catsby/967234 to your computer and use it in GitHub Desktop.
Save catsby/967234 to your computer and use it in GitHub Desktop.
#!/bin/sh
config_changed="false"
for rev in $(git diff HEAD@{1} HEAD --name-only)
do
if [[ $rev =~ "/config/" ]]
then
config_changed="true"
fi
done
if [ "$config_changed" = "true" ]; then
echo "**************************************************"
echo "The Config section has changed"
echo "**************************************************"
fi
@catsby
Copy link
Author

catsby commented May 13, 2011

This git post-merge hook checks through all the files that have changed after the commit and displays a message at the end if any files within a certain directory have changed.

Useful if you want to keep your eye out for any changes in a directory that shouldn't receive many changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment