{"thread":{"id":"60728","subject":"[PATCH] push: improve consistency of output when \"up to date\"","startedAt":"2024-01-11T21:27:32Z","lastAt":"2024-01-17T22:02:02Z","messageCount":11,"participants":["Benji Kay via GitGitGadget","Eric Sunshine","Taylor Blau","Junio C Hamano","Benji Kay","Patrick Steinhardt","Dragan Simic"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"486659","messageId":"pull.1638.git.1705008449995.gitgitgadget@gmail.com","threadId":"60728","inReplyTo":null,"subject":"[PATCH] push: improve consistency of output when \"up to date\"","fromName":"Benji Kay via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2024-01-11T21:27:29Z","receivedAt":"2024-01-11T21:27:32Z","isPatch":true,"sender":{"key":"okaybenji@gmail.com","avatar":null},"body":"From: okaybenji <okaybenji@gmail.com>\n\nWhen one issues the pull command, one may see \"Already up to date.\"\nWhen issuing the push command, one may have seen \"Everything up-to-date\".\nTo improve consistency, \"Everything up to date.\" is printed instead.\n(The hyphens have been removed, and a period has been added.)\n\nSigned-off-by: okaybenji <okaybenji@gmail.com>\n---\n    push: improve consistency of output when \"up to date\"\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-1638%2Fokaybenji%2Fup-to-date-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1638/okaybenji/up-to-date-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/1638\n\n transport.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/transport.c b/transport.c\nindex bd7899e9bf5..c42cb4e58b4 100644\n--- a/transport.c\n+++ b/transport.c\n@@ -1467,7 +1467,7 @@ int transport_push(struct repository *r,\n \tif (porcelain && !push_ret)\n \t\tputs(\"Done\");\n \telse if (!quiet && !ret && !transport_refs_pushed(remote_refs))\n-\t\tfprintf(stderr, \"Everything up-to-date\\n\");\n+\t\tfprintf(stderr, \"Everything up to date.\\n\");\n \n done:\n \tfree_refs(local_refs);\n\nbase-commit: a54a84b333adbecf7bc4483c0e36ed5878cac17b\n-- \ngitgitgadget\n"},{"id":"486664","messageId":"CAPig+cRr0V2ecnmxk1H_yF24dwSFA6niPxYXGH0MZ+wGP9m9UA@mail.gmail.com","threadId":"60728","inReplyTo":"pull.1638.git.1705008449995.gitgitgadget@gmail.com","subject":"Re: [PATCH] push: improve consistency of output when \"up to date\"","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2024-01-11T21:43:01Z","receivedAt":"2024-01-11T21:43:13Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Thu, Jan 11, 2024 at 4:27 PM Benji Kay via GitGitGadget\n<gitgitgadget@gmail.com> wrote:\n> When one issues the pull command, one may see \"Already up to date.\"\n> When issuing the push command, one may have seen \"Everything up-to-date\".\n> To improve consistency, \"Everything up to date.\" is printed instead.\n> (The hyphens have been removed, and a period has been added.)\n>\n> Signed-off-by: okaybenji <okaybenji@gmail.com>\n\nThanks. This particular change is proposed periodically...\n\n> diff --git a/transport.c b/transport.c\n> @@ -1467,7 +1467,7 @@ int transport_push(struct repository *r,\n>         else if (!quiet && !ret && !transport_refs_pushed(remote_refs))\n> -               fprintf(stderr, \"Everything up-to-date\\n\");\n> +               fprintf(stderr, \"Everything up to date.\\n\");\n\n... but has not been considered desirable.\n\nSee, for instance, this email thread explaining the rationale for\navoiding such a change:\nhttps://lore.kernel.org/git/pull.1298.git.1658908927714.gitgitgadget@gmail.com/T/\n"},{"id":"486665","messageId":"ZaBhHSCT7EOgTo/N@nand.local","threadId":"60728","inReplyTo":"pull.1638.git.1705008449995.gitgitgadget@gmail.com","subject":"Re: [PATCH] push: improve consistency of output when \"up to date\"","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2024-01-11T21:43:57Z","receivedAt":"2024-01-11T21:43:59Z","isPatch":true,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Thu, Jan 11, 2024 at 09:27:29PM +0000, Benji Kay via GitGitGadget wrote:\n> From: okaybenji <okaybenji@gmail.com>\n>\n> When one issues the pull command, one may see \"Already up to date.\"\n> When issuing the push command, one may have seen \"Everything up-to-date\".\n> To improve consistency, \"Everything up to date.\" is printed instead.\n> (The hyphens have been removed, and a period has been added.)\n>\n> Signed-off-by: okaybenji <okaybenji@gmail.com>\n> ---\n>     push: improve consistency of output when \"up to date\"\n>\n> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1638%2Fokaybenji%2Fup-to-date-v1\n> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1638/okaybenji/up-to-date-v1\n> Pull-Request: https://github.com/gitgitgadget/git/pull/1638\n>\n>  transport.c | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/transport.c b/transport.c\n> index bd7899e9bf5..c42cb4e58b4 100644\n> --- a/transport.c\n> +++ b/transport.c\n> @@ -1467,7 +1467,7 @@ int transport_push(struct repository *r,\n>  \tif (porcelain && !push_ret)\n>  \t\tputs(\"Done\");\n>  \telse if (!quiet && !ret && !transport_refs_pushed(remote_refs))\n> -\t\tfprintf(stderr, \"Everything up-to-date\\n\");\n> +\t\tfprintf(stderr, \"Everything up to date.\\n\");\n\nBetween the two, I have a vague preference towards \"up-to-date\", which\nwould suggest changing the pull command's output to read \"Already\nup-to-date\". Personally I think that neither of them should include a\nperiod in their output, but whichever we decide should be done so\nconsistently between the two.\n\nAlso, should this string be marked for translation?\n\nThanks,\nTaylor\n"},{"id":"486667","messageId":"CAPig+cTsDxv4tmULLF-y3eE4q0b=f+W7-ChyYD2MzPxCiLJY8w@mail.gmail.com","threadId":"60728","inReplyTo":"ZaBhHSCT7EOgTo/N@nand.local","subject":"Re: [PATCH] push: improve consistency of output when \"up to date\"","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2024-01-11T21:45:40Z","receivedAt":"2024-01-11T21:45:52Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Thu, Jan 11, 2024 at 4:44 PM Taylor Blau <me@ttaylorr.com> wrote:\n> On Thu, Jan 11, 2024 at 09:27:29PM +0000, Benji Kay via GitGitGadget wrote:\n> > -             fprintf(stderr, \"Everything up-to-date\\n\");\n> > +             fprintf(stderr, \"Everything up to date.\\n\");\n>\n> Between the two, I have a vague preference towards \"up-to-date\", which\n> would suggest changing the pull command's output to read \"Already\n> up-to-date\". Personally I think that neither of them should include a\n> period in their output, but whichever we decide should be done so\n> consistently between the two.\n>\n> Also, should this string be marked for translation?\n\nSee: https://lore.kernel.org/git/7n9r5q74-9qr1-29sr-p2n5-943n01s0p78r@tzk.qr/\n"},{"id":"486670","messageId":"xmqqjzofec0e.fsf@gitster.g","threadId":"60728","inReplyTo":"CAPig+cRr0V2ecnmxk1H_yF24dwSFA6niPxYXGH0MZ+wGP9m9UA@mail.gmail.com","subject":"Re: [PATCH] push: improve consistency of output when \"up to date\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-01-11T22:33:21Z","receivedAt":"2024-01-11T22:33:24Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Sunshine <sunshine@sunshineco.com> writes:\n\n> Thanks. This particular change is proposed periodically...\n>\n>> diff --git a/transport.c b/transport.c\n>> @@ -1467,7 +1467,7 @@ int transport_push(struct repository *r,\n>>         else if (!quiet && !ret && !transport_refs_pushed(remote_refs))\n>> -               fprintf(stderr, \"Everything up-to-date\\n\");\n>> +               fprintf(stderr, \"Everything up to date.\\n\");\n>\n> ... but has not been considered desirable.\n>\n> See, for instance, this email thread explaining the rationale for\n> avoiding such a change:\n> https://lore.kernel.org/git/pull.1298.git.1658908927714.gitgitgadget@gmail.com/T/\n\nLooking at the \"grep\" hits:\n\n$ git grep -e 'up-to-date.*\"' \\*.c\nbuiltin/rm.c:\tOPT__FORCE(&force, N_(\"override the up-to-date check\"), PARSE_OPT_NOCOMPLETE),\nbuiltin/send-pack.c:\t\tfprintf(stderr, \"Everything up-to-date\\n\");\nhttp-push.c:\t\t\t\tfprintf(stderr, \"'%s': up-to-date\\n\", ref->name);\nhttp-push.c:\t\t\t\t      \"Maybe you are not up-to-date and \"\ntransport.c:\t\tfprintf(stderr, \"Everything up-to-date\\n\");\n\nit is true that these are not marked for translation, which should\nbe a clue enough that we want them to be exactly the way they are\nspelled.  However, they are going to the standard error stream.  Is\nit reasonable to expect third-party tools scraping it to find the\nstring \"up-to-date\"?\n\nIn any case, a safe first step is to add a short comment to each of\nthese that should not be translated.  Perhaps something along this\nline.\n\n\n------- >8 ------------- >8 ------------- >8 -------\nSubject: [PATCH] messages: mark some strings with \"up-to-date\" not to touch\n\nThe treewide clean-up of \"up-to-date\" strings done in 7560f547\n(treewide: correct several \"up-to-date\" to \"up to date\", 2017-08-23)\ndeliberately left some out, but unlike the lines that were changed\nby the commit, the lines that were deliberately left untouched by\nthe commit is impossible to ask \"git blame\" to link back to the\ncommit that did not touch them.\n\nLet's do the second best thing, leave a short comment near them, to\nmake it possible for those who are motivated enough to find out why\nwe decided to tell them \"do not modify\".\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n\n builtin/send-pack.c | 1 +\n http-push.c         | 2 ++\n transport.c         | 1 +\n 3 files changed, 4 insertions(+)\n\ndiff --git a/builtin/send-pack.c b/builtin/send-pack.c\nindex b7183be970..ac7ec1e643 100644\n--- a/builtin/send-pack.c\n+++ b/builtin/send-pack.c\n@@ -333,6 +333,7 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix)\n \t}\n \n \tif (!ret && !transport_refs_pushed(remote_refs))\n+\t\t/* do not modify this string */\n \t\tfprintf(stderr, \"Everything up-to-date\\n\");\n \n \treturn ret;\ndiff --git a/http-push.c b/http-push.c\nindex b4d0b2a6aa..e4c6645cc2 100644\n--- a/http-push.c\n+++ b/http-push.c\n@@ -1851,6 +1851,7 @@ int cmd_main(int argc, const char **argv)\n \n \t\tif (oideq(&ref->old_oid, &ref->peer_ref->new_oid)) {\n \t\t\tif (push_verbosely)\n+\t\t\t\t/* do not modify this string */\n \t\t\t\tfprintf(stderr, \"'%s': up-to-date\\n\", ref->name);\n \t\t\tif (helper_status)\n \t\t\t\tprintf(\"ok %s up to date\\n\", ref->name);\n@@ -1871,6 +1872,7 @@ int cmd_main(int argc, const char **argv)\n \t\t\t\t * commits at the remote end and likely\n \t\t\t\t * we were not up to date to begin with.\n \t\t\t\t */\n+\t\t\t\t/* do not modify this string */\n \t\t\t\terror(\"remote '%s' is not an ancestor of\\n\"\n \t\t\t\t      \"local '%s'.\\n\"\n \t\t\t\t      \"Maybe you are not up-to-date and \"\ndiff --git a/transport.c b/transport.c\nindex bd7899e9bf..c9f39d45f1 100644\n--- a/transport.c\n+++ b/transport.c\n@@ -1467,6 +1467,7 @@ int transport_push(struct repository *r,\n \tif (porcelain && !push_ret)\n \t\tputs(\"Done\");\n \telse if (!quiet && !ret && !transport_refs_pushed(remote_refs))\n+\t\t/* do not modify this string */\n \t\tfprintf(stderr, \"Everything up-to-date\\n\");\n \n done:\n-- \n2.43.0-283-ga54a84b333\n\n"},{"id":"486678","messageId":"CADavbxdexJ-nzbiicLF7SOJsELKW5J5Zox5MFGdWDHhcE=85VQ@mail.gmail.com","threadId":"60728","inReplyTo":"CADavbxcFXpP5EQZ=UEMZt+6KKVtCsTMbgQDHEo0uinm0YfRbZA@mail.gmail.com","subject":"Re: [PATCH] push: improve consistency of output when \"up to date\"","fromName":"Benji Kay","fromEmail":"okaybenji@gmail.com","sentAt":"2024-01-12T00:55:40Z","receivedAt":"2024-01-12T00:55:53Z","isPatch":true,"sender":{"key":"okaybenji@gmail.com","avatar":null},"body":"If it's important these messages are not changed (under the presumption\nsome programs may make decisions based on the output), perhaps a test\nshould be written to ensure the output is as expected.\n"},{"id":"486682","messageId":"CAPig+cSO74EbK7RS5t3TAbRLUuLyynenugg4RgsOQ_=VyA4aAw@mail.gmail.com","threadId":"60728","inReplyTo":"xmqqjzofec0e.fsf@gitster.g","subject":"Re: [PATCH] push: improve consistency of output when \"up to date\"","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2024-01-12T03:14:05Z","receivedAt":"2024-01-12T03:14:16Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Thu, Jan 11, 2024 at 5:33 PM Junio C Hamano <gitster@pobox.com> wrote:\n> Eric Sunshine <sunshine@sunshineco.com> writes:\n> > Thanks. This particular change is proposed periodically...\n> > ... but has not been considered desirable.\n> >\n> > See, for instance, this email thread explaining the rationale for\n> > avoiding such a change:\n> > https://lore.kernel.org/git/pull.1298.git.1658908927714.gitgitgadget@gmail.com/T/\n>\n> Let's do the second best thing, leave a short comment near them, to\n> make it possible for those who are motivated enough to find out why\n> we decided to tell them \"do not modify\".\n> ---\n> diff --git a/builtin/send-pack.c b/builtin/send-pack.c\n> @@ -333,6 +333,7 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix)\n>         if (!ret && !transport_refs_pushed(remote_refs))\n> +               /* do not modify this string */\n>                 fprintf(stderr, \"Everything up-to-date\\n\");\n\nYes, that helps, though, we can probably be a bit more friendly to\nfuture developers. Rather than insisting that they dig through\nhistory, we could use a slightly less terse comment, such as:\n\n    /* stable plumbing output; do not modify or localize */\n"},{"id":"486716","messageId":"20240112171910.11131-1-ericsunshine@charter.net","threadId":"60728","inReplyTo":"xmqqjzofec0e.fsf@gitster.g","subject":"[PATCH] messages: mark some strings with \"up-to-date\" not to touch","fromName":"Eric Sunshine","fromEmail":"ericsunshine@charter.net","sentAt":"2024-01-12T17:19:10Z","receivedAt":"2024-01-12T17:21:29Z","isPatch":true,"sender":{"key":"ericsunshine@charter.net","avatar":null},"body":"From: Junio C Hamano <gitster@pobox.com>\n\nThe treewide clean-up of \"up-to-date\" strings done in 7560f547\n(treewide: correct several \"up-to-date\" to \"up to date\", 2017-08-23)\ndeliberately left some out, but unlike the lines that were changed\nby the commit, the lines that were deliberately left untouched by\nthe commit is impossible to ask \"git blame\" to link back to the\ncommit that did not touch them.\n\nLet's do the second best thing, leave a short comment near them\nexplaining why those strings should not be modified or localized.\n\n[es: make in-code comment more developer-friendly]\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\nSigned-off-by: Eric Sunshine <sunshine@sunshineco.com>\n---\n\nThis is a reroll of Junio's[1] v1 which adds an in-code comment\nexplaining that \"up-to-date\" messages in plumbing commands should not be\nchanged, but doesn't explain _why_, which forces readers to dig through\nproject history or the mailing list to understand the motivation. v2\nchanges the comment to be more developer-friendly by adding the\nexplanation directly to the comment.\n\n[1]: https://lore.kernel.org/git/xmqqjzofec0e.fsf@gitster.g/\n\nRange-diff:\n1:  36596051c9 ! 1:  782169e0b1 messages: mark some strings with \"up-to-date\" not to touch\n    @@ Commit message\n         the commit is impossible to ask \"git blame\" to link back to the\n         commit that did not touch them.\n     \n    -    Let's do the second best thing, leave a short comment near them, to\n    -    make it possible for those who are motivated enough to find out why\n    -    we decided to tell them \"do not modify\".\n    +    Let's do the second best thing, leave a short comment near them\n    +    explaining why those strings should not be modified or localized.\n    +\n    +    [es: make in-code comment more developer-friendly]\n     \n         Signed-off-by: Junio C Hamano <gitster@pobox.com>\n    +    Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>\n     \n      ## builtin/send-pack.c ##\n     @@ builtin/send-pack.c: int cmd_send_pack(int argc, const char **argv, const char *prefix)\n      \t}\n      \n      \tif (!ret && !transport_refs_pushed(remote_refs))\n    -+\t\t/* do not modify this string */\n    ++\t\t/* stable plumbing output; do not modify or localize */\n      \t\tfprintf(stderr, \"Everything up-to-date\\n\");\n      \n      \treturn ret;\n    @@ http-push.c: int cmd_main(int argc, const char **argv)\n      \n      \t\tif (oideq(&ref->old_oid, &ref->peer_ref->new_oid)) {\n      \t\t\tif (push_verbosely)\n    -+\t\t\t\t/* do not modify this string */\n    ++\t\t\t\t/* stable plumbing output; do not modify or localize */\n      \t\t\t\tfprintf(stderr, \"'%s': up-to-date\\n\", ref->name);\n      \t\t\tif (helper_status)\n      \t\t\t\tprintf(\"ok %s up to date\\n\", ref->name);\n    @@ http-push.c: int cmd_main(int argc, const char **argv)\n      \t\t\t\t * commits at the remote end and likely\n      \t\t\t\t * we were not up to date to begin with.\n      \t\t\t\t */\n    -+\t\t\t\t/* do not modify this string */\n    ++\t\t\t\t/* stable plumbing output; do not modify or localize */\n      \t\t\t\terror(\"remote '%s' is not an ancestor of\\n\"\n      \t\t\t\t      \"local '%s'.\\n\"\n      \t\t\t\t      \"Maybe you are not up-to-date and \"\n    @@ transport.c: int transport_push(struct repository *r,\n      \tif (porcelain && !push_ret)\n      \t\tputs(\"Done\");\n      \telse if (!quiet && !ret && !transport_refs_pushed(remote_refs))\n    -+\t\t/* do not modify this string */\n    ++\t\t/* stable plumbing output; do not modify or localize */\n      \t\tfprintf(stderr, \"Everything up-to-date\\n\");\n      \n      done:\n\n builtin/send-pack.c | 1 +\n http-push.c         | 2 ++\n transport.c         | 1 +\n 3 files changed, 4 insertions(+)\n\ndiff --git a/builtin/send-pack.c b/builtin/send-pack.c\nindex b7183be970..3df9eaad09 100644\n--- a/builtin/send-pack.c\n+++ b/builtin/send-pack.c\n@@ -333,6 +333,7 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix)\n \t}\n \n \tif (!ret && !transport_refs_pushed(remote_refs))\n+\t\t/* stable plumbing output; do not modify or localize */\n \t\tfprintf(stderr, \"Everything up-to-date\\n\");\n \n \treturn ret;\ndiff --git a/http-push.c b/http-push.c\nindex b4d0b2a6aa..12d1113741 100644\n--- a/http-push.c\n+++ b/http-push.c\n@@ -1851,6 +1851,7 @@ int cmd_main(int argc, const char **argv)\n \n \t\tif (oideq(&ref->old_oid, &ref->peer_ref->new_oid)) {\n \t\t\tif (push_verbosely)\n+\t\t\t\t/* stable plumbing output; do not modify or localize */\n \t\t\t\tfprintf(stderr, \"'%s': up-to-date\\n\", ref->name);\n \t\t\tif (helper_status)\n \t\t\t\tprintf(\"ok %s up to date\\n\", ref->name);\n@@ -1871,6 +1872,7 @@ int cmd_main(int argc, const char **argv)\n \t\t\t\t * commits at the remote end and likely\n \t\t\t\t * we were not up to date to begin with.\n \t\t\t\t */\n+\t\t\t\t/* stable plumbing output; do not modify or localize */\n \t\t\t\terror(\"remote '%s' is not an ancestor of\\n\"\n \t\t\t\t      \"local '%s'.\\n\"\n \t\t\t\t      \"Maybe you are not up-to-date and \"\ndiff --git a/transport.c b/transport.c\nindex bd7899e9bf..df518ead70 100644\n--- a/transport.c\n+++ b/transport.c\n@@ -1467,6 +1467,7 @@ int transport_push(struct repository *r,\n \tif (porcelain && !push_ret)\n \t\tputs(\"Done\");\n \telse if (!quiet && !ret && !transport_refs_pushed(remote_refs))\n+\t\t/* stable plumbing output; do not modify or localize */\n \t\tfprintf(stderr, \"Everything up-to-date\\n\");\n \n done:\n-- \n2.43.0\n\n"},{"id":"486725","messageId":"xmqqa5pabeii.fsf@gitster.g","threadId":"60728","inReplyTo":"20240112171910.11131-1-ericsunshine@charter.net","subject":"Re: [PATCH] messages: mark some strings with \"up-to-date\" not to touch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-01-12T18:19:49Z","receivedAt":"2024-01-12T18:19:54Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Sunshine <ericsunshine@charter.net> writes:\n\n> Let's do the second best thing, leave a short comment near them\n> explaining why those strings should not be modified or localized.\n\nI simply could not come up with a short and concise in-code comment\n;-) What you picked looks good to me.\n\nThanks.  \n\n\n>\n> [es: make in-code comment more developer-friendly]\n>\n> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n> Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>\n> ---\n>\n> This is a reroll of Junio's[1] v1 which adds an in-code comment\n> explaining that \"up-to-date\" messages in plumbing commands should not be\n> changed, but doesn't explain _why_, which forces readers to dig through\n> project history or the mailing list to understand the motivation. v2\n> changes the comment to be more developer-friendly by adding the\n> explanation directly to the comment.\n>\n> [1]: https://lore.kernel.org/git/xmqqjzofec0e.fsf@gitster.g/\n>\n> Range-diff:\n> 1:  36596051c9 ! 1:  782169e0b1 messages: mark some strings with \"up-to-date\" not to touch\n>     @@ Commit message\n>          the commit is impossible to ask \"git blame\" to link back to the\n>          commit that did not touch them.\n>      \n>     -    Let's do the second best thing, leave a short comment near them, to\n>     -    make it possible for those who are motivated enough to find out why\n>     -    we decided to tell them \"do not modify\".\n>     +    Let's do the second best thing, leave a short comment near them\n>     +    explaining why those strings should not be modified or localized.\n>     +\n>     +    [es: make in-code comment more developer-friendly]\n>      \n>          Signed-off-by: Junio C Hamano <gitster@pobox.com>\n>     +    Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>\n>      \n>       ## builtin/send-pack.c ##\n>      @@ builtin/send-pack.c: int cmd_send_pack(int argc, const char **argv, const char *prefix)\n>       \t}\n>       \n>       \tif (!ret && !transport_refs_pushed(remote_refs))\n>     -+\t\t/* do not modify this string */\n>     ++\t\t/* stable plumbing output; do not modify or localize */\n>       \t\tfprintf(stderr, \"Everything up-to-date\\n\");\n>       \n>       \treturn ret;\n>     @@ http-push.c: int cmd_main(int argc, const char **argv)\n>       \n>       \t\tif (oideq(&ref->old_oid, &ref->peer_ref->new_oid)) {\n>       \t\t\tif (push_verbosely)\n>     -+\t\t\t\t/* do not modify this string */\n>     ++\t\t\t\t/* stable plumbing output; do not modify or localize */\n>       \t\t\t\tfprintf(stderr, \"'%s': up-to-date\\n\", ref->name);\n>       \t\t\tif (helper_status)\n>       \t\t\t\tprintf(\"ok %s up to date\\n\", ref->name);\n>     @@ http-push.c: int cmd_main(int argc, const char **argv)\n>       \t\t\t\t * commits at the remote end and likely\n>       \t\t\t\t * we were not up to date to begin with.\n>       \t\t\t\t */\n>     -+\t\t\t\t/* do not modify this string */\n>     ++\t\t\t\t/* stable plumbing output; do not modify or localize */\n>       \t\t\t\terror(\"remote '%s' is not an ancestor of\\n\"\n>       \t\t\t\t      \"local '%s'.\\n\"\n>       \t\t\t\t      \"Maybe you are not up-to-date and \"\n>     @@ transport.c: int transport_push(struct repository *r,\n>       \tif (porcelain && !push_ret)\n>       \t\tputs(\"Done\");\n>       \telse if (!quiet && !ret && !transport_refs_pushed(remote_refs))\n>     -+\t\t/* do not modify this string */\n>     ++\t\t/* stable plumbing output; do not modify or localize */\n>       \t\tfprintf(stderr, \"Everything up-to-date\\n\");\n>       \n>       done:\n>\n>  builtin/send-pack.c | 1 +\n>  http-push.c         | 2 ++\n>  transport.c         | 1 +\n>  3 files changed, 4 insertions(+)\n>\n> diff --git a/builtin/send-pack.c b/builtin/send-pack.c\n> index b7183be970..3df9eaad09 100644\n> --- a/builtin/send-pack.c\n> +++ b/builtin/send-pack.c\n> @@ -333,6 +333,7 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix)\n>  \t}\n>  \n>  \tif (!ret && !transport_refs_pushed(remote_refs))\n> +\t\t/* stable plumbing output; do not modify or localize */\n>  \t\tfprintf(stderr, \"Everything up-to-date\\n\");\n>  \n>  \treturn ret;\n> diff --git a/http-push.c b/http-push.c\n> index b4d0b2a6aa..12d1113741 100644\n> --- a/http-push.c\n> +++ b/http-push.c\n> @@ -1851,6 +1851,7 @@ int cmd_main(int argc, const char **argv)\n>  \n>  \t\tif (oideq(&ref->old_oid, &ref->peer_ref->new_oid)) {\n>  \t\t\tif (push_verbosely)\n> +\t\t\t\t/* stable plumbing output; do not modify or localize */\n>  \t\t\t\tfprintf(stderr, \"'%s': up-to-date\\n\", ref->name);\n>  \t\t\tif (helper_status)\n>  \t\t\t\tprintf(\"ok %s up to date\\n\", ref->name);\n> @@ -1871,6 +1872,7 @@ int cmd_main(int argc, const char **argv)\n>  \t\t\t\t * commits at the remote end and likely\n>  \t\t\t\t * we were not up to date to begin with.\n>  \t\t\t\t */\n> +\t\t\t\t/* stable plumbing output; do not modify or localize */\n>  \t\t\t\terror(\"remote '%s' is not an ancestor of\\n\"\n>  \t\t\t\t      \"local '%s'.\\n\"\n>  \t\t\t\t      \"Maybe you are not up-to-date and \"\n> diff --git a/transport.c b/transport.c\n> index bd7899e9bf..df518ead70 100644\n> --- a/transport.c\n> +++ b/transport.c\n> @@ -1467,6 +1467,7 @@ int transport_push(struct repository *r,\n>  \tif (porcelain && !push_ret)\n>  \t\tputs(\"Done\");\n>  \telse if (!quiet && !ret && !transport_refs_pushed(remote_refs))\n> +\t\t/* stable plumbing output; do not modify or localize */\n>  \t\tfprintf(stderr, \"Everything up-to-date\\n\");\n>  \n>  done:\n"},{"id":"486791","messageId":"ZaTwIUBKNhuAmrLX@tanuki","threadId":"60728","inReplyTo":"xmqqjzofec0e.fsf@gitster.g","subject":"Re: [PATCH] push: improve consistency of output when \"up to date\"","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-01-15T08:43:13Z","receivedAt":"2024-01-15T08:43:19Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Thu, Jan 11, 2024 at 02:33:21PM -0800, Junio C Hamano wrote:\n> Eric Sunshine <sunshine@sunshineco.com> writes:\n> \n> > Thanks. This particular change is proposed periodically...\n> >\n> >> diff --git a/transport.c b/transport.c\n> >> @@ -1467,7 +1467,7 @@ int transport_push(struct repository *r,\n> >>         else if (!quiet && !ret && !transport_refs_pushed(remote_refs))\n> >> -               fprintf(stderr, \"Everything up-to-date\\n\");\n> >> +               fprintf(stderr, \"Everything up to date.\\n\");\n> >\n> > ... but has not been considered desirable.\n> >\n> > See, for instance, this email thread explaining the rationale for\n> > avoiding such a change:\n> > https://lore.kernel.org/git/pull.1298.git.1658908927714.gitgitgadget@gmail.com/T/\n> \n> Looking at the \"grep\" hits:\n> \n> $ git grep -e 'up-to-date.*\"' \\*.c\n> builtin/rm.c:\tOPT__FORCE(&force, N_(\"override the up-to-date check\"), PARSE_OPT_NOCOMPLETE),\n> builtin/send-pack.c:\t\tfprintf(stderr, \"Everything up-to-date\\n\");\n> http-push.c:\t\t\t\tfprintf(stderr, \"'%s': up-to-date\\n\", ref->name);\n> http-push.c:\t\t\t\t      \"Maybe you are not up-to-date and \"\n> transport.c:\t\tfprintf(stderr, \"Everything up-to-date\\n\");\n> \n> it is true that these are not marked for translation, which should\n> be a clue enough that we want them to be exactly the way they are\n> spelled.  However, they are going to the standard error stream.  Is\n> it reasonable to expect third-party tools scraping it to find the\n> string \"up-to-date\"?\n\nI would say it's not entirely reasonable:\n\n  - These are strings that users see frequently, and if they are not\n    proficient in the English language I think it actually regresses\n    their user experience.\n\n  - The way this string is written would never lead me, as a script\n    developer, to think that this is a message that should be parsed by\n    my script. It's simply too user-focussed to make me think so.\n\n  - Last but not least, I think it's not entirely unreasonable to ask\n    script developers to use e.g. LANG=C when they expect strings to be\n    stable.\n\nAlso, with the introduction of `git push --porcelain`, I think there is\neven less reason to keep such user-visible strings intact. Any machine\nthat wants to parse output of git-push(1) should use `--porcelain`\ninstead in my opinion.\n\nPatrick\n"},{"id":"486940","messageId":"d6161449aa19aebeb4c3bea1a751e8b5@manjaro.org","threadId":"60728","inReplyTo":"ZaBhHSCT7EOgTo/N@nand.local","subject":"Re: [PATCH] push: improve consistency of output when \"up to date\"","fromName":"Dragan Simic","fromEmail":"dsimic@manjaro.org","sentAt":"2024-01-17T22:02:00Z","receivedAt":"2024-01-17T22:02:02Z","isPatch":true,"sender":{"key":"dsimic@manjaro.org","avatar":null},"body":"On 2024-01-11 22:43, Taylor Blau wrote:\n> On Thu, Jan 11, 2024 at 09:27:29PM +0000, Benji Kay via GitGitGadget \n> wrote:\n>> From: okaybenji <okaybenji@gmail.com>\n>> \n>> When one issues the pull command, one may see \"Already up to date.\"\n>> When issuing the push command, one may have seen \"Everything \n>> up-to-date\".\n>> To improve consistency, \"Everything up to date.\" is printed instead.\n>> (The hyphens have been removed, and a period has been added.)\n>> \n>> Signed-off-by: okaybenji <okaybenji@gmail.com>\n>> ---\n>>     push: improve consistency of output when \"up to date\"\n>> \n>> Published-As: \n>> https://github.com/gitgitgadget/git/releases/tag/pr-1638%2Fokaybenji%2Fup-to-date-v1\n>> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git \n>> pr-1638/okaybenji/up-to-date-v1\n>> Pull-Request: https://github.com/gitgitgadget/git/pull/1638\n>> \n>>  transport.c | 2 +-\n>>  1 file changed, 1 insertion(+), 1 deletion(-)\n>> \n>> diff --git a/transport.c b/transport.c\n>> index bd7899e9bf5..c42cb4e58b4 100644\n>> --- a/transport.c\n>> +++ b/transport.c\n>> @@ -1467,7 +1467,7 @@ int transport_push(struct repository *r,\n>>  \tif (porcelain && !push_ret)\n>>  \t\tputs(\"Done\");\n>>  \telse if (!quiet && !ret && !transport_refs_pushed(remote_refs))\n>> -\t\tfprintf(stderr, \"Everything up-to-date\\n\");\n>> +\t\tfprintf(stderr, \"Everything up to date.\\n\");\n> \n> Between the two, I have a vague preference towards \"up-to-date\", which\n> would suggest changing the pull command's output to read \"Already\n> up-to-date\". Personally I think that neither of them should include a\n> period in their output, but whichever we decide should be done so\n> consistently between the two.\n\nI'm not a native English speaker, but I spent years contributing to \nEnglish Wikipedia.  According to the manual of style employed by \nWikipedia, which is based mainly on The Chicago Manual of Style, \nhyphenated forms should not be used at the ends of sentences, or at the \nends of sentence-like forms.  In this case, we don't have complete \nsentences.\n\n[1] https://www.chicagomanualofstyle.org/home.html\n"}]}