Git migration: addition of pipeline and gitignore
Sveinn í Felli
sv1 at fellsnet.is
Fri Nov 6 14:34:00 GMT 2026
Þann 6.11.2026 11:26, skrifaði Philipp Kiemle:
> Hi!
>
>> Meaning that any error from msgfmt will be silent for the committer, unless checking comments on some page, right?
>> If that's correct, is there any way of sending an email warning of any error? Of course it's possible to always run msgfmt locally on all modified files before committing, but surely is a tedious task ;)
>
> You can implement a git hook locally on your machine to automate this: https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks
> Put whatever code you want to run under ".git/hooks/pre-commit" (or pre-push, if you want to run it only when pushing to Invent) and it'll check your files automatically.
>
> Be aware however that these hooks are not under version control (unlike GitLab CI files). So if your team has multiple committers, you need to distribute these hooks by other means.
>
> Cheers,
> Philipp
Thanks Philipp, but for us language-geeks it's more straightforward to
run a shell script before committing, checking with msgfmt in all the po
files, extracting any error messages. At least gettext is a bit closer
to our natural habitat than git ;)
Kisaragi Hiu just sent me a one-liner:
find . -path "*.po" -exec msgfmt --check '{}' -o /dev/null ';'
Will test that later.
Best,
Sveinn
> Am Fr, 6. Nov 2026, um 10:43, schrieb Sveinn í Felli:
>> Þann 6.11.2026 09:15, skrifaði Johnny Jazeix:
>>> Hi,
>>> I've added a pipeline to check the po files using msgfmt to all
>>> added/updated files on commits.
>>> In svn, it was a pre-commit hook preventing the push but we cannot do
>>> the same in Git so it is a pipeline that will check, either on MR or
>>> on commits on master that the po files are correct.
>>
>> Meaning that any error from msgfmt will be silent for the committer,
>> unless checking comments on some page, right?
>> If that's correct, is there any way of sending an email warning of any
>> error? Of course it's possible to always run msgfmt locally on all
>> modified files before committing, but surely is a tedious task ;)
>>
>> Getting the line number of the error in SVN/msgfmt was crucial.
>>
>> Best regards,
>> Sveinn í Felli
>>
>>> The script is in
>>> https://invent.kde.org/sysadmin/ci-utilities/-/blob/master/po-lint.sh?ref_type=heads,
>>> maybe we can think of other steps in the pipeline for the future.
>>>
>>> After discussion in
>>> https://invent.kde.org/teams/localization/issues/-/work_items/1#note_1693853,
>>> we also added a default .gitignore to all repos:
>>> https://invent.kde.org/localization/l10n-af/-/blob/master/.gitignore?ref_type=heads.
>>> If you think it makes sense to add more generic filters on all repos,
>>> please tell so we can all benefit of it.
>>>
>>> Cheers,
>>> Johnny
>>
>>
More information about the kde-i18n-doc
mailing list