lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] translations: Make "GIT Committish:" lines obsolete


From: Johannes Schindelin
Subject: [PATCH] translations: Make "GIT Committish:" lines obsolete
Date: Sat, 13 Jan 2007 14:41:59 +0100 (CET)

Use git to determine when the translation last changed instead of
relying on the "GIT Committish" line.

The downside of this patch is that a simple typo fix in the original
documentation still requires an update of the translation; otherwise
"make check-translation" will continue to complain about that fix not
being reflected in the translation.

Signed-off-by: Johannes Schindelin <address@hidden>

---

        By reading my Python code, you can tell I detest that language. If 
        you know better methods to achieve the same, please don't let me
        die dumb.

        Of course, this patch also requires maintainers to make sure they
        are actually committing up-to-date translations.

        If you don't like the patch, just drop it (I do not insist this is 
        a better way than the "GIT Committish" lines, but found it an
        interesting exercise.)

 buildscripts/check_translation.py |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/buildscripts/check_translation.py 
b/buildscripts/check_translation.py
index 35ab59e..3acd1db 100644
--- a/buildscripts/check_translation.py
+++ b/buildscripts/check_translation.py
@@ -16,15 +16,16 @@ def dir_lang (file, lang):
     return os.path.join (*path_components)
 
 ##     Translation of GIT Commit: <hash>
-REVISION_RE = re.compile ('.*GIT [Cc]ommittish: ([a-f0-9]+)', re.DOTALL)
 CVS_DIFF = 'git diff %(revision)s HEAD -- %(original)s | cat'
 
 def check_file (original, translated):
-    s = open (translated).read ()
-    m = REVISION_RE.match (s)
+    cmd = 'git rev-list --max-count=1 --no-merges HEAD ' + translated
+    l = os.popen (cmd)
+    m = l.read ()
+    l.close ()
     if not m:
-        raise translated + ': no GIT committish: <hash> found'
-    revision = m.group (1)
+        raise translated + ': not in any commit: ' + translated
+    revision = m.replace("\n", "")
 
     c = CVS_DIFF % vars ()
     if verbose:




reply via email to

[Prev in Thread] Current Thread [Next in Thread]