From 5670e0ec1576fd0cd68f7cb610c878c645786972 Mon Sep 17 00:00:00 2001 From: Michael J Gruber Date: Thu, 18 Aug 2022 15:13:26 +0200 Subject: [PATCH 1/3] sequencer: do not translate reflog messages 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 Signed-off-by: Junio C Hamano --- sequencer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sequencer.c b/sequencer.c index 5f22b7cd37..51d75dfbe1 100644 --- a/sequencer.c +++ b/sequencer.c @@ -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 || From 1c8dfc3674fd9da7ded669b706b292ee2074db73 Mon Sep 17 00:00:00 2001 From: Michael J Gruber Date: Thu, 18 Aug 2022 15:13:27 +0200 Subject: [PATCH 2/3] sequencer: do not translate parameters to error_resolve_conflict() `error_resolve_conflict()` checks the untranslated action_name parameter, so pass it as is. Suggested-by: Johannes Schindelin Signed-off-by: Michael J Gruber Signed-off-by: Junio C Hamano --- sequencer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sequencer.c b/sequencer.c index 51d75dfbe1..8b32b239b9 100644 --- a/sequencer.c +++ b/sequencer.c @@ -537,7 +537,7 @@ static struct tree *empty_tree(struct repository *r) static int error_dirty_index(struct repository *repo, struct replay_opts *opts) { if (repo_read_index_unmerged(repo)) - return error_resolve_conflict(_(action_name(opts))); + return error_resolve_conflict(action_name(opts)); error(_("your local changes would be overwritten by %s."), _(action_name(opts))); @@ -3753,7 +3753,7 @@ static int do_reset(struct repository *r, init_checkout_metadata(&unpack_tree_opts.meta, name, &oid, NULL); if (repo_read_index_unmerged(r)) { - ret = error_resolve_conflict(_(action_name(opts))); + ret = error_resolve_conflict(action_name(opts)); goto cleanup; } From 629444ad45b08618157b3e46431433125f730894 Mon Sep 17 00:00:00 2001 From: Michael J Gruber Date: Thu, 18 Aug 2022 15:13:28 +0200 Subject: [PATCH 3/3] sequencer: do not translate command names When action_name is used to denote a command `git %s` do not translate since command names are never translated. Suggested-by: Johannes Schindelin Signed-off-by: Michael J Gruber Signed-off-by: Junio C Hamano --- sequencer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sequencer.c b/sequencer.c index 8b32b239b9..79dad522f5 100644 --- a/sequencer.c +++ b/sequencer.c @@ -2422,7 +2422,7 @@ static int read_and_refresh_cache(struct repository *r, if (repo_read_index(r) < 0) { rollback_lock_file(&index_lock); return error(_("git %s: failed to read the index"), - _(action_name(opts))); + action_name(opts)); } refresh_index(r->index, REFRESH_QUIET|REFRESH_UNMERGED, NULL, NULL, NULL); @@ -2430,7 +2430,7 @@ static int read_and_refresh_cache(struct repository *r, if (write_locked_index(r->index, &index_lock, COMMIT_LOCK | SKIP_IF_UNCHANGED)) { return error(_("git %s: failed to refresh the index"), - _(action_name(opts))); + action_name(opts)); } }