Re: [PATCH] Respect crlf attribute in "git add" even if core.autocrlf has not been set
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jul 24, 2008, 16:45 UTC
- Message-ID
- <alpine.DEB.1.00.0807241742220.8986@racer>
- In-Reply-To
- <465DE5CD-DA13-42B4-B0D8-961F3D118F59@zib.de>
Hi,
On Thu, 24 Jul 2008, Steffen Prohaska wrote:
Show 21 quoted lines
> On Jul 24, 2008, at 4:38 PM, Johannes Schindelin wrote: > > >On Thu, 24 Jul 2008, Dmitry Potapov wrote: > > > > >On Thu, Jul 24, 2008 at 08:06:29AM +0200, Steffen Prohaska wrote: > > > > > > > > I am the maintainer of this project. I know that this project > > > > needs crlf conversion, because it is a cross-platform project. > > > > Therefore, I want to force crlf conversion for this specific > > > > project, even if the user did not configure core.autocrlf=input on > > > > Unix. > > > > > >I suspect that most problems with crlf is caused by Windows users who > > >have core.autocrlf=false for whatever reason (I suspect without a > > >good reason in most cases). > > > >Almost correct. It is _unset_! And it should be perfectly valid for > >users not having to set anything there. > > Why is it unset? Since 1.5.5, our installer sets core.autocrlf=true > on Windows. So we *do* set a sane default for Windows users.
As I mentioned earlier, these users use Cygwin's Git. And they do not update frequently.
Show 5 quoted lines
> In the projects I am using git, the problematic platform is *Unix*. To > work around the default on Unix (core.autocrlf=false), I deliver a > custom script to our developers that verifies the setup on Unix and > complains if core.autocrlf is not set to "input". Since I do this, I > haven't seen any further problems.
That is exactly the use case I had in mind for my patch. If we already bother to mark the files with crlf=input in .gitattributes, then Git could be so nice to respect it.
However, I see Junio's point: on sane platforms you have to work hard to get CR-damaged files. And the regular sane platform user should not be punished for the brain/CR damage a certain monopolist has brought over this planet.
Ciao, Dscho