Kaydet (Commit) d005fb46 authored tarafından Andras Timar's avatar Andras Timar

use git hook instead of gitattributes filter for *.po files

üst a547fe19
*.doc binary *.doc binary
*.sdw binary *.sdw binary
*.po filter=po
...@@ -38,12 +38,6 @@ function update_hooks() ...@@ -38,12 +38,6 @@ function update_hooks()
if [ "$PWD" != "$RAWBUILDDIR" -a ! -e .gitattributes ]; then if [ "$PWD" != "$RAWBUILDDIR" -a ! -e .gitattributes ]; then
ln -s $RAWBUILDDIR/.gitattributes . ln -s $RAWBUILDDIR/.gitattributes .
fi 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 # extra params for some commands, like log
......
...@@ -150,6 +150,16 @@ while (my $file = <FILES>) { ...@@ -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 # be strict about tabs - we don't want them at all, setup your editor
# correctly ;-) # correctly ;-)
my $err_ext = ""; my $err_ext = "";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment