Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiang Xin <zhiyou.jx@alibaba-inc.com>2022-05-26 17:50:26 +0300
committerJunio C Hamano <gitster@pobox.com>2022-05-26 20:30:24 +0300
commitea3f639fe776eee2e14336a683d5fae98f0ab21c (patch)
tree4580c8f5ff73c5c7bd6658a348a95be3e8f4c981 /Makefile
parent6cd33dceed60949e2dbc32e3f0f5e67c4c882e1e (diff)
Makefile: sort source files before feeding to xgettext
We will feed xgettext with more C source 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 sort the c, perl, and shell source files in groups before feeding them to xgettext. Ævar suggested that we should not pass the option "--sort-by-file" to xgettext to sort the translatable strings, as it will mix the three groups of source files (c, perl and shell) in the file "po/git.pot", and change the order of translatable strings in the same line of a file. With this update, the newly generated "po/git.pot" will have 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 "*.pot 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. Suggested-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile7
1 files changed, 3 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index f8bccfab5e..7ca95cdb82 100644
--- a/Makefile
+++ b/Makefile
@@ -2713,10 +2713,9 @@ XGETTEXT_FLAGS_SH = $(XGETTEXT_FLAGS) --language=Shell \
--keyword=gettextln --keyword=eval_gettextln
XGETTEXT_FLAGS_PERL = $(XGETTEXT_FLAGS) --language=Perl \
--keyword=__ --keyword=N__ --keyword="__n:1,2"
-LOCALIZED_C = $(C_OBJ:o=c) $(LIB_H) $(GENERATED_H)
-LOCALIZED_SH = $(SCRIPT_SH)
-LOCALIZED_SH += git-sh-setup.sh
-LOCALIZED_PERL = $(SCRIPT_PERL)
+LOCALIZED_C = $(sort $(C_OBJ:o=c) $(LIB_H) $(GENERATED_H))
+LOCALIZED_SH = $(sort $(SCRIPT_SH) git-sh-setup.sh)
+LOCALIZED_PERL = $(sort $(SCRIPT_PERL))
ifdef XGETTEXT_INCLUDE_TESTS
LOCALIZED_C += t/t0200/test.c