git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eyvind Bernhardsen <eyvind.bernhardsen@gmail.com>
To: Will Palmer <wmpalmer@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [BUG?] Fresh clone of jquery.git shows modifications?
Date: Wed, 18 Aug 2010 15:18:26 +0200	[thread overview]
Message-ID: <2F030CF4-995A-4BA2-9D79-DA2A71F9FF79@gmail.com> (raw)
In-Reply-To: <1282135226.24584.92.camel@wpalmer.simply-domain>

On 18. aug. 2010, at 14.40, Will Palmer wrote:

> I am on Linux, and core.autocrlf is not set. .gitattributes in the
> JQuery repository contains:
> * crlf=input

That's a strange setting; in older versions of git, it means something like "if core.autocrlf is enabled, only convert CRLF on input"; that is, it effectively turns core.autocrlf=true into core.autocrlf=input.  I'm not sure why anybody would want that.

In any case, it doesn't appear to have prevented CRLFs from entering the repository, which is what's causing the behaviour you see.

> Bisect reveals:
> fd6cce9e89ab5ac1125a3b5f5611048ad22379e7  v1.7.0-3-gfd6cce9
> Add per-repository eol normalization
> 
> is the first git commit which shows this problem.

That's because from that commit, "crlf=input" turns on autocrlf implicitly (it is equivalent to "eol=lf").  Previously, the crlf attribute would only have an effect with core.autocrlf turned on.

> I am confused as to why I am seeing what I am seeing, though. I was
> under the impression that "crlf=input" meant: "convert crlf to lf on
> input", which I would take to mean that it would never have any effect
> whatsoever on "git status"'s output.

Files containing CRLFs in your repository keep the CRLFs in the working tree.  If you check them in now git will convert CRLF to LF, so they are marked as modified.
 
> If I clone using a version of git before v1.7.0-3-gfd6cce9, then "git
> status" from a newer git, then everything also appears to work normally
> (though I haven't dug much into this aspect)

If you turn on core.autocrlf=input or core.autocrlf=true you should get the same behaviour with older gits as well.  Note that msysgit has had autocrlf enabled by default for years, so no positive action is required to do this.

> Is there a git option for "just give me what's in the repository, don't
> ever perform any conversions, one way or the other, just act sane" ?

Not with that .gitattributes :)  If you don't want conversion, don't set the crlf, eol or text attributes.

> I thought I had finally understood all this autocrlf nonsense, but once
> again I see this as being only an "act stupid mode". I have no idea
> what's going on here, and I just want to be able to rely on the
> following:
> - git clone someproj.git && cd someproj && git status;
>   should NEVER report changes
> - git reset --hard HEAD && git status;
>   should NEVER report changes
> 
> and, why I ran into this situation this time around:
> - git clone someproj.git && cd someproj && git checkout sometag;
>   should ALWAYS work
> 
> Can anyone explain why these aren't valid assertions? If they're not,
> then what is the proper way to tell git "give me a real pristine copy"?

Git _is_ giving you a real pristine copy, it's just informing you that your repository is not consistent with the attributes you have set.

> Below is a log of the problem in-action.

[...]

> #	modified:   build/google-compiler-20091218.jar
> #	modified:   build/js.jar

Heh.  I was about to ask if there was anything funny about these presumably binary files, but then I realized that .gitattributes is forcing crlf=input for _all_ files.  I suggest removing the crlf setting from .gitattributes.

- Eyvind

  reply	other threads:[~2010-08-18 13:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-18 12:40 [BUG?] Fresh clone of jquery.git shows modifications? Will Palmer
2010-08-18 13:18 ` Eyvind Bernhardsen [this message]
2010-08-18 14:14   ` Will Palmer
2010-08-18 15:50     ` Thomas Berg
2010-08-18 16:37       ` Will Palmer
2010-08-18 18:09         ` Eyvind Bernhardsen
2010-08-18 19:19       ` Eyvind Bernhardsen
2010-08-18 19:49         ` Thomas Berg
2010-08-18 18:55     ` Eyvind Bernhardsen

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=2F030CF4-995A-4BA2-9D79-DA2A71F9FF79@gmail.com \
    --to=eyvind.bernhardsen@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=wmpalmer@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).