summaryrefslogtreecommitdiff
path: root/git-hooks
diff options
context:
space:
mode:
authorAndras Timar <atimar@novell.com>2011-04-11 20:06:16 +0200
committerAndras Timar <atimar@novell.com>2011-04-12 17:52:54 +0200
commitd005fb46242a87da2ca4dde41d78c7ed7e32f23c (patch)
tree2bd5e0983dfd30aa22687b3db321219e56a8bf39 /git-hooks
parenta547fe19a3bbe45f3f166adc60f9d39834d1f2b9 (diff)
use git hook instead of gitattributes filter for *.po files
Diffstat (limited to 'git-hooks')
-rwxr-xr-xgit-hooks/pre-commit10
1 files changed, 10 insertions, 0 deletions
diff --git a/git-hooks/pre-commit b/git-hooks/pre-commit
index 6817990eeb98..abf1acb8d294 100755
--- a/git-hooks/pre-commit
+++ b/git-hooks/pre-commit
@@ -150,6 +150,16 @@ while (my $file = <FILES>) {
}
}
+# run 'msgcat --nowrap' when committing *.po files
+open(FILES, "git diff-index --cached --name-only $against |") || die "Cannot run git diff-index.";
+while (my $file = <FILES>) {
+ chomp($file);
+ if ($file =~ /\.po$/) {
+ system("msgcat --no-wrap $file > $file.KQnBbK6wQE;mv $file.KQnBbK6wQE $file;");
+ system("git add $file");
+ }
+}
+
# be strict about tabs - we don't want them at all, setup your editor
# correctly ;-)
my $err_ext = "";