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

Re: [PATCH v3 7/7] git-sh-setup: don't mark trees not used in-tree for i18n

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
Mar 31, 2022, 10:23 UTC
Message-ID
<45c963da-19a5-de51-34d4-5b29f461c9ec@gmail.com>
In-Reply-To
<220328.86lewudzw3.gmgdl@evledraar.gmail.com>
Hi Ævar
On 28/03/2022 13:16, Ævar Arnfjörð Bjarmason wrote:
Show 14 quoted lines
> 
> On Mon, Mar 28 2022, Johannes Sixt wrote:
> 
>> Am 27.03.22 um 13:15 schrieb Ævar Arnfjörð Bjarmason:
>>>
>>> On Sun, Mar 27 2022, Johannes Sixt wrote:
>>>
>>>> Am 26.03.22 um 18:14 schrieb Ævar Arnfjörð Bjarmason:
>>>>> Partially revert d323c6b6410 (i18n: git-sh-setup.sh: mark strings for
>>>>> translation, 2016-06-17).
>>>>>
>>>>> These strings are no longer used in-tree, and we shouldn't be wasting
>>>>> translator time on them for the benefit of a hypothetical out-of-tree
>>>>> user of git-sh-setup.sh.

The out of tree users of git-sh-setup.sh are not hypothetical, they exist and objected when you recently tried to remove these functions entirely[1].

Show 7 quoted lines
>>>> There is public documentation for these functions. Hence, you must
>>>> assume that they are used in scripts outside of Git. Castrating their
>>>> functionality like this patch does is unacceptable.
>>>
>>> For require_clean_work_tree() the public documentation for this function
>>> states that it will emit a specific error message in English, and you're
>>> expected to Lego-interpolate a string that we'll concatenate with it:

The documentation does not say whether the message is translated or not, probably because it was not updated when the translations were added six years ago.

>>> 	[...]It emits an error message of the form `Cannot
>>>          <action>: <reason>. <hint>`, and dies.  Example:
This is not a promising a "specific error message in English"
>>> 	+
>>> 	----------------
>>> 	require_clean_work_tree rebase "Please commit or stash them."

This is an example message you cannot use that to argue that we will always show a message in English

Show 18 quoted lines
>>> So I think that marking it for translation like this as d323c6b6410 was
>>> always broken in that it broke that documented promise.
>>
>> I can buy this argument. But then this must be a separate commit with
>> this justification.
> 
> Sure, I can elaborate on that point & split it up.
> 
>>> But that's just an argument for keeping the require_clean_work_tree()
>>> part of this patch, not require_work_tree_exists().
>>>
>>> For that one and others in git-sh-setup we've never said that we'd
>>> provide these translated (and to the extent we've implied anything about
>>> the rest, have strongly implied the opposite with
>>> require_clean_work_tree()'s docs).
>>>
>>> Nothing will break for out-of-tree users as a result of this
>>> change.
The strings the user sees will change
>>> When we added these functions and their documentation their
>>> output wouldn't be translated,
Where does the documentation say "the output will not be translated"?
Show 14 quoted lines
>>> then sometimes it was, now it's not
>>> again.
>>
>> This does not sound convincing at all, but rather like "I want the code
>> to be so, and here is some handwaving to justify it". What is wrong with
>> the status quo?
> 
> The larger context for why I was looking at this again is that I'm
> trying to slowly get us to the point where we can remove the
> i18n-in-shellscript entirtely.
> 
> But I thought that was a rather large digression for the commit message,
> and that these being both unused, and not something the "public" API
> affected ever promised it would do was sufficient.

I think if that is what you want to do then you should propose a series that does just that and explains why it is desirable, rather than coming up with other reasons to justify the changes you want.

Show 34 quoted lines
>>> We need also need to be mindful of translator time, it's a *lot* of
>>> strings to go through, and e.g. I've commented in the past on patches
>>> that marked stuff in t/helper/ for translation.
>>
>> Translator's time is your concern? No translator sifts through 5000
>> strings on every release. There are tools that show only new strings to
>> translate.
> 
> Yes, I'm the person who added this entire i18n infrastructure to git, I
> know how it works :)
> 
>> A text is translated once and then it lies under the radar
>> until someone changes it. Don't tell me that is time-consuming.
> 
> Yes, individual orphaned strings aren't, but they add up.
> 
> Just like having that "USE_PIC" comment in configure.ac isn't much of a
> big deal, but it makes sense to clean up unused code, just as we're
> adding new code.
> 
> I will say that your implicit proposal of keeping this forever instead
> is assuming that we won't have more translations for git, and every new
> translator will look at this.
> 
> Context is critical for translators, so even if it's one string it's a
> string you'll quickly grep for and find ... no uses for, and then likely
> go hunting around for where it's used only to (hopefully, in that case)
> find this thread. Better not to have it.
> 
>> On the other hand, there is a lot of *reviewer* time that you are
>> spending with changes like this. *That* should be your concern.
> 
> I'd think most of the that time, if any, will be spent on this
> sub-thread you started, so ... :)

This sub-tread exists because you posted this patch to the mailing list. Blaming reviewers for asking perfectly reasonable questions is neither fair nor helpful.

This patch does not remove dead code as the rest of the series does but instead changes user facing messages in code that we recently established is part of the public api[2]. Nothing has changed since that recent discussion so I'm confused as to why you are proposing to modify the api again so soon.

Best Wishes
Phillip

[1] https://lore.kernel.org/git/CAJm9OHfN9iXDt-rzu-wb=67y4PPpmCUgMfmZPy1JMBJkHG256g@mail.gmail.com/ [2] https://lore.kernel.org/git/xmqq5yvik8bc.fsf@gitster.g/

