Re: [PATCH 10/14] pull: set reflog message
- From
Paul Tan <pyokagan@gmail.com>
- Date
- May 21, 2015, 10:08 UTC
- Message-ID
- <CACRoPnRJH9QiouDHQasa515X6ECGZpRNfhnTGrJi8SyKt0ZWBQ@mail.gmail.com>
- In-Reply-To
- <xmqqmw11a6yk.fsf@gitster.dls.corp.google.com>
On Tue, May 19, 2015 at 5:53 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 13 quoted lines
> Yeah, either that, or "insert separator only before adding to
> something else" pattern, i.e.
>
> for (i = 0; i < argc; i++) {
> if (i)
> addch(&msg, ' ');
> addstr(&msg, argv[i]);
> }
>
> Both are easier to read than "always append SP and trim at the end".
> Besides, trimming at the end makes readers wonder if there are cases
> where argv[argc-1] ends with whitespaces and the code on purpose
> removes them.Yeah, this looks better and is more correct.
Thanks, Paul