git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: hukeping <hukeping@huawei.com>
Cc: Jeff King <peff@peff.net>,
	"git@vger.kernel.org" <git@vger.kernel.org>,
	"Zhengjunling (JRing, Task Force)" <zhengjunling@huawei.com>,
	zhuangbiaowei <zhuangbiaowei@huawei.com>,
	"git@stormcloud9.net" <git@stormcloud9.net>,
	"rafa.almas@gmail.com" <rafa.almas@gmail.com>,
	"l.s.r@web.de" <l.s.r@web.de>
Subject: Re: [PATCH] Lengthening FORMAT_PATCH_NAME_MAX to 80
Date: Fri, 06 Nov 2020 09:45:01 -0800	[thread overview]
Message-ID: <xmqqwnyyfkgy.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <d5338d5f83584f7caf3ff0f4309f2275@huawei.com> (hukeping@huawei.com's message of "Fri, 6 Nov 2020 08:51:32 +0000")

hukeping <hukeping@huawei.com> writes:

>>I do not mind getting rid of the "FORMAT_PATCH_NAME_MAX" constant and
>>replacing it with a variable that defaults to 64 and can be tweaked by a command
>>line option and/or a configuration variable.
>>It does not feel it is worth the effort to replace one hardcoded constant with
>>another hardcoded constant.
>>
>>> Looking at the code which uses the constant, I suspect it could also
>>> be made simpler:
>>>
>>>   - the PATH_MAX check in open_next_file() seems pointless. Once upon a
>>>     time it mattered for fitting into a PATH_MAX buffer, but these days
>>>     we use a dynamic buffer anyway. We are probably better off to just
>>>     feed the result to the filesystem and see if it complains (since
>>>     either way we are aborting; I'd feel differently if we adjusted our
>>>     truncation size)
>>>
>>>   - the logic in fmt_output_subject() could probably be simpler if the
>>>     constant was "here's how long the subject should be", not "here's
>>>     how long the whole thing must be".
>>>
>>> But those are both orthogonal to your patch and can be done separately.
>>
>>Yes, these clean-ups seem worth doing.
>
> Agreed, and I'd like to do it with two separated commits:
> - commit-1,  cleanup the open_next_file() by drop the if (filename.len>=..) statements.
>
> - commit-2,  replace FORMAT_PATCH_NAME_MAX in fmt_output_subject() with a constant
>   in there and make it to 80(or other value?), and drop FORMAT_PATCH_NAME_MAX
>   from log-tree.h.
>
> Is this works for you?

I am not sure what you meant by "Agreed".  I said two things:

 - It is dubious that it is worth the effort to replace a hardcoded
   constant with another.  Making it configurable with command line
   option and/or configuration variable may be worth doing.

 - Two observations Peff made for further clean-up are probably
   worth doing.

If you are agreeing to both of the above and following through, then
yes, it seems like a good plan.  If agreement is only to the former,
it probably still is worth doing.  Anything else, I don't know.

  reply	other threads:[~2020-11-06 17:45 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-05 20:15 [PATCH] Lengthening FORMAT_PATCH_NAME_MAX to 80 Hu Keping
2020-11-05 15:01 ` Jeff King
2020-11-05 21:16   ` Junio C Hamano
2020-11-06  8:51     ` hukeping
2020-11-06 17:45       ` Junio C Hamano [this message]
2020-11-06 20:50     ` Junio C Hamano
2020-11-06 21:56       ` [PATCH] format-patch: make output filename configurable Junio C Hamano
2020-11-06 22:05         ` Eric Sunshine
2020-11-09 19:23           ` [PATCH v2] " Junio C Hamano
2020-11-10  0:23             ` Jeff King
2020-11-10  1:43               ` Junio C Hamano
2020-11-10  2:31             ` hukeping
2020-11-10  2:37               ` Junio C Hamano
2020-11-10  4:44                 ` hukeping
2020-11-10  5:40                   ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqwnyyfkgy.fsf@gitster.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@stormcloud9.net \
    --cc=git@vger.kernel.org \
    --cc=hukeping@huawei.com \
    --cc=l.s.r@web.de \
    --cc=peff@peff.net \
    --cc=rafa.almas@gmail.com \
    --cc=zhengjunling@huawei.com \
    --cc=zhuangbiaowei@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).