Skip to contentSkip to conversation

Add infrastructure for translating Git with gettext

PATCH In review Ævar Arnfjörð Bjarmason 2 participants 3 messages Jun 15, 2016 Kbuild

v6 of 8 In review Latest is v8 →

lore
Share & tools
lore
#0 lore raw

PATCH v6 1/1 Add infrastructure for translating Git with gettext

All of the interface messages in Git core are currently hardcoded in English. Change that by optionally enabling translation of the core C, Shell and Perl programs via GNU or SunOS gettext. If you set the appropriate LC_* variables Git will speak your language, provided that someone has submitted a translation.

If gettext isn't available, or if Git is compiled with NO_GETTEXT=YesPlease, then Git fall back on its previous behavior of only speaking English. When using ./configure the autoconf script will auto-detect if the gettext libraries are installed and act appropriately.

With NO_GETTEXT=YesPlease gettext support will be #defined away for C programs. For Shell and Perl programs we rely on the git message catalog not being available. That's a reasonable assumption since then the message catalog won't be installed on the system during make install.

The gettext wrappers that are provided in the patch are only the bare minimum required to begin translation work. In particular I haven't added wrappers for the gettext functions that enable plural support, or those that provide message context (msgctxt).

Those can be added later. The intent is to start with a small subset and see what we need later, not to start with something that's unnecessarily large right away.

Implementation and usage notes:

* General:

Gettext .mo files will be installed and looked for in the standard $(prefix)/share/locale path. GIT_TEXTDOMAINDIR can also be set to override that, but that's only intended to be used to test Git itself.

* Perl:

Perl code that wants to be localized should use the new Git::I18n module. It imports a __ function into the caller's package by default.

Instead of using the high level Locale::TextDomain interface I've opted to use the low-level (equivalent to the C interface) Locale::Messages module, which Locale::TextDomain itself uses.

Locale::TextDomain does a lot of redundant work we don't need, and some of it would potentially introduce bugs. It tries to set the $TEXTDOMAIN based on package of the caller, and has its own hardcoded paths where it'll search for messages.

I found it easier just to completely avoid it rather than try to circumvent its behavior. In any case, this is an issue wholly internal Git::I18N. Its guts can be changed later if that's deemed necessary.

See <[email protected]> for a further elaboration on this topic.

* Shell:

Shell code that's to be localized should use the new git-sh-i18n library. It's just a wrapper for the system's gettext.sh.

If gettext.sh isn't available we'll fall back gettext(1) if it's available. The latter is available without the former on Solaris, which has its own non-GNU gettext implementation. We also need to emulate eval_gettext() there.

If neither are present we'll use a dumb printf(1) fall-through wrapper.

