Subject: Re: [PATCH 2/2] submodule: Tolerate auto/safecrlf when adding .gitmodules

From: Brad King <[email-masked]>
Date: Wed, 20 Jun 2012 14:06:43 -0400

On 06/20/2012 01:52 PM, Jens Lehmann wrote:
> Am 20.06.2012 16:43, schrieb Brad King:
>> Temporarily disable 'core.safecrlf' to add '.gitmodules' so that
>> 'git add' does not reject the LF newlines we write to the file
>> even if both 'core.autocrlf' and 'core.safecrlf' are enabled.
>> This fixes known breakage tested in t7400-submodule-basic.
> 
> Hmm, I have no objections against the intention of the patch. But
> as I understand it this message will reoccur when the user e.g.
> edits the .gitmodules file later with any editor who just writes
> lfs and adds it.
> 
> I don't know terribly much about crlf support but maybe flagging
> the .gitmodules file in .gitattributes would be a better solution
> here? Opinions?

Once a user edits the file with an outside tool it is his/her
responsibility to add .gitattributes for the file.  In the reported
case Git is creating the file and already knows the crlf mode when
creating it.

I think Junio's proposal to teach "git config" to respect crlf
configuration is a more general solution.

-Brad