Show 9 quoted lines
> Which isn't to say it shouldn't have been brought up, but from my
> perspective I was (and still am) making a rather small change that I
> think won't harm anyone in practice, and gives us some incremental
> tidyness & contributes to an eventual large "git rm git-sh-i18n.sh" et
> al.
> 
> But on reflection I don't think it's worth worrying about, and we can
> just do this change.
> 
Previous: Johannes SixtNext: Ævar Arnfjörð Bjarmason
Message 36 of 51 in “various: remove dead code”
  1. 0/6 various: remove dead codeÆvar Arnfjörð Bjarmason, Nov 19, 2021
  2. 1/6 xdiff/xmacros.h: remove unused XDL_PTRFREEÆvar Arnfjörð Bjarmason, Nov 19, 2021
  3. Jeff KingNov 19, 2021
  4. 2/6 pack-bitmap-write: remove unused bitmap_reset() functionÆvar Arnfjörð Bjarmason, Nov 19, 2021
  5. Jeff KingNov 19, 2021
  6. 3/6 object-store.h: remove unused has_sha1_file*()Ævar Arnfjörð Bjarmason, Nov 19, 2021
  7. Jeff KingNov 19, 2021
  8. 4/6 alloc.[ch]: remove alloc_report() functionÆvar Arnfjörð Bjarmason, Nov 19, 2021
  9. Junio C HamanoNov 19, 2021
  10. 5/6 strbuf: remove unused istarts_with() functionÆvar Arnfjörð Bjarmason, Nov 19, 2021
  11. Jeff KingNov 19, 2021
  12. Junio C HamanoNov 19, 2021
  13. 6/6 json-writer.[ch]: remove unused formatting functionsÆvar Arnfjörð Bjarmason, Nov 19, 2021
  14. Jeff KingNov 19, 2021
  15. Junio C HamanoNov 19, 2021
  16. Jeff KingNov 19, 2021
  17. 0/5 various: remove dead codeÆvar Arnfjörð Bjarmason, Nov 19, 2021
  18. 1/5 xdiff/xmacros.h: remove unused XDL_PTRFREEÆvar Arnfjörð Bjarmason, Nov 19, 2021
  19. 2/5 pack-bitmap-write: remove unused bitmap_reset() functionÆvar Arnfjörð Bjarmason, Nov 19, 2021
  20. 5/5 json-writer.[ch]: remove unused formatting functionsÆvar Arnfjörð Bjarmason, Nov 19, 2021
  21. 4/5 alloc.[ch]: remove alloc_report() functionÆvar Arnfjörð Bjarmason, Nov 19, 2021
  22. 3/5 object-store.h: remove unused has_sha1_file*()Ævar Arnfjörð Bjarmason, Nov 19, 2021
  23. 0/7 various: remove dead code, drop i18n not used in-treeÆvar Arnfjörð Bjarmason, Mar 26, 2022
  24. 1/7 run-command.h: remove always unused "clean_on_exit_handler_cbdata"Ævar Arnfjörð Bjarmason, Mar 26, 2022
  25. 4/7 pack-bitmap-write: remove unused bitmap_reset() functionÆvar Arnfjörð Bjarmason, Mar 26, 2022
  26. 3/7 xdiff/xmacros.h: remove unused XDL_PTRFREEÆvar Arnfjörð Bjarmason, Mar 26, 2022
  27. 2/7 configure.ac: remove USE_PIC commentÆvar Arnfjörð Bjarmason, Mar 26, 2022
  28. 5/7 object-store.h: remove unused has_sha1_file*()Ævar Arnfjörð Bjarmason, Mar 26, 2022
  29. 6/7 alloc.[ch]: remove alloc_report() functionÆvar Arnfjörð Bjarmason, Mar 26, 2022
  30. 7/7 git-sh-setup: don't mark trees not used in-tree for i18nÆvar Arnfjörð Bjarmason, Mar 26, 2022
  31. Johannes SixtMar 27, 2022
  32. Ævar Arnfjörð BjarmasonMar 27, 2022
  33. Johannes SixtMar 28, 2022
  34. Ævar Arnfjörð BjarmasonMar 28, 2022
  35. Johannes SixtMar 28, 2022
  36. Phillip WoodMar 31, 2022
  37. Ævar Arnfjörð BjarmasonMar 31, 2022
  38. Johannes SixtMar 31, 2022
  39. Ævar Arnfjörð BjarmasonApr 2, 2022
  40. Johannes SixtApr 2, 2022
  41. Ævar Arnfjörð BjarmasonApr 3, 2022
  42. Johannes SixtApr 4, 2022
  43. 0/6 various: remove dead codeÆvar Arnfjörð Bjarmason, Mar 31, 2022
  44. 1/6 run-command.h: remove always unused "clean_on_exit_handler_cbdata"Ævar Arnfjörð Bjarmason, Mar 31, 2022
  45. Junio C HamanoMar 31, 2022
  46. 3/6 xdiff/xmacros.h: remove unused XDL_PTRFREEÆvar Arnfjörð Bjarmason, Mar 31, 2022
  47. 4/6 pack-bitmap-write: remove unused bitmap_reset() functionÆvar Arnfjörð Bjarmason, Mar 31, 2022
  48. Junio C HamanoMar 31, 2022
  49. 5/6 object-store.h: remove unused has_sha1_file*()Ævar Arnfjörð Bjarmason, Mar 31, 2022
  50. 6/6 alloc.[ch]: remove alloc_report() functionÆvar Arnfjörð Bjarmason, Mar 31, 2022
  51. 2/6 configure.ac: remove USE_PIC commentÆvar Arnfjörð Bjarmason, Mar 31, 2022

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.