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 | |
parent | do not pack JRE with LibreOffice_Dev (diff) | |
download | core-066300b5aa1326b16f72add98836a5908f5bf78e.tar.gz core-066300b5aa1326b16f72add98836a5908f5bf78e.zip |
use git hook instead of gitattributes filter for *.po files
-rw-r--r-- | .gitattributes | 1 | ||||
-rwxr-xr-x | g | 6 | ||||
-rwxr-xr-x | git-hooks/pre-commit | 10 |
3 files changed, 10 insertions, 7 deletions
diff --git a/.gitattributes b/.gitattributes index d414da85d0db..416fa8c63b14 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,2 @@ *.doc binary *.sdw binary -*.po filter=po @@ -38,12 +38,6 @@ function update_hooks() if [ "$PWD" != "$RAWBUILDDIR" -a ! -e .gitattributes ]; then ln -s $RAWBUILDDIR/.gitattributes . fi - if [ -z "$(git config filter.po.clean)" ] ; then - git config filter.po.clean 'msgcat - --no-wrap' - fi - if [ -z "$(git config filter.po.smudge)" ] ; then - git config filter.po.smudge cat - fi } # extra params for some commands, like log 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 = ""; |