* git status internals and line endings
@ 2009-11-12 20:32 Marc Strapetz
2009-11-13 0:15 ` Jeff King
0 siblings, 1 reply; 6+ messages in thread
From: Marc Strapetz @ 2009-11-12 20:32 UTC (permalink / raw)
To: git
I'm trying to figure out under which circumstances changes in line
endings are resulting in 'modified' status (resp. will be committed). I
have three files with the same content, differing only in line endings:
- file1 is committed with CRLF and has LF in working tree
- file2 is committed with CRLF and has CRLF in working tree
- file3 is committed with LF and has CRLF in working tree
On Linux, file1 and file3 are reported as modified -- as I would expect.
The surprise is on Windows: here only file1 is reported as modified. Why
not file3? Btw, 'git hash-object file3' reports the same SHA as for the
LF-only content in the repository (not so on Linux, as expected).
Is this some special handling on Windows (and possibly on Mac OS)? In
this case, can someone please point me to the corresponding code part?
Thanks for any comments regarding this topic.
--
Best regards,
Marc Strapetz
=============
syntevo GmbH
http://www.syntevo.com
http://blog.syntevo.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: git status internals and line endings
2009-11-12 20:32 git status internals and line endings Marc Strapetz
@ 2009-11-13 0:15 ` Jeff King
2009-11-13 8:08 ` Marc Strapetz
0 siblings, 1 reply; 6+ messages in thread
From: Jeff King @ 2009-11-13 0:15 UTC (permalink / raw)
To: Marc Strapetz; +Cc: git
On Thu, Nov 12, 2009 at 09:32:14PM +0100, Marc Strapetz wrote:
> On Linux, file1 and file3 are reported as modified -- as I would expect.
> The surprise is on Windows: here only file1 is reported as modified. Why
> not file3? Btw, 'git hash-object file3' reports the same SHA as for the
> LF-only content in the repository (not so on Linux, as expected).
>
> Is this some special handling on Windows (and possibly on Mac OS)? In
> this case, can someone please point me to the corresponding code part?
> Thanks for any comments regarding this topic.
Sounds like the core.autocrlf setting (see "git help config"), which I
believe is set by default on Windows.
-Peff
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: git status internals and line endings
2009-11-13 0:15 ` Jeff King
@ 2009-11-13 8:08 ` Marc Strapetz
2009-11-13 9:04 ` Erik Faye-Lund
2009-11-13 9:40 ` Peter Krefting
0 siblings, 2 replies; 6+ messages in thread
From: Marc Strapetz @ 2009-11-13 8:08 UTC (permalink / raw)
To: Jeff King; +Cc: git
> Sounds like the core.autocrlf setting (see "git help config"), which I
> believe is set by default on Windows.
I have checked both $GIT_DIR/config and ~/.gitconfig and autocrlf has
not been set. I have then set autocrlf = false for the Windows
repository and still the file didn't show up as modified. On Linux, I've
added autocrlf = true (resp. autocrlf = input) for the repository and
still the file shows up as modified. Not that I don't like this
behavior, but I don't understand it :) Windows Git version is 1.6.5.1,
Linux version is 1.6.3.3.
--
Best regards,
Marc Strapetz
=============
syntevo GmbH
http://www.syntevo.com
http://blog.syntevo.com
Jeff King wrote:
> On Thu, Nov 12, 2009 at 09:32:14PM +0100, Marc Strapetz wrote:
>
>> On Linux, file1 and file3 are reported as modified -- as I would expect.
>> The surprise is on Windows: here only file1 is reported as modified. Why
>> not file3? Btw, 'git hash-object file3' reports the same SHA as for the
>> LF-only content in the repository (not so on Linux, as expected).
>>
>> Is this some special handling on Windows (and possibly on Mac OS)? In
>> this case, can someone please point me to the corresponding code part?
>> Thanks for any comments regarding this topic.
>
> Sounds like the core.autocrlf setting (see "git help config"), which I
> believe is set by default on Windows.
>
> -Peff
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: git status internals and line endings
2009-11-13 8:08 ` Marc Strapetz
@ 2009-11-13 9:04 ` Erik Faye-Lund
2009-11-13 11:01 ` Marc Strapetz
2009-11-13 9:40 ` Peter Krefting
1 sibling, 1 reply; 6+ messages in thread
From: Erik Faye-Lund @ 2009-11-13 9:04 UTC (permalink / raw)
To: Marc Strapetz; +Cc: Jeff King, git
On Fri, Nov 13, 2009 at 9:08 AM, Marc Strapetz
<marc.strapetz@syntevo.com> wrote:
>> Sounds like the core.autocrlf setting (see "git help config"), which I
>> believe is set by default on Windows.
>
> I have checked both $GIT_DIR/config and ~/.gitconfig and autocrlf has
> not been set. I have then set autocrlf = false for the Windows
> repository and still the file didn't show up as modified. On Linux, I've
> added autocrlf = true (resp. autocrlf = input) for the repository and
> still the file shows up as modified. Not that I don't like this
> behavior, but I don't understand it :) Windows Git version is 1.6.5.1,
> Linux version is 1.6.3.3.
>
In order to make changes to core.autocrlf effective, you need to
delete .git/index and perform a hard reset:
$ rm .git/index
$ git reset --hard
Did you do this before checking if the files were modified?
--
Erik "kusma" Faye-Lund
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: git status internals and line endings
2009-11-13 8:08 ` Marc Strapetz
2009-11-13 9:04 ` Erik Faye-Lund
@ 2009-11-13 9:40 ` Peter Krefting
1 sibling, 0 replies; 6+ messages in thread
From: Peter Krefting @ 2009-11-13 9:40 UTC (permalink / raw)
To: Marc Strapetz; +Cc: Jeff King, Git Mailing List
Marc Strapetz:
>> Sounds like the core.autocrlf setting (see "git help config"), which I
>> believe is set by default on Windows.
> I have checked both $GIT_DIR/config and ~/.gitconfig and autocrlf has not
> been set.
It is usually set by default by the installer. Look at
%INSTALLDIR%\etc\gitconfig, it should contain
[core]
autoCRLF = true
among other things.
--
\\// Peter - http://www.softwolves.pp.se/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: git status internals and line endings
2009-11-13 9:04 ` Erik Faye-Lund
@ 2009-11-13 11:01 ` Marc Strapetz
0 siblings, 0 replies; 6+ messages in thread
From: Marc Strapetz @ 2009-11-13 11:01 UTC (permalink / raw)
To: kusmabite; +Cc: Jeff King, git
> In order to make changes to core.autocrlf effective, you need to
> delete .git/index and perform a hard reset:
> $ rm .git/index
> $ git reset --hard
This solved my problem. Thank you!
--
Best regards,
Marc Strapetz
=============
syntevo GmbH
http://www.syntevo.com
http://blog.syntevo.com
Erik Faye-Lund wrote:
> On Fri, Nov 13, 2009 at 9:08 AM, Marc Strapetz
> <marc.strapetz@syntevo.com> wrote:
>>> Sounds like the core.autocrlf setting (see "git help config"), which I
>>> believe is set by default on Windows.
>> I have checked both $GIT_DIR/config and ~/.gitconfig and autocrlf has
>> not been set. I have then set autocrlf = false for the Windows
>> repository and still the file didn't show up as modified. On Linux, I've
>> added autocrlf = true (resp. autocrlf = input) for the repository and
>> still the file shows up as modified. Not that I don't like this
>> behavior, but I don't understand it :) Windows Git version is 1.6.5.1,
>> Linux version is 1.6.3.3.
>>
>
> In order to make changes to core.autocrlf effective, you need to
> delete .git/index and perform a hard reset:
> $ rm .git/index
> $ git reset --hard
>
> Did you do this before checking if the files were modified?
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-11-13 11:01 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-12 20:32 git status internals and line endings Marc Strapetz
2009-11-13 0:15 ` Jeff King
2009-11-13 8:08 ` Marc Strapetz
2009-11-13 9:04 ` Erik Faye-Lund
2009-11-13 11:01 ` Marc Strapetz
2009-11-13 9:40 ` Peter Krefting
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox