From: Eyvind Bernhardsen <eyvind-git@orakel.ntnu.no>
To: Andrew Arnott <andrewarnott@gmail.com>
Cc: Daniel Barkalow <barkalow@iabervon.org>, git@vger.kernel.org
Subject: Re: Repo corrupted somehow?
Date: Wed, 5 Nov 2008 13:26:59 +0100 [thread overview]
Message-ID: <77005B51-0170-42EC-BBA7-DCF39C7CFC5E@orakel.ntnu.no> (raw)
In-Reply-To: <alpine.LNX.1.00.0811050043030.19665@iabervon.org>
On 5. nov.. 2008, at 06.56, Daniel Barkalow wrote:
> On Tue, 4 Nov 2008, Andrew Arnott wrote:
>
>> It was the CRLF conversion. When I played around with
>> git config --global core.autocrlf true/false
>> I got the problem to eventually go away.
>>
>> Thanks for all your responses.
>
> It's still worth debugging further, because git should know that it
> wrote
> the files differently and not see that as changes. It's not too
> helpful to
> have autocrlf if it causes this problem.
I think I know what this is. If a repository contains files with
CRLFs, those files will show as modified when core.autcorlf is true
(if you commit them, the CRLFs will be converted to CRs in the
repository, so in a sense they _are_ modified). Try turning autocrlf
back on, cloning the repository, then touching all the files (to make
git check them for changes) and see if you get the same problem.
I proposed an alternative autocrlf implementation on the list a while
back: making it an attribute instead of a configuration setting and
adding a configuration setting to tell git which line ending is
preferred when the autocrlf attribute is set.
That would allow you to turn on autocrlf and let git convert all CRLFs
to CRs in a single commit, thus converting a repository with CRLFs to
one that can be used with autocrlf in a versioned way. In theory that
lets you check out new commits with EOL conversion while old commits
will be left alone (avoiding the problem you saw), but
since .gitattributes is read from the working directory and not the
tree to be checked out, it doesn't work perfectly.
I implemented the easy bit (reading autocrlf from .gitattributes), but
for various reasons the patch has just been gathering dust in my
private git.git repo. Maybe I should dust it off :)
--
Eyvind
next prev parent reply other threads:[~2008-11-05 12:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-04 7:09 Repo corrupted somehow? Andrew Arnott
2008-11-04 7:34 ` Andrew Arnott
2008-11-04 15:12 ` Andrew Arnott
2008-11-05 3:29 ` Jeff King
2008-11-05 4:21 ` Daniel Barkalow
[not found] ` <216e54900811042127id69b61fqbd9d001b8bc17a6a@mail.gmail.com>
2008-11-05 5:40 ` Andrew Arnott
2008-11-05 5:56 ` Daniel Barkalow
2008-11-05 12:26 ` Eyvind Bernhardsen [this message]
2008-11-08 15:19 ` Andrew Arnott
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=77005B51-0170-42EC-BBA7-DCF39C7CFC5E@orakel.ntnu.no \
--to=eyvind-git@orakel.ntnu.no \
--cc=andrewarnott@gmail.com \
--cc=barkalow@iabervon.org \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox