]> git.ipfire.org Git - thirdparty/git.git/commit
l10n: add .gitattributes to simplify location filtering
authorJiang Xin <worldhello.net@gmail.com>
Wed, 4 Feb 2026 03:39:22 +0000 (11:39 +0800)
committerJiang Xin <worldhello.net@gmail.com>
Thu, 2 Apr 2026 23:36:51 +0000 (07:36 +0800)
commit3a14bcfec8cd606371e0e1bd0054bbe22f539cb1
tree7c73ea4b608e824bb35ff18d1c302e75730ae9f2
parent256554692df0685b45e60778b08802b720880c50
l10n: add .gitattributes to simplify location filtering

To simplify the location filtering process for l10n contributors when
committing po/XX.po files, add filter attributes for selected PO
files to the repository. This ensures all contributors automatically
get the same filter configuration without manual setup in
.git/info/attributes.

The default filter (gettext-no-location) is applied to all .po files
except:

- Legacy, unmaintained PO files that still contain location comments.
  Leaving the filter off avoids index vs working-tree discrepancies for
  these files. The CI pipeline will report an error when future updates
  touch these legacy files.
- Some PO files use a different filter that strips only line numbers
  from location comments while keeping filenames.

Contributors still need to manually define the filter drivers via
git-config as documented in po/README.md.

Four PO files that use location filtering (po/ca.po, po/es.po, po/ga.po,
po/ru.po) were batch-modified so their on-disk format matches the filter
output (e.g. line wrapping), avoiding index vs working-tree mismatch.

Additionally, po/README.md has been reorganized: the material on
preparing location-less PO files for commit has been moved from
"Updating a XX.po file" to a separate "Preparing a XX.po file for
commit" section. This prevents AI agents from introducing unrelated
operations when updating PO files.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
po/.gitattributes [new file with mode: 0644]
po/README.md
po/ca.po
po/es.po
po/ga.po
po/ru.po