* redundant message in builtin/rm.c
@ 2013-07-26 2:37 Jiang Xin
2013-07-26 4:03 ` Ralf Thielow
0 siblings, 1 reply; 4+ messages in thread
From: Jiang Xin @ 2013-07-26 2:37 UTC (permalink / raw)
To: Mathieu Lienard--Mayor
Cc: Jorge Juan Garcia Garcia, Matthieu Moy, 'Git List
Hi,
Commit v1.8.3-1-g914dc02 (rm: better error message on failure for
multiple files)
introduced many messages need to be translated. I found two similar messages
each has a slight typo, and the differences cause redundant works for
l10n translators.
# builtin/rm.c, line: 90
Q_("the following submodule (or one of its nested "
"submodules)\n uses a .git directory:",
"the following submodules (or one of its nested "
"submodules)\n use a .git directory:",
( no space before "use(s) a .git directory" ?)
# builtin/rm.c, line: 240
Q_("the following submodule (or one of its nested "
"submodule)\nuses a .git directory:",
"the following submodules (or one of its nested "
"submodule)\nuse a .git directory:",
( "nested submodule" should be "nested submodules" ?)
--
Jiang Xin
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: redundant message in builtin/rm.c
2013-07-26 2:37 redundant message in builtin/rm.c Jiang Xin
@ 2013-07-26 4:03 ` Ralf Thielow
2013-07-26 6:04 ` Junio C Hamano
0 siblings, 1 reply; 4+ messages in thread
From: Ralf Thielow @ 2013-07-26 4:03 UTC (permalink / raw)
To: Jiang Xin
Cc: Mathieu Lienard--Mayor, Jorge Juan Garcia Garcia, Matthieu Moy,
'Git List
2013/7/26 Jiang Xin <worldhello.net@gmail.com>:
> Hi,
>
> Commit v1.8.3-1-g914dc02 (rm: better error message on failure for
> multiple files)
> introduced many messages need to be translated. I found two similar messages
> each has a slight typo, and the differences cause redundant works for
> l10n translators.
>
> # builtin/rm.c, line: 90
>
> Q_("the following submodule (or one of its nested "
> "submodules)\n uses a .git directory:",
> "the following submodules (or one of its nested "
> "submodules)\n use a .git directory:",
>
> ( no space before "use(s) a .git directory" ?)
>
> # builtin/rm.c, line: 240
>
> Q_("the following submodule (or one of its nested "
> "submodule)\nuses a .git directory:",
> "the following submodules (or one of its nested "
> "submodule)\nuse a .git directory:",
>
> ( "nested submodule" should be "nested submodules" ?)
>
It's more readable if "\n" is at the end of a line.
Q_("the following submodule (or one of its nested submodules)\n"
"uses a .git directory:"
> --
> Jiang Xin
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: redundant message in builtin/rm.c
2013-07-26 4:03 ` Ralf Thielow
@ 2013-07-26 6:04 ` Junio C Hamano
2013-08-05 10:10 ` Matthieu Moy
0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2013-07-26 6:04 UTC (permalink / raw)
To: Ralf Thielow
Cc: Jiang Xin, Mathieu Lienard--Mayor, Jorge Juan Garcia Garcia,
Matthieu Moy, 'Git List
Ralf Thielow <ralf.thielow@gmail.com> writes:
> It's more readable if "\n" is at the end of a line.
>
> Q_("the following submodule (or one of its nested submodules)\n"
> "uses a .git directory:"
Thanks both. Perhaps we should do something like this?
-- >8 --
Subject: builtin/rm.c: consolidate error reporting for removing submodules
We have two (not identical) copies of error reporting when
attempting to remove submodules that have their repositories
embedded within them. Add a helper function so that we do not have
to repeat similar error messages with subtly different wording
without a good reason.
Noticed by Jiang Xin.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
builtin/rm.c | 41 ++++++++++++++++++++---------------------
1 file changed, 20 insertions(+), 21 deletions(-)
diff --git a/builtin/rm.c b/builtin/rm.c
index 5d0c068..694568a 100644
--- a/builtin/rm.c
+++ b/builtin/rm.c
@@ -57,6 +57,21 @@ static void print_error_files(struct string_list *files_list,
}
}
+static void error_removing_concrete_submodules(struct string_list *files, int *errs)
+{
+ print_error_files(files,
+ Q_("the following submodule (or one of its nested "
+ "submodules)\n"
+ "uses a .git directory:",
+ "the following submodules (or one of its nested "
+ "submodules)\n"
+ "use a .git directory:", files->nr),
+ _("\n(use 'rm -rf' if you really want to remove "
+ "it including all of its history)"),
+ errs);
+ string_list_clear(files, 0);
+}
+
static int check_submodules_use_gitfiles(void)
{
int i;
@@ -85,16 +100,8 @@ static int check_submodules_use_gitfiles(void)
if (!submodule_uses_gitfile(name))
string_list_append(&files, name);
}
- print_error_files(&files,
- Q_("the following submodule (or one of its nested "
- "submodules)\n uses a .git directory:",
- "the following submodules (or one of its nested "
- "submodules)\n use a .git directory:",
- files.nr),
- _("\n(use 'rm -rf' if you really want to remove "
- "it including all of its history)"),
- &errs);
- string_list_clear(&files, 0);
+
+ error_removing_concrete_submodules(&files, &errs);
return errs;
}
@@ -236,17 +243,9 @@ static int check_local_mod(unsigned char *head, int index_only)
" or -f to force removal)"),
&errs);
string_list_clear(&files_cached, 0);
- print_error_files(&files_submodule,
- Q_("the following submodule (or one of its nested "
- "submodule)\nuses a .git directory:",
- "the following submodules (or one of its nested "
- "submodule)\nuse a .git directory:",
- files_submodule.nr),
- _("\n(use 'rm -rf' if you really "
- "want to remove it including all "
- "of its history)"),
- &errs);
- string_list_clear(&files_submodule, 0);
+
+ error_removing_concrete_submodules(&files_submodule, &errs);
+
print_error_files(&files_local,
Q_("the following file has local modifications:",
"the following files have local modifications:",
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: redundant message in builtin/rm.c
2013-07-26 6:04 ` Junio C Hamano
@ 2013-08-05 10:10 ` Matthieu Moy
0 siblings, 0 replies; 4+ messages in thread
From: Matthieu Moy @ 2013-08-05 10:10 UTC (permalink / raw)
To: Junio C Hamano
Cc: Ralf Thielow, Jiang Xin, Mathieu Lienard--Mayor,
Jorge Juan Garcia Garcia, 'Git List
Junio C Hamano <gitster@pobox.com> writes:
> Thanks both. Perhaps we should do something like this?
>
> -- >8 --
> Subject: builtin/rm.c: consolidate error reporting for removing submodules
Sounds good, yes.
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-08-05 10:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-26 2:37 redundant message in builtin/rm.c Jiang Xin
2013-07-26 4:03 ` Ralf Thielow
2013-07-26 6:04 ` Junio C Hamano
2013-08-05 10:10 ` Matthieu Moy
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).