git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] push: improve consistency of output when "up to date"

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 11, 2024, 22:33 UTC
Message-ID
<xmqqjzofec0e.fsf@gitster.g>
In-Reply-To
<CAPig+cRr0V2ecnmxk1H_yF24dwSFA6niPxYXGH0MZ+wGP9m9UA@mail.gmail.com>
Eric Sunshine <sunshine@sunshineco.com> writes:
Show 13 quoted lines
> Thanks. This particular change is proposed periodically...
>
>> diff --git a/transport.c b/transport.c
>> @@ -1467,7 +1467,7 @@ int transport_push(struct repository *r,
>>         else if (!quiet && !ret && !transport_refs_pushed(remote_refs))
>> -               fprintf(stderr, "Everything up-to-date\n");
>> +               fprintf(stderr, "Everything up to date.\n");
>
> ... but has not been considered desirable.
>
> See, for instance, this email thread explaining the rationale for
> avoiding such a change:
> https://lore.kernel.org/git/pull.1298.git.1658908927714.gitgitgadget@gmail.com/T/
Looking at the "grep" hits:

$ git grep -e 'up-to-date.*"' \*.c builtin/rm.c: OPT__FORCE(&force, N_("override the up-to-date check"), PARSE_OPT_NOCOMPLETE), builtin/send-pack.c: fprintf(stderr, "Everything up-to-date\n"); http-push.c: fprintf(stderr, "'%s': up-to-date\n", ref->name); http-push.c: "Maybe you are not up-to-date and " transport.c: fprintf(stderr, "Everything up-to-date\n");

it is true that these are not marked for translation, which should be a clue enough that we want them to be exactly the way they are spelled. However, they are going to the standard error stream. Is it reasonable to expect third-party tools scraping it to find the string "up-to-date"?

In any case, a safe first step is to add a short comment to each of these that should not be translated. Perhaps something along this line.

------- >8 ------------- >8 ------------- >8 -------
Subject: [PATCH] messages: mark some strings with "up-to-date" not to touch

The treewide clean-up of "up-to-date" strings done in 7560f547 (treewide: correct several "up-to-date" to "up to date", 2017-08-23) deliberately left some out, but unlike the lines that were changed by the commit, the lines that were deliberately left untouched by the commit is impossible to ask "git blame" to link back to the commit that did not touch them.

Let's do the second best thing, leave a short comment near them, to make it possible for those who are motivated enough to find out why we decided to tell them "do not modify".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 builtin/send-pack.c | 1 +
 http-push.c         | 2 ++
 transport.c         | 1 +
 3 files changed, 4 insertions(+)
diff --git a/builtin/send-pack.c b/builtin/send-pack.c
index b7183be970..ac7ec1e643 100644
--- a/builtin/send-pack.c
+++ b/builtin/send-pack.c
@@ -333,6 +333,7 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix)
 	}
 
 	if (!ret && !transport_refs_pushed(remote_refs))
+		/* do not modify this string */
 		fprintf(stderr, "Everything up-to-date\n");
 
 	return ret;
diff --git a/http-push.c b/http-push.c
index b4d0b2a6aa..e4c6645cc2 100644
--- a/http-push.c
+++ b/http-push.c
@@ -1851,6 +1851,7 @@ int cmd_main(int argc, const char **argv)
 
 		if (oideq(&ref->old_oid, &ref->peer_ref->new_oid)) {
 			if (push_verbosely)
+				/* do not modify this string */
 				fprintf(stderr, "'%s': up-to-date\n", ref->name);
 			if (helper_status)
 				printf("ok %s up to date\n", ref->name);
@@ -1871,6 +1872,7 @@ int cmd_main(int argc, const char **argv)
 				 * commits at the remote end and likely
 				 * we were not up to date to begin with.
 				 */
+				/* do not modify this string */
 				error("remote '%s' is not an ancestor of\n"
 				      "local '%s'.\n"
 				      "Maybe you are not up-to-date and "
diff --git a/transport.c b/transport.c
index bd7899e9bf..c9f39d45f1 100644
--- a/transport.c
+++ b/transport.c
@@ -1467,6 +1467,7 @@ int transport_push(struct repository *r,
 	if (porcelain && !push_ret)
 		puts("Done");
 	else if (!quiet && !ret && !transport_refs_pushed(remote_refs))
+		/* do not modify this string */
 		fprintf(stderr, "Everything up-to-date\n");
 
 done:
-- 
2.43.0-283-ga54a84b333
Previous: Eric SunshineNext: Eric Sunshine
Message 3 of 11 in “push: improve consistency of output when "up to date"”
  1. push: improve consistency of output when "up to date"Benji Kay via GitGitGadget, Jan 11, 2024
  2. Eric SunshineJan 11, 2024
  3. Junio C HamanoJan 11, 2024
  4. Eric SunshineJan 12, 2024
  5. messages: mark some strings with "up-to-date" not to touchEric Sunshine, Jan 12, 2024
  6. Junio C HamanoJan 12, 2024
  7. Patrick SteinhardtJan 15, 2024
  8. Taylor BlauJan 11, 2024
  9. Eric SunshineJan 11, 2024
  10. Dragan SimicJan 17, 2024
  11. Benji KayJan 12, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.