From: Elia Pinto <gitter.spiros@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Brandon Williams <bmwill@google.com>,
"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: [PATCHv3 2/2] builtin/commit.c: switch to xstrfmt(), instead of snprintf,
Date: Sun, 15 Jan 2017 09:13:19 +0100 [thread overview]
Message-ID: <CA+EOSB=4-TKpi6mr-yVbwRsFrVzE=vo4Y9Qm3VMm7pn=UB1_hQ@mail.gmail.com> (raw)
In-Reply-To: <xmqqr345cacz.fsf@gitster.mtv.corp.google.com>
2017-01-15 3:42 GMT+01:00 Junio C Hamano <gitster@pobox.com>:
> Elia Pinto <gitter.spiros@gmail.com> writes:
>
>> Ok. I agree. But is it strictly necessary to resend for this ?
>
> FWIW, the attacched is what I queued locally, after complaining
> "both have the same title? They need to be explained better."
>
> In any case, I sense that 2/2 will be redone using strbuf, from the
> looks of what is discussed in a subthread nearby?
Yes, it seems to me correct, I resend the patch 2/2 based on the review
thank you all
>
> Thanks.
>
> commit 8d7aa4ba6a00b3ff69261e88b4842c0df5662125
> Author: Elia Pinto <gitter.spiros@gmail.com>
> Date: Fri Jan 13 17:58:00 2017 +0000
>
> builtin/commit.c: remove the PATH_MAX limitation via dynamic allocation
>
> Remove the PATH_MAX limitation from the environment setting that
> points to a filename by switching to dynamic allocation.
>
> As a side effect of this change, we also reduce the snprintf()
> calls, that may silently truncate results if the programmer is not
> careful.
>
> Helped-by: Junio C Hamano <gitster@pobox.com>
> Helped-by: Jeff King <peff@peff.net>
> Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
>
> commit 2a7e328877982557d921a398af9442093290c613
> Author: Elia Pinto <gitter.spiros@gmail.com>
> Date: Fri Jan 13 17:58:01 2017 +0000
>
> builtin/commit.c: switch to xstrfmt(), instead of snprintf()
>
> Switch to dynamic allocation with xstrfmt(), so we can avoid dealing
> with magic numbers in the code and reduce the cognitive burden from
> the programmers. The original code is correct, but programmers no
> longer have to count bytes needed for static allocation to know that.
>
> As a side effect of this change, we also reduce the snprintf()
> calls, that may silently truncate results if the programmer is not
> careful.
>
> Helped-by: Junio C Hamano <gitster@pobox.com>
> Helped-by: Jeff King <peff@peff.net>
> Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
next prev parent reply other threads:[~2017-01-15 8:13 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-13 17:58 [PATCHv3 1/2] builtin/commit.c: removes the PATH_MAX limitation via dynamic allocation Elia Pinto
2017-01-13 17:58 ` [PATCHv3 2/2] builtin/commit.c: switch to xstrfmt(), instead of snprintf, Elia Pinto
2017-01-13 18:33 ` Brandon Williams
2017-01-14 12:42 ` Elia Pinto
2017-01-15 2:42 ` Junio C Hamano
2017-01-15 8:13 ` Elia Pinto [this message]
2017-01-14 16:31 ` René Scharfe
2017-01-14 18:08 ` Jeff King
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='CA+EOSB=4-TKpi6mr-yVbwRsFrVzE=vo4Y9Qm3VMm7pn=UB1_hQ@mail.gmail.com' \
--to=gitter.spiros@gmail.com \
--cc=bmwill@google.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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).