0
私たちはSVNからGITへの移行を準備中です。すべてのプロジェクト(ブランチ、タグなどはそれぞれ1つのリポジトリに収められています)。移行中に、一部のプロジェクトを読み取り専用にしたいと考えています。ファイルが特定のパスの下で変更されたかどうかをチェックするSVNコミットフックを書くことは可能ですか?SVN:特定のパスでのコミットを防ぐことはできますか?
ソリューション:
#!/bin/sh
REPOS="$1"
TXN="$2"
SVNLOOK=/opt/local/bin/svnlook
# Committing to migrated projects to GIT is not allowed
$SVNLOOK changed -t "$TXN" "$REPOS" | grep "\/some_path\/" && /bin/echo "This repository is read-only due to migration to GIT. Please commit to GIT repo instead!" 1>&2 && exit 1
# All checks passed, so allow the commit.
exit 0