Re: [PATCH v7 00/31] Support multiple checkouts

2014-07-14 Thread Junio C Hamano
Duy Nguyen  writes:

> On Mon, Jul 14, 2014 at 11:45 AM, Junio C Hamano  wrote:
>> Nguyễn Thái Ngọc Duy   writes:
>>
>>>   fd = open(git_path("repos/%s/gitdir", id), O_RDONLY);
>>> ...
>>> - while (path[len - 1] == '\n' || path[len - 1] == '\r')
>>> + while (len && (path[len - 1] == '\n' || path[len - 1] == '\r'))
>>>   len--;
>>
>> Do we anticipate (or even allow/endorse) that end users will edit
>> this file with a random editor?  And, to a lessor degree, the same
>> question on the reading side.  Do we encourage users to directly
>> read from this file to learn something about their repository?
>>
>> If we are the only tool that writes into this file, and if we are
>> the only tool to be used to read (and use) the contents of this
>> file, I do not see the need to cater to LF vs CRLF line endings.
>
> No I don't expect users to go and change these files by themselves.
> But once directory structure is documented, other tools might appear
> and scripts on Windows may just append CRLF by default.

Essentially you are encouraging them to edit this file with a random
editor, bypassing Git, then.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v7 00/31] Support multiple checkouts

2014-07-14 Thread Duy Nguyen
On Mon, Jul 14, 2014 at 11:45 AM, Junio C Hamano  wrote:
> Nguyễn Thái Ngọc Duy   writes:
>
>>   fd = open(git_path("repos/%s/gitdir", id), O_RDONLY);
>> ...
>> - while (path[len - 1] == '\n' || path[len - 1] == '\r')
>> + while (len && (path[len - 1] == '\n' || path[len - 1] == '\r'))
>>   len--;
>
> Do we anticipate (or even allow/endorse) that end users will edit
> this file with a random editor?  And, to a lessor degree, the same
> question on the reading side.  Do we encourage users to directly
> read from this file to learn something about their repository?
>
> If we are the only tool that writes into this file, and if we are
> the only tool to be used to read (and use) the contents of this
> file, I do not see the need to cater to LF vs CRLF line endings.

No I don't expect users to go and change these files by themselves.
But once directory structure is documented, other tools might appear
and scripts on Windows may just append CRLF by default.
-- 
Duy
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v7 00/31] Support multiple checkouts

2014-07-13 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy   writes:

>   fd = open(git_path("repos/%s/gitdir", id), O_RDONLY);
> ...
> - while (path[len - 1] == '\n' || path[len - 1] == '\r')
> + while (len && (path[len - 1] == '\n' || path[len - 1] == '\r'))
>   len--;

Do we anticipate (or even allow/endorse) that end users will edit
this file with a random editor?  And, to a lessor degree, the same
question on the reading side.  Do we encourage users to directly
read from this file to learn something about their repository?

If we are the only tool that writes into this file, and if we are
the only tool to be used to read (and use) the contents of this
file, I do not see the need to cater to LF vs CRLF line endings.

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html