Thread (90 messages) 90 messages, 5 authors, 2022-05-26
STALE1475d
Revisions (5)
  1. v1 [diff vs current]
  2. v1 [diff vs current]
  3. v2 current
  4. v3 [diff vs current]
  5. v4 [diff vs current]

[PATCH v3 1/9] Makefile: sort "po/git.pot" by file location

From: Jiang Xin <hidden>
Date: 2022-05-23 01:26:13
Subsystem: kernel build + files below scripts/ (unless maintained elsewhere), the rest · Maintainers: Nathan Chancellor, Nicolas Schier, Linus Torvalds

From: Jiang Xin <redacted>

We will feed xgettext with more C souce files and in different order in
subsequent commit. To generate a stable "po/git.pot" regardless of the
number and order of input source files, we add a new option
"--sort-by-file" to xgettext program.

With this update, the newly generated "po/git.pot" will has the same
entries while in a different order.

With the help of a custom diff driver as shown below,

    git config --global diff.gettext-fmt.textconv \
        "msgcat --no-location --sort-by-file"

and appending a new entry "*.po diff=gettext-fmt" to git attributes,
we can see that there are no substantial changes in "po/git.pot".

We won't checkin the newly generated "po/git.pot", because we will
remove it from tree in a later commit.

Signed-off-by: Jiang Xin <redacted>
Signed-off-by: Junio C Hamano <redacted>
---
 Makefile | 1 +
 1 file changed, 1 insertion(+)
diff --git a/Makefile b/Makefile
index f8bccfab5e..83e968e2a4 100644
--- a/Makefile
+++ b/Makefile
@@ -2706,6 +2706,7 @@ XGETTEXT_FLAGS = \
 	--force-po \
 	--add-comments=TRANSLATORS: \
 	--msgid-bugs-address="Git Mailing List <git@vger.kernel.org>" \
+	--sort-by-file \
 	--from-code=UTF-8
 XGETTEXT_FLAGS_C = $(XGETTEXT_FLAGS) --language=C \
 	--keyword=_ --keyword=N_ --keyword="Q_:1,2"
-- 
2.36.0.1.g15c4090757
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help