diff options
author | Colin Guthrie <colin@mageia.org> | 2013-08-18 17:52:58 +0000 |
---|---|---|
committer | Colin Guthrie <colin@mageia.org> | 2013-08-18 17:52:58 +0000 |
commit | 0f533467f2b813cacebcb420852b2d8045709482 (patch) | |
tree | ea4778a40db4302b79ba5c50dac81393fe1ae8cc /modules/subversion/templates/converted_to_git | |
parent | 694ea4adcd771974d0e79e05f79a37f1f3d2a2ba (diff) | |
download | puppet-0f533467f2b813cacebcb420852b2d8045709482.tar puppet-0f533467f2b813cacebcb420852b2d8045709482.tar.gz puppet-0f533467f2b813cacebcb420852b2d8045709482.tar.bz2 puppet-0f533467f2b813cacebcb420852b2d8045709482.tar.xz puppet-0f533467f2b813cacebcb420852b2d8045709482.zip |
subversion: Add a new pre-commit hook that will prevent commits to paths which have been converted to git
Diffstat (limited to 'modules/subversion/templates/converted_to_git')
-rw-r--r-- | modules/subversion/templates/converted_to_git | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/modules/subversion/templates/converted_to_git b/modules/subversion/templates/converted_to_git new file mode 100644 index 00000000..8f137506 --- /dev/null +++ b/modules/subversion/templates/converted_to_git @@ -0,0 +1,16 @@ +#!/bin/sh + +REPOS="$1" +TXN="$2" + +if [ ! -f "$REPOS/conf/git.conf" ]; then + exit 0 +fi + +REGEX=$(cat "$REPOS/conf/git.conf" | grep -v "^#" | grep -v "^ *$" | xargs | sed 's/ /|/g') + +if (svnlook dirs-changed -t $TXN "$REPOS" | grep -qE "^($REGEX)"); then + echo "The subversion path you have attempted to commit to has been converted to git." >&2 + echo "Please see: https://wiki.mageia.org/en/Git_Migration" >&2 + exit 1 +fi |