diff options
author | Andras Timar <atimar@novell.com> | 2011-04-11 20:06:16 +0200 |
---|---|---|
committer | Andras Timar <atimar@novell.com> | 2011-04-27 21:13:12 +0200 |
commit | 066300b5aa1326b16f72add98836a5908f5bf78e (patch) | |
tree | f42703e412e85c8380da020c43c602457a05e9ec /git-hooks | |
parent | 63e01f740843188d45184aae5791ebc9fee51dee (diff) |
use git hook instead of gitattributes filter for *.po files
Diffstat (limited to 'git-hooks')
-rwxr-xr-x | git-hooks/pre-commit | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/git-hooks/pre-commit b/git-hooks/pre-commit index 4f3809ab9713..7d69f4debb2f 100755 --- a/git-hooks/pre-commit +++ b/git-hooks/pre-commit @@ -151,6 +151,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 = ""; |