[Libreoffice-commits] .: Branch 'libreoffice-3-4' - g .gitattributes git-hooks/pre-commit

Andras Timar timar at kemper.freedesktop.org
Tue Apr 12 08:54:24 PDT 2011


 .gitattributes       |    1 -
 g                    |    6 ------
 git-hooks/pre-commit |   10 ++++++++++
 3 files changed, 10 insertions(+), 7 deletions(-)

New commits:
commit b65cdd9654aae2ccdd234df3b0a270859cabc955
Author: Andras Timar <atimar at novell.com>
Date:   Mon Apr 11 20:06:16 2011 +0200

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

diff --git a/.gitattributes b/.gitattributes
index d414da8..416fa8c 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,3 +1,2 @@
 *.doc binary
 *.sdw binary
-*.po filter=po
diff --git a/g b/g
index 2d601b5..7fbf683 100755
--- a/g
+++ b/g
@@ -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 6817990..abf1acb 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 = "";


More information about the Libreoffice-commits mailing list