Re: [PATCH 3/6] branch: teach --edit-description option
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- Sep 25, 2011, 05:21 UTC
- Message-ID
- <CACsJy8BdLKdT-CiBBD1FmnSo3ZBcRQmMst7FN2fmDrgvzqbyng@mail.gmail.com>
- In-Reply-To
- <7v62kjulkf.fsf@alter.siamese.dyndns.org>
On Sat, Sep 24, 2011 at 5:04 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 17 quoted lines
> Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:
>
>> On Thu, Sep 22, 2011 at 03:09:19PM -0700, Junio C Hamano wrote:
>>> + if (launch_editor(git_path(edit_description), &buf, NULL)) {
>>> + strbuf_release(&buf);
>>> + return -1;
>>> + }
>>> + stripspace(&buf, 1);
>>> +
>>> + strbuf_addf(&name, "branch.%s.description", branch_name);
>>> + status = git_config_set(name.buf, buf.buf);
>>
>> I suppose a Windows editor mave save the description with \r\n
>> ending. Perhaps a patch like this to avoid messing up config file?
>
> Doesn't stripspace() cleanse that already?
>Yes, isspace() indeed treats \r as a space and stripspace() does the right thing.
-- Duy