I originally tried to detect if the system supported `echo -n' but I found this to be a waste of time. My benchmarks on Linux, Solaris and FreeBSD reveal that printf(1) is fast enough, especially since we aren't calling gettext() from within any tight loops, and unlikely to ever do so.

This series has been tested by me on Ubuntu 10.04, Debian testing, FreeBSD 8.1 and SunOS 5.10, and by others on Mac OS X 10.6.3 (with Xcode 3.2.2) and openSUSE Factory (11.3, milestone 7).

SunOS has its own non-GNU gettext implementation which this patch supports, although that may change in the future if it turns out that we need some GNU libintl features that SunOS doesn't provide.

This patch is based on work by Jeff Epler <[email protected]> who did the initial Makefile / C work, and a lot of comments from the Git mailing list, including Jonathan Nieder, Jakub Narebski, Johannes Sixt, Peter Krefting, Junio C Hamano, Thomas Rast and others.

---

This is version 6 of the gettext patch for Git. It replaces the version already in pu.

I've upgraded the tests to work with my TAP series, which got merged into master & next since I submitted v5.

This is the diff --stat since v5:

    t/lib-gettext.sh             |   42 +++++++++++++++++++++++
    t/t0200-gettext.sh           |   77 ++++++++++++++---------------------------
    t/t0201-gettext-fallbacks.sh |   11 +++---
    t/t0202-gettext-perl.sh      |   14 +++++---
    t/t0202/test.pl              |   25 ++++++++------
    5 files changed, 96 insertions(+), 73 deletions(-)

And the changes are, in more detail:

* Added a t/lib-gettext.sh. It's used by the t/t02* tests, previously they duplicated some setup code (e.g. setting GIT_TEXTDOMAINDIR), now they don't.

* Eliminated skip_all=<reason> in favor of using test_expect_success <prereq>. The same number of tests are now run on all platforms regardless of whether they support gettext or not. We just skip some of the tests now.

* Copy the UTF-8 locale detection from t9129-git-svn-i18n-commitencoding.sh. Setting is_IS.UTF-8 was unportable, Debian now uses is_IS.utf8. Support both.

* Use the new locale detection to always run certain tests if there's a UTF-8 is_IS locale on the system. The TEST_GIT_GETTEXT_EXHAUSTIVE=1 variable doesn't exist anymore. Instead we autodetect by shelling out to locale -a.

* Remove the gettext("") test under the Klingon locale. I've found that using imaginary locales is unportable. This particular test failed on FreeBSD.

* Added "Copyright (c) 2010 Ævar Arnfjörð Bjarmason" to the new *.sh test files, as recommended by t/README.

I've tested this on two Debian machines, one with a is_IS locale and one not. I've also tested on FreeBSD and Solaris.

If you're interested in testing this series you can run this:

curl http://github.com/avar/test-git-gettext/raw/master/test-git-gettext.sh | sh

Please provide the contents of /tmp/git-gettext.txt if $(grep 'not ok' /tmp/git-gettext.txt) yields anything.

 .gitignore                   |    2 +
 INSTALL                      |   12 +++++
 Makefile                     |   69 +++++++++++++++++++++++++-
 config.mak.in                |    2 +
 configure.ac                 |   12 +++++
 daemon.c                     |    3 +
 fast-import.c                |    3 +
 gettext.c                    |   22 ++++++++
 gettext.h                    |   18 +++++++
 git-sh-i18n.sh               |   71 ++++++++++++++++++++++++++
 git.c                        |    3 +
 http-backend.c               |    3 +
 http-fetch.c                 |    3 +
 http-push.c                  |    3 +
 imap-send.c                  |    3 +
 perl/Git/I18N.pm             |   91 +++++++++++++++++++++++++++++++++
 perl/Makefile                |    3 +-
 perl/Makefile.PL             |   14 +++++-
 po/.gitignore                |    1 +
 po/is.po                     |   47 +++++++++++++++++
 shell.c                      |    3 +
 show-index.c                 |    3 +
 t/lib-gettext.sh             |   42 ++++++++++++++++
 t/t0200-gettext.sh           |  113 ++++++++++++++++++++++++++++++++++++++++++
 t/t0200/test.c               |   13 +++++
 t/t0200/test.perl            |   14 +++++
 t/t0200/test.sh              |   14 +++++
 t/t0201-gettext-fallbacks.sh |   49 ++++++++++++++++++
 t/t0202-gettext-perl.sh      |   27 ++++++++++
 t/t0202/test.pl              |  107 +++++++++++++++++++++++++++++++++++++++
 t/test-lib.sh                |    2 +
 upload-pack.c                |    3 +
 32 files changed, 771 insertions(+), 4 deletions(-)
 create mode 100644 gettext.c
 create mode 100644 gettext.h
 create mode 100644 git-sh-i18n.sh
 create mode 100644 perl/Git/I18N.pm
 create mode 100644 po/.gitignore
 create mode 100644 po/is.po
 create mode 100644 t/lib-gettext.sh
 create mode 100755 t/t0200-gettext.sh
 create mode 100644 t/t0200/test.c
 create mode 100644 t/t0200/test.perl
 create mode 100644 t/t0200/test.sh
 create mode 100755 t/t0201-gettext-fallbacks.sh
 create mode 100755 t/t0202-gettext-perl.sh
 create mode 100644 t/t0202/test.pl
.gitignore +2 -0
index 14e2b6b..6c2b193 100644
@@ -125,6 +125,7 @@
 /git-rm
 /git-send-email
 /git-send-pack
+/git-sh-i18n
 /git-sh-setup
 /git-shell
 /git-shortlog
@@ -204,3 +205,4 @@
 *.pdb
 /Debug/
 /Release/
+/share/
INSTALL +12 -0
index 61086ab..9c9a5fa 100644
@@ -93,6 +93,18 @@ Issues of note:
 	  history graphically, and in git-gui.  If you don't want gitk or
 	  git-gui, you can use NO_TCLTK.
 
+	- A gettext library is used by default for localizing Git. The
+	  primary target is GNU libintl, but the Solaris gettext
+	  implementation also works.
+
+	  We need a gettext.h on the system for C code, gettext.sh (or
+	  Solaris gettext(1)) for shell scripts, and libintl-perl for Perl
+	  programs.
+
+	  Set NO_GETTEXT to disable localization support and make Git only
+	  use English. Under autoconf the configure script will do this
+	  automatically if it can't find libintl on the system.
+
  - Some platform specific issues are dealt with Makefile rules,
    but depending on your specific installation, you may not
    have all the libraries/tools needed, or you may have
Makefile +67 -2

189 lines not on this page · raw message

config.mak.in +2 -0
index b4e65c3..011b103 100644
@@ -34,9 +34,11 @@ NO_CURL=@NO_CURL@
 NO_EXPAT=@NO_EXPAT@
 NO_LIBGEN_H=@NO_LIBGEN_H@
 HAVE_PATHS_H=@HAVE_PATHS_H@
+NO_GETTEXT=@NO_GETTEXT@
 NEEDS_LIBICONV=@NEEDS_LIBICONV@
 NEEDS_SOCKET=@NEEDS_SOCKET@
 NEEDS_RESOLV=@NEEDS_RESOLV@
+NEEDS_LIBINTL=@NEEDS_LIBINTL@
 NEEDS_LIBGEN=@NEEDS_LIBGEN@
 NO_SYS_SELECT_H=@NO_SYS_SELECT_H@
 NO_D_INO_IN_DIRENT=@NO_D_INO_IN_DIRENT@
configure.ac +12 -0
index 5601e8b..202e820 100644
@@ -600,6 +600,12 @@ AC_CHECK_LIB([c], [basename],
 AC_SUBST(NEEDS_LIBGEN)
 test -n "$NEEDS_LIBGEN" && LIBS="$LIBS -lgen"
 
+AC_CHECK_LIB([c], [gettext],
+[NEEDS_LIBINTL=],
+[NEEDS_LIBINTL=YesPlease])
+AC_SUBST(NEEDS_LIBINTL)
+test -n "$NEEDS_LIBINTL" && LIBS="$LIBS -lintl"
+
 ## Checks for header files.
 AC_MSG_NOTICE([CHECKS for header files])
 #
@@ -777,6 +783,12 @@ AC_CHECK_HEADER([paths.h],
 [HAVE_PATHS_H=])
 AC_SUBST(HAVE_PATHS_H)
 #
+# Define NO_GETTEXT if you don't have libintl.h
+AC_CHECK_HEADER([libintl.h],
+[NO_GETTEXT=],
+[NO_GETTEXT=YesPlease])
+AC_SUBST(NO_GETTEXT)
+#
 # Define NO_STRCASESTR if you don't have strcasestr.
 GIT_CHECK_FUNC(strcasestr,
 [NO_STRCASESTR=],
daemon.c +3 -0
index e22a2b7..784f897 100644
@@ -3,6 +3,7 @@
 #include "exec_cmd.h"
 #include "run-command.h"
 #include "strbuf.h"
+#include "gettext.h"
 
 #include <syslog.h>
 
@@ -975,6 +976,8 @@ int main(int argc, char **argv)
 	gid_t gid = 0;
 	int i;
 
+	git_setup_gettext();
+
 	git_extract_argv0_path(argv[0]);
 
 	for (i = 1; i < argc; i++) {
fast-import.c +3 -0
index 1e5d66e..6497b0c 100644
@@ -156,6 +156,7 @@ Format of STDIN stream:
 #include "csum-file.h"
 #include "quote.h"
 #include "exec_cmd.h"
+#include "gettext.h"
 
 #define PACK_ID_BITS 16
 #define MAX_PACK_ID ((1<<PACK_ID_BITS)-1)
@@ -2904,6 +2905,8 @@ int main(int argc, const char **argv)
 
 	git_extract_argv0_path(argv[0]);
 
+	git_setup_gettext();
+
 	if (argc == 2 && !strcmp(argv[1], "-h"))
 		usage(fast_import_usage);
 
gettext.c new file +22 -0
new file mode 100644
index 0000000..7ae5cae
@@ -0,0 +1,22 @@
+#include "exec_cmd.h"
+#include <locale.h>
+#include <libintl.h>
+#include <stdlib.h>
+
+extern void git_setup_gettext(void) {
+	char *podir;
+	char *envdir = getenv("GIT_TEXTDOMAINDIR");
+
+	if (envdir) {
+		(void)bindtextdomain("git", envdir);
+	} else {
+		podir = (char *)system_path("share/locale");
+		if (!podir) return;
+		(void)bindtextdomain("git", podir);
+		free(podir);
+	}
+
+	(void)setlocale(LC_MESSAGES, "");
+	(void)setlocale(LC_CTYPE, "");
+	(void)textdomain("git");
+}
gettext.h new file +18 -0
new file mode 100644
index 0000000..e02939a
@@ -0,0 +1,18 @@
+#ifndef GETTEXT_H
+#define GETTEXT_H
+
+#ifdef NO_GETTEXT
+static inline void git_setup_gettext(void) {}
+#else
+extern void git_setup_gettext(void);
+#endif
+
+#define N_(s) (s)
+#ifdef NO_GETTEXT
+#define _(s) (s)
+#else
+#include <libintl.h>
+#define _(s) gettext(s)
+#endif
+
+#endif
git-sh-i18n.sh new file +71 -0

71 lines not on this page · raw message

git.c +3 -0
index 265fa09..95df6a6 100644
@@ -3,6 +3,7 @@
 #include "cache.h"
 #include "quote.h"
 #include "run-command.h"
+#include "gettext.h"
 
 const char git_usage_string[] =
 	"git [--version] [--exec-path[=GIT_EXEC_PATH]] [--html-path]\n"
@@ -490,6 +491,8 @@ int main(int argc, const char **argv)
 	if (!cmd)
 		cmd = "git-help";
 
+	git_setup_gettext();
+
 	/*
 	 * "git-xxxx" is the same as "git xxxx", but we obviously:
 	 *
http-backend.c +3 -0
index 14c90c2..502103d 100644
@@ -7,6 +7,7 @@
 #include "run-command.h"
 #include "string-list.h"
 #include "url.h"
+#include "gettext.h"
 
 static const char content_type[] = "Content-Type";
 static const char content_length[] = "Content-Length";
@@ -550,6 +551,8 @@ int main(int argc, char **argv)
 	char *cmd_arg = NULL;
 	int i;
 
+	git_setup_gettext();
+
 	git_extract_argv0_path(argv[0]);
 	set_die_routine(die_webcgi);
 
http-fetch.c +3 -0
index 762c750..b889c36 100644
@@ -2,6 +2,7 @@
 #include "exec_cmd.h"
 #include "http.h"
 #include "walker.h"
+#include "gettext.h"
 
 static const char http_fetch_usage[] = "git http-fetch "
 "[-c] [-t] [-a] [-v] [--recover] [-w ref] [--stdin] commit-id url";
@@ -24,6 +25,8 @@ int main(int argc, const char **argv)
 	int get_verbosely = 0;
 	int get_recover = 0;
 
+	git_setup_gettext();
+
 	git_extract_argv0_path(argv[0]);
 
 	while (arg < argc && argv[arg][0] == '-') {
http-push.c +3 -0
index c9bcd11..fc2c5f7 100644
@@ -10,6 +10,7 @@
 #include "remote.h"
 #include "list-objects.h"
 #include "sigchain.h"
+#include "gettext.h"
 
 #include <expat.h>
 
@@ -1791,6 +1792,8 @@ int main(int argc, char **argv)
 	struct remote *remote;
 	char *rewritten_url = NULL;
 
+	git_setup_gettext();
+
 	git_extract_argv0_path(argv[0]);
 
 	repo = xcalloc(sizeof(*repo), 1);
imap-send.c +3 -0
index 1a577a0..c8fb1f9 100644
@@ -25,6 +25,7 @@
 #include "cache.h"
 #include "exec_cmd.h"
 #include "run-command.h"
+#include "gettext.h"
 #ifdef NO_OPENSSL
 typedef void *SSL;
 #else
@@ -1535,6 +1536,8 @@ int main(int argc, char **argv)
 
 	git_extract_argv0_path(argv[0]);
 
+	git_setup_gettext();
+
 	if (argc != 1)
 		usage(imap_send_usage);
 
perl/Git/I18N.pm new file +91 -0

91 lines not on this page · raw message

perl/Makefile +2 -1
index 4ab21d6..4e624ff 100644
@@ -5,6 +5,7 @@ makfile:=perl.mak
 
 PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH))
 prefix_SQ = $(subst ','\'',$(prefix))
+localedir_SQ = $(subst ','\'',$(localedir))
 
 ifndef V
 	QUIET = @
@@ -38,7 +39,7 @@ $(makfile): ../GIT-CFLAGS Makefile
 	echo '	echo $(instdir_SQ)' >> $@
 else
 $(makfile): Makefile.PL ../GIT-CFLAGS
-	$(PERL_PATH) $< PREFIX='$(prefix_SQ)'
+	$(PERL_PATH) $< PREFIX='$(prefix_SQ)' --localedir='$(localedir_SQ)'
 endif
 
 # this is just added comfort for calling make directly in perl dir
perl/Makefile.PL +13 -1
index 0b9deca..456d45b 100644
@@ -1,4 +1,12 @@
+use strict;
+use warnings;
 use ExtUtils::MakeMaker;
+use Getopt::Long;
+
+# Sanity: die at first unknown option
+Getopt::Long::Configure qw/ pass_through /;
+
+GetOptions("localedir=s" => \my $localedir);
 
 sub MY::postamble {
 	return <<'MAKE_FRAG';
@@ -16,7 +24,10 @@ endif
 MAKE_FRAG
 }
 
-my %pm = ('Git.pm' => '$(INST_LIBDIR)/Git.pm');
+my %pm = (
+	'Git.pm' => '$(INST_LIBDIR)/Git.pm',
+	'Git/I18N.pm' => '$(INST_LIBDIR)/Git/I18N.pm',
+);
 
 # We come with our own bundled Error.pm. It's not in the set of default
 # Perl modules so install it if it's not available on the system yet.
@@ -33,6 +44,7 @@ WriteMakefile(
 	NAME            => 'Git',
 	VERSION_FROM    => 'Git.pm',
 	PM		=> \%pm,
+	PM_FILTER	=> qq[\$(PERL) -pe "s<\\Q++LOCALEDIR++\\E><$localedir>"],
 	MAKEFILE	=> 'perl.mak',
 	INSTALLSITEMAN3DIR => '$(SITEPREFIX)/share/man/man3'
 );
po/.gitignore new file +1 -0
new file mode 100644
index 0000000..221000e
@@ -0,0 +1 @@
+/*.pot
po/is.po new file +47 -0

47 lines not on this page · raw message

shell.c +3 -0
index e4864e0..ba27c6b 100644
@@ -2,6 +2,7 @@
 #include "quote.h"
 #include "exec_cmd.h"
 #include "strbuf.h"
+#include "gettext.h"
 
 static int do_generic_cmd(const char *me, char *arg)
 {
@@ -51,6 +52,8 @@ int main(int argc, char **argv)
 	struct commands *cmd;
 	int devnull_fd;
 
+	git_setup_gettext();
+
 	/*
 	 * Always open file descriptors 0/1/2 to avoid clobbering files
 	 * in die().  It also avoids not messing up when the pipes are
show-index.c +3 -0
index 4c0ac13..c2f5448 100644
@@ -1,5 +1,6 @@
 #include "cache.h"
 #include "pack.h"
+#include "gettext.h"
 
 static const char show_index_usage[] =
 "git show-index < <packed archive index>";
@@ -11,6 +12,8 @@ int main(int argc, char **argv)
 	unsigned int version;
 	static unsigned int top_index[256];
 
+	git_setup_gettext();
+
 	if (argc != 1)
 		usage(show_index_usage);
 	if (fread(top_index, 2 * 4, 1, stdin) != 1)
t/lib-gettext.sh new file +42 -0

42 lines not on this page · raw message

t/t0200-gettext.sh new file +113 -0

113 lines not on this page · raw message

t/t0200/test.c new file +13 -0
new file mode 100644
index 0000000..93373b3
@@ -0,0 +1,13 @@
+/* This is a phony C program that's only here to test xgettext message extraction */
+
+const char help[] =
+	N_("See 'git help COMMAND' for more information on a specific command.");
+
+int main(void)
+{
+	/* TRANSLATORS: This is a test. You don't need to translate it. */
+	puts(_("TEST: A C test string"));
+
+	/* TRANSLATORS: This is a test. You don't need to translate it. */
+	printf(_("TEST: A C test string %s"), "variable");
+}
t/t0200/test.perl new file +14 -0
new file mode 100644
index 0000000..36fba34
@@ -0,0 +1,14 @@
+# This is a phony Perl program that's only here to test xgettext
+# message extraction
+
+# so the above comment won't be folded into the next one by xgettext
+1;
+
+# TRANSLATORS: This is a test. You don't need to translate it.
+print __("TEST: A Perl test string");
+
+# TRANSLATORS: This is a test. You don't need to translate it.
+printf __("TEST: A Perl test variable %s"), "moo";
+
+# TRANSLATORS: If you see this, Git has a bug
+print _"TEST: A Perl string xgettext will not get";
t/t0200/test.sh new file +14 -0
new file mode 100644
index 0000000..022d607
@@ -0,0 +1,14 @@
+# This is a phony Shell program that's only here to test xgettext
+# message extraction
+
+# so the above comment won't be folded into the next one by xgettext
+echo
+
+# TRANSLATORS: This is a test. You don't need to translate it.
+gettext "TEST: A Shell test string"
+
+# TRANSLATORS: This is a test. You don't need to translate it.
+eval_gettext "TEST: A Shell test \$variable"
+
+# TRANSLATORS: If you see this, Git has a bug
+_("TEST: A Shell string xgettext won't get")
t/t0201-gettext-fallbacks.sh new file +49 -0

49 lines not on this page · raw message

t/t0202-gettext-perl.sh new file +27 -0
new file mode 100755
index 0000000..428ebb0
@@ -0,0 +1,27 @@
+#!/bin/sh
+#
+# Copyright (c) 2010 Ævar Arnfjörð Bjarmason
+#
+
+test_description='Perl gettext interface (Git::I18N)'
+
+. ./lib-gettext.sh
+
+if ! test_have_prereq PERL; then
+	skip_all='skipping perl interface tests, perl not available'
+	test_done
+fi
+
+"$PERL_PATH" -MTest::More -e 0 2>/dev/null || {
+	skip_all="Perl Test::More unavailable, skipping test"
+	test_done
+}
+
+# The external test will outputs its own plan
+test_external_has_tap=1
+
+test_external_without_stderr \
+    'Perl Git::I18N API' \
+    "$PERL_PATH" "$TEST_DIRECTORY"/t0202/test.pl
+
+test_done
t/t0202/test.pl new file +107 -0

107 lines not on this page · raw message

t/test-lib.sh +2 -0
index ac496aa..4ae0de8 100644
@@ -37,6 +37,7 @@ ORIGINAL_TERM=$TERM
 # For repeatability, reset the environment to known value.
 LANG=C
 LC_ALL=C
+LANGUAGE=C
 PAGER=cat
 TZ=UTC
 TERM=dumb
@@ -890,6 +891,7 @@ esac
 
 test -z "$NO_PERL" && test_set_prereq PERL
 test -z "$NO_PYTHON" && test_set_prereq PYTHON
+test -z "$NO_GETTEXT" && test_set_prereq GETTEXT
 
 # test whether the filesystem supports symbolic links
 ln -s x y 2>/dev/null && test -h y 2>/dev/null && test_set_prereq SYMLINKS
upload-pack.c +3 -0
index dc464d7..ece9a4b 100644
@@ -10,6 +10,7 @@
 #include "revision.h"
 #include "list-objects.h"
 #include "run-command.h"
+#include "gettext.h"
 
 static const char upload_pack_usage[] = "git upload-pack [--strict] [--timeout=nn] <dir>";
 
@@ -686,6 +687,8 @@ int main(int argc, char **argv)
 	int i;
 	int strict = 0;
 
+	git_setup_gettext();
+
 	git_extract_argv0_path(argv[0]);
 	read_replace_refs = 0;
 
Signature · 1 line
1.7.0.4
#1 lore raw
Quoted 4 lines · Ævar Arnfjörð Bjarmason

For Shell and Perl programs we rely on the git message catalog not being available. That's a reasonable assumption since then the message catalog won't be installed on the system during make install.

Would a "stale" message catalog (from a previous installation of git with gettext
enabled, via make install) be deleted upon new installation (via make install) with
NO_GETTEXT=YesPlease?

nazri

#2 lore raw
Quoted 7 lines · Nazri Ramliy
Quoted 4 lines · Ævar Arnfjörð Bjarmason

For Shell and Perl programs we rely on the git message catalog not being available. That's a reasonable assumption since then the message catalog won't be installed on the system during make install.

Quoted 5 lines

Would a "stale" message catalog (from a previous installation of git with gettext
enabled, via make install) be deleted upon new installation (via make install) with
NO_GETTEXT=YesPlease?

No. Just like we don't delete anything else that may exist on the system from a previous "make install". The patch assumes that this is the sort of thing package managers are for.

I didn't think it was worth it to guard against this case (by e.g. cleaning out Shell/Perl support at make time).