Re: [PATCH 2/2] submodule: Tolerate auto/safecrlf when adding .gitmodules
- From
Brad King <brad.king@kitware.com>
- Date
- Jun 20, 2012, 18:06 UTC
- Message-ID
- <4FE21133.2030001@kitware.com>
- In-Reply-To
- <4FE20DD3.6040607@web.de>
On 06/20/2012 01:52 PM, Jens Lehmann wrote:
Show 14 quoted lines
> 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