[Libreoffice-commits] .: 2 commits - g .gitattributes git-hooks/pre-commit

Andras Timar timar at kemper.freedesktop.org
Wed Apr 27 12:14:04 PDT 2011


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

New commits:
commit de746cbe9ebf05607e023da88d9b233cf06226be
Author: Andras Timar <atimar at novell.com>
Date:   Thu Apr 14 10:21:53 2011 +0200

    check if file exists in *.po hook
    
    otherwise a removed file would be recreated

diff --git a/git-hooks/pre-commit b/git-hooks/pre-commit
index 7d69f4d..8a316fd 100755
--- a/git-hooks/pre-commit
+++ b/git-hooks/pre-commit
@@ -155,7 +155,7 @@ while (my $file = <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$/) {
+    if ($file =~ /\.po$/ && -e $file) {
         system("msgcat --no-wrap $file > $file.KQnBbK6wQE;mv $file.KQnBbK6wQE $file;");
         system("git add $file");
     }
commit 2b71d05d2ff64544ec3188d084dbdc1c6d314c49
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 4f3809a..7d69f4d 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 = "";


More information about the Libreoffice-commits mailing list