Re: .git/info/exclude w/ CRLF fails in cygwin

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



söndag 09 september 2007 skrev Jing Xue:
> On Sat, Sep 08, 2007 at 12:36:03PM +0200, Robin Rosenberg wrote:
> > 
> > I have cygwin in CRLF mode too, but I have binary-mounted the paths' where
> > I use git to avoid the problem. I did a half-hearted attempt to fix git in CRLF mode,
> > but it failed because in some places plumbing commands communicate via files
> > and in other pipes are used making it hard to get then right translation mode.
> > 
> > That is not to say it is impossible, but as I understand it the Cygwin project have
> > essentially given up on CRLF mode, so it will probably go away as programs get
> > updated and no longer works in translated mode.
> > 
> > Try git in unix mode and, if you need it, use the core.autocrl setting to have git
> > translate explicitly. There are plenty editors that honour line endings in Windows
> > so LF mode works out quite well nowadays (for me, on my machines).
> 
> I realize core.autocrlf evidently works for regular files. Although my
> question was actually just specifically regarding .git/info/exclude. I
> can't be 100% sure, but looking from the source code, git doesn't honor
> core.autocrlf when parsing that file (nor should it have been probably).
> And the fact that .git/info/exclude has this problem while .git/config
> doesn't really smells inconsistent to me here.
Try setting variables with git config --global and see the mess git creates (assuming
your $HOME is in a text-mode path.

I realize I was expanding the problem too much. autocrlf does indeed ignore exclude. It
is meant for the file that are under version control. 

Patches that only fix reading the exludes file will not do (MHO), but I'd vote for patches
that makes git fully work in CRLF mode and does not greese the code much. 

> When working in that (Win+cygwin) environment, I try my best to set all
> of my tools to use LF. But I can never go all the way because 1. some
> win tools simply don't support it, and 2. it makes me the bad apple when
> most of the rest of the team stay with CRLF.

As for the git config files are concerned, the solution is simple. Just editing using an
editor that honours LF line endings. There is even one in standard windows, e.g.
wordpad, or edit with cygwin tools.

Consider the mingw port which may be better at handling these issues. It should
at least. Alternatively there may be patches there that apply to cygwin. Hopefully
the mingw fork will be merged with git some day and CRLF fixes could then be made
to apply to cygwin git too.

> Cheers
Cheers

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

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux