git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC/PATCH] sequencer: do not translate reflog messages
@ 2022-08-12 15:38 Michael J Gruber
  2022-08-12 17:21 ` Junio C Hamano
  2022-08-12 19:21 ` Phillip Wood
  0 siblings, 2 replies; 34+ messages in thread
From: Michael J Gruber @ 2022-08-12 15:38 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin

Traditionally, reflog messages were never translated, in particular not
on storage.

Due to the switch of more parts of git to the sequencer, old changes in
the sequencer code may lead to recent changes in git's behaviour. E.g.:
c28cbc5ea6 ("sequencer: mark action_name() for translation", 2016-10-21)
marked several uses of `action_name()` for translation. Recently, this
lead to a partially translated reflog:

`rebase: fast-forward` is translated (e.g. in de to `Rebase: Vorspulen`)
whereas other reflog entries such as `rebase (pick):` remain
untranslated as they should be.

Change the relevant line in the sequencer so that this reflog entry
remains untranslated, as well.

Signed-off-by: Michael J Gruber <git@grubix.eu>
---
The patch also changes `action_name()` not to translate the names. This
makes no difference for `rebase: fast-forward` (I don't quite grok why
so far) but in any case, the callers mark the result of `action_name()`
(or do not mark it) so that the result itself should not be translated.
The full test suite passes either way.

RFC for my lack of full grasp of the relevant code paths.

 sequencer.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sequencer.c b/sequencer.c
index 5f22b7cd37..b456489590 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -395,11 +395,11 @@ static const char *action_name(const struct replay_opts *opts)
 {
 	switch (opts->action) {
 	case REPLAY_REVERT:
-		return N_("revert");
+		return "revert";
 	case REPLAY_PICK:
-		return N_("cherry-pick");
+		return "cherry-pick";
 	case REPLAY_INTERACTIVE_REBASE:
-		return N_("rebase");
+		return "rebase";
 	}
 	die(_("unknown action: %d"), opts->action);
 }
@@ -575,7 +575,7 @@ static int fast_forward_to(struct repository *r,
 	if (checkout_fast_forward(r, from, to, 1))
 		return -1; /* the callee should have complained already */
 
-	strbuf_addf(&sb, _("%s: fast-forward"), _(action_name(opts)));
+	strbuf_addf(&sb, "%s: fast-forward", action_name(opts));
 
 	transaction = ref_transaction_begin(&err);
 	if (!transaction ||
-- 
2.37.1.671.g27f8e4a42a


^ permalink raw reply related	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2022-08-22 16:12 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-12 15:38 [RFC/PATCH] sequencer: do not translate reflog messages Michael J Gruber
2022-08-12 17:21 ` Junio C Hamano
2022-08-12 19:21 ` Phillip Wood
2022-08-12 20:43   ` Junio C Hamano
2022-08-15 20:20     ` Johannes Schindelin
2022-08-16  8:59       ` Phillip Wood
2022-08-16 11:02         ` Johannes Schindelin
2022-08-18 13:13           ` [PATCH 0/4] sequencer: clarify translations Michael J Gruber
2022-08-18 13:13             ` [PATCH 1/4] sequencer: do not translate reflog messages Michael J Gruber
2022-08-18 14:55               ` Ævar Arnfjörð Bjarmason
2022-08-19  9:25                 ` Johannes Schindelin
2022-08-19 15:12                   ` Ævar Arnfjörð Bjarmason
2022-08-19 20:44                     ` Junio C Hamano
2022-08-19 21:13                       ` Ævar Arnfjörð Bjarmason
2022-08-19 22:42                         ` Junio C Hamano
2022-08-19 23:33                           ` Ævar Arnfjörð Bjarmason
2022-08-20  8:56                         ` Jeff King
2022-08-20 21:20                           ` Junio C Hamano
2022-08-18 13:13             ` [PATCH 2/4] sequencer: do not translate parameters to error_resolve_conflict() Michael J Gruber
2022-08-18 15:01               ` Ævar Arnfjörð Bjarmason
2022-08-18 15:23                 ` Michael J Gruber
2022-08-18 20:30                   ` Junio C Hamano
2022-08-19  9:26                 ` Johannes Schindelin
2022-08-19 17:36                   ` Junio C Hamano
2022-08-22 13:53                     ` Johannes Schindelin
2022-08-22 16:12                       ` Junio C Hamano
2022-08-18 13:13             ` [PATCH 3/4] sequencer: do not translate command names Michael J Gruber
2022-08-18 13:13             ` [PATCH 4/4] po: adjust README to code Michael J Gruber
2022-08-18 15:03               ` Ævar Arnfjörð Bjarmason
2022-08-18 20:36               ` Junio C Hamano
2022-08-19  7:50                 ` [PATCH 4/4 v2] sequencer: spell out command names and do not translate them Michael J Gruber
2022-08-19  9:30                   ` Johannes Schindelin
2022-08-19  9:32             ` [PATCH 0/4] sequencer: clarify translations Johannes Schindelin
2022-08-19 10:19               ` Michael J Gruber

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 NNTP newsgroup(s).