git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: hukeping <hukeping@huawei.com>
To: Junio C Hamano <gitster@pobox.com>, Git List <git@vger.kernel.org>
Cc: "Eric Sunshine" <sunshine@sunshineco.com>,
	"Zhengjunling (JRing, Task Force)" <zhengjunling@huawei.com>,
	zhuangbiaowei <zhuangbiaowei@huawei.com>,
	"Patrick Hemmer" <git@stormcloud9.net>,
	"Rafael Ascensao" <rafa.almas@gmail.com>,
	"René Scharfe" <l.s.r@web.de>, "Jeff King" <peff@peff.net>
Subject: RE: [PATCH v2] format-patch: make output filename configurable
Date: Tue, 10 Nov 2020 02:31:38 +0000	[thread overview]
Message-ID: <9d4b387655024b24a20ce2384740b03a@huawei.com> (raw)
In-Reply-To: <xmqqwnyubagr.fsf@gitster.c.googlers.com>

>For the past 15 years, we've used the hardcoded 64 as the length limit of the
>filename of the output from the "git format-patch"
>command.  Since the value is shorter than the 80-column terminal, it could grow
>without line wrapping a bit.  At the same time, since the value is longer than half
>of the 80-column terminal, we could fit two or more of them in "ls" output on
>such a terminal if we allowed to lower it.
>
>Introduce a new command line option --filename-max-length=<n> and a new
>configuration variable format.filenameMaxLength to override the hardcoded
>default.
>
It would be very hard to remove a config knob rather than add  a new one and we already
have too many.

Does it worth to add a new configuration variable for this or just a hard-coded value is enough?

>While we are at it, remove a check that the name of output directory does not
>exceed PATH_MAX---this check is pointless in that by the time control reaches the
>function, the caller would already have done an equivalent of "mkdir -p", so if the
>system does not like an overly long directory name, the control wouldn't have
>reached here, and otherwise, we know that the system allowed the output
>directory to exist.  In the worst case, we will get an error when we try to open the
>output file and handle the error correctly anyway.
>
>Signed-off-by: Junio C Hamano <gitster@pobox.com>


  parent reply	other threads:[~2020-11-10  2:31 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
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 [this message]
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

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

  git send-email \
    --in-reply-to=9d4b387655024b24a20ce2384740b03a@huawei.com \
    --to=hukeping@huawei.com \
    --cc=git@stormcloud9.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=l.s.r@web.de \
    --cc=peff@peff.net \
    --cc=rafa.almas@gmail.com \
    --cc=sunshine@sunshineco.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.
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 NNTP newsgroup(s).