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

Re: [PATCH v2] format-patch: make output filename configurable

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 10, 2020, 05:40 UTC
Message-ID
<xmqqk0ut93bs.fsf@gitster.c.googlers.com>
In-Reply-To
<8b97c61e983c432aab1063912d6266b9@huawei.com>
hukeping <hukeping@huawei.com> writes:
Show 11 quoted lines
>>> Does it worth to add a new configuration variable for this or just a
>>> hard-coded value is enough?
>>
>>I personally would say "yes, the current code that limits to 64 is enough", but you,
>>as the person who said that you do not like the current hard-coded value, are not
>>in the position to ask that question, I would have to say---if it were enough for
>>you, you wouldn't have complained about 64 in the first place ;-)
>
> The original motivation is to lengthening the limit because of
> file name truncated problem, so update the value to a larger one
> seems like the simplest way for me.

It actually would be an improvement to me if we shorten the current hardcoded limit. In fact, 64 is still a bit too long to fit in dired buffer and raising the limit will make it even worse.

In other words, you are forgetting that a larger limit is not always a better limit.

I am not saying that between my wish to keep 64 as near optimal (and possibly make it shorter) and your wish to make it longer to avoid truncation, the former wish is more important than the latter. The former however is at least as important as the latter [*1*].

And once you realize that one hardcoded limit never is ideal for everybody, you wouldn't even dream to suggest that raising the limit to another hardcoded value is better. Adding a configuration knob is a way to treat people with respect and give them choice to suit the system to their taste.

The names of output files from format-patch is a very local matter, because once it is fed to "git send-email", the receiving end does not even care how many letters you used for your filename---after all, you may not have used an intermediate file at all. It is a good place to give personal choice, as opposed to parts of the system where interaction among multiple people happens (e.g. we wouldn't dream of making the characters allowed in refnames configurable---that would cause chaos between hosting sites and fetchers), where we give more careful thought before making things configurable in order to avoid fracturing the ecosystem.

Thanks.
[Footnote]

*1* ... exactly because we know that most users who used Git in the past 15 years were happy with the current limit as we haven't seen much complaint until your patch. We cannot tell if they wanted the limit to be shorter, or longer, though.

Previous: hukeping
Message 15 of 15 in “Lengthening FORMAT_PATCH_NAME_MAX to 80”
  1. Lengthening FORMAT_PATCH_NAME_MAX to 80Hu Keping, Nov 5, 2020
  2. Jeff KingNov 5, 2020
  3. Junio C HamanoNov 5, 2020
  4. hukepingNov 6, 2020
  5. Junio C HamanoNov 6, 2020
  6. Junio C HamanoNov 6, 2020
  7. format-patch: make output filename configurableJunio C Hamano, Nov 6, 2020
  8. Eric SunshineNov 6, 2020
  9. format-patch: make output filename configurableJunio C Hamano, Nov 9, 2020
  10. Jeff KingNov 10, 2020
  11. Junio C HamanoNov 10, 2020
  12. hukepingNov 10, 2020
  13. Junio C HamanoNov 10, 2020
  14. hukepingNov 10, 2020
  15. Junio C HamanoNov 10, 2020

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.