public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jiang Xin <worldhello.net@gmail.com>
Cc: Git List <git@vger.kernel.org>
Subject: Re: [RFC PATCH 1/2] l10n: add .gitattributes to simplify location filtering
Date: Thu, 05 Feb 2026 12:07:57 -0800	[thread overview]
Message-ID: <xmqqtsvvkl7m.fsf@gitster.g> (raw)
In-Reply-To: <00d6cbf44f88fbd402375a2d41d7f9059d339e5d.1770296405.git.worldhello.net@gmail.com> (Jiang Xin's message of "Thu, 5 Feb 2026 21:00:27 +0800")

Jiang Xin <worldhello.net@gmail.com> writes:

> To simplify the location filtering process for l10n contributors when
> committing po/XX.po files, add the filter attributes for .po files to
> the repository. This ensures all contributors automatically get the
> same filter configuration without manual setup in .git/info/attributes.
>
> Contributors still need to manually define the filter drivers using
> git-config as documented in po/README.md.
>
> Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
> ---
>  po/.gitattributes | 37 +++++++++++++++++++++++++++++++++++++
>  po/README.md      | 19 +++++++++++--------
>  2 files changed, 48 insertions(+), 8 deletions(-)
>  create mode 100644 po/.gitattributes

OK.  It is slightly sad that two camps cannot agree on a single
filter, which may allow us to just do

	*.po	filter=one-single-filter-agreed-upon

but I guess this is a good start.  And having sample configuration
lines that can readily be cut-and-pasted to help the contributors is
very good.

> +The filter configuration is defined in the "po/.gitattributes" file.
> +
> +Then define the driver for the filter. Most languages use the
> +"gettext-no-file-no-location" clean filter, which strips out both filenames and
> +locations from the comments. To set this up, run the following command:
>  
>  ```shell
> -git config --global filter.gettext-no-location.clean \
> +git config --global filter.gettext-no-file-no-location.clean \
>             "msgcat --no-location -"
>  ```
>  
> -For users who have gettext version 0.20 or higher, it is also possible
> -to define a clean filter to preserve filenames but not locations:
> +Some languages use the "gettext-no-location" clean filter, which preserves
> +filenames but not locations. For these, install gettext version 0.20 or higher
> +and setup the driver as below:
>  
>  ```shell
>  git config --global filter.gettext-no-location.clean \

  reply	other threads:[~2026-02-05 20:08 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-04  9:31 [RFC] Introducing AI Agents to Git Localization Jiang Xin
2026-02-04 11:58 ` Peter Krefting
2026-02-04 13:00   ` Michal Suchánek
2026-02-04 14:38     ` 依云
2026-02-05  2:06     ` Jiang Xin
2026-02-05  8:30       ` Michal Suchánek
2026-02-05 11:16         ` Jiang Xin
2026-02-05 13:18           ` Michal Suchánek
2026-02-05  1:04   ` Jiang Xin
2026-02-05  1:53     ` brian m. carlson
     [not found] ` <0207CD38-C811-499D-AFA6-131B0CA825CD@gmail.com>
2026-02-05 12:54   ` Jiang Xin
2026-02-05 13:00 ` [RFC PATCH 1/2] l10n: add .gitattributes to simplify location filtering Jiang Xin
2026-02-05 20:07   ` Junio C Hamano [this message]
2026-02-05 13:00 ` [RFC PATCH 2/2] l10n: README: document AI assistant guidelines Jiang Xin
2026-02-05 20:35   ` Junio C Hamano
2026-02-06  2:38     ` Jiang Xin
2026-03-03 15:33       ` [PATCH v2 0/5] docs(l10n): AI agent instructions and workflow improvements Jiang Xin
2026-03-03 15:33         ` [PATCH v2 1/5] l10n: add .gitattributes to simplify location filtering Jiang Xin
2026-03-03 15:33         ` [PATCH v2 2/5] docs(l10n): add AGENTS.md with optimized update-pot instructions Jiang Xin
2026-03-12  2:11           ` Jiang Xin
2026-03-03 15:33         ` [PATCH v2 3/5] docs(l10n): add AI agent instructions for updating po/XX.po files Jiang Xin
2026-03-03 15:33         ` [PATCH v2 4/5] docs(l10n): add AI agent instructions for translating PO files Jiang Xin
2026-03-12  2:26           ` Jiang Xin
2026-03-03 15:33         ` [PATCH v2 5/5] docs(l10n): add AI agent instructions to review translations Jiang Xin
2026-03-12  2:34           ` Jiang Xin
2026-03-14 14:38       ` [PATCH v3 0/5] docs(l10n): AI agent instructions and workflow improvements Jiang Xin
2026-03-14 14:38         ` [PATCH v3 1/5] l10n: add .gitattributes to simplify location filtering Jiang Xin
2026-03-15 11:13           ` Johannes Sixt
2026-03-15 16:11             ` Junio C Hamano
2026-03-16  5:44               ` Jiang Xin
2026-03-16  3:21             ` Jiang Xin
2026-03-16 12:43               ` Johannes Sixt
2026-03-14 14:38         ` [PATCH v3 2/5] docs(l10n): add AGENTS.md with optimized update-pot instructions Jiang Xin
2026-03-14 14:38         ` [PATCH v3 3/5] docs(l10n): add AI agent instructions for updating po/XX.po files Jiang Xin
2026-03-14 14:38         ` [PATCH v3 4/5] docs(l10n): add AI agent instructions for translating PO files Jiang Xin
2026-03-14 14:38         ` [PATCH v3 5/5] docs(l10n): add AI agent instructions to review translations Jiang Xin
2026-03-16 23:54       ` [PATCH v4 0/5] docs(l10n): AI agent instructions and workflow improvements Jiang Xin
2026-03-16 23:54         ` [PATCH v4 1/5] l10n: add .gitattributes to simplify location filtering Jiang Xin
2026-03-16 23:54         ` [PATCH v4 2/5] docs(l10n): add AGENTS.md with optimized update-pot instructions Jiang Xin
2026-03-16 23:54         ` [PATCH v4 3/5] docs(l10n): add AI agent instructions for updating po/XX.po files Jiang Xin
2026-03-16 23:54         ` [PATCH v4 4/5] docs(l10n): add AI agent instructions for translating PO files Jiang Xin
2026-03-16 23:54         ` [PATCH v4 5/5] docs(l10n): add AI agent instructions to review translations Jiang Xin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqtsvvkl7m.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=worldhello.net@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox