From: Dmitry Potapov <dpotapov@gmail.com>
To: Jeff King <peff@github.com>
Cc: git@vger.kernel.org, Mislav Marohnic <mislav@github.com>
Subject: Re: [RFH] eol=lf on existing mixed line-ending files
Date: Sun, 10 Apr 2011 00:09:38 +0400 [thread overview]
Message-ID: <BANLkTi=qBeT=09YFng1gyt+SuN2v0g+kDg@mail.gmail.com> (raw)
In-Reply-To: <20110409192941.GB31579@sigill.intra.peff.net>
On Sat, Apr 9, 2011 at 11:32 PM, Jeff King <peff@github.com> wrote:
>
> I just wonder if git can do better. But the only options I could think
> of are:
>
> 1. Set the working tree file to have just LF's. But that doesn't help,
> since it is the conversion _to_ linefeeds that make it look like
> the file is changed. So we'd still see unstaged changes.
Well, eol=crlf _does_ set the working tree file to have only CRLF, but
you still have the same race as before. Just because git converts file,
it does not think about it as "dirty". It becomes "dirty" when git
tries to convert it back and gets a different result, and whether it
tries or not depend on timestamp. So, you still have the same race.
>> > So we get two different outcomes, depending on the index raciness. Which
>> > one is right, or is it right for it to be non-deterministic?
>>
>> I like everything being deterministic, but in this case I do not see
>> how it is possible without making the normal case much slower.
>
> I think if you took my (1) suggestion above, it would be deterministic.
Replace "eol=lf" with "eol=crlf" in your script, and you will see that
it does not help with the race.
>
> I absolutely agree, and my first advice upon seeing this jquery repo was
> to fix those line endings. But they went for over a year with the broken
> setup, so clearly it wasn't bothering them. I wonder what git could do
> better to provoke them to fix it sooner.
I believe git should consider all files as "dirty" if .gitattributes is
changed. So, you cannot accidentally commit changes to .gitattributes
without fixing line endings. Currently, you can provoke git to consider
all files as dirty by doing:
touch -d 2000-1-1 .git/index
but we should not expect users to do that after editing .gitattributes.
Dmitry
next prev parent reply other threads:[~2011-04-09 20:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-07 23:15 [RFH] eol=lf on existing mixed line-ending files Jeff King
2011-04-08 9:36 ` Michael J Gruber
2011-04-08 16:06 ` Jeff King
2011-04-09 18:58 ` Dmitry Potapov
2011-04-09 19:32 ` Jeff King
2011-04-09 20:09 ` Dmitry Potapov [this message]
2011-04-12 13:57 ` Jay Soffian
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='BANLkTi=qBeT=09YFng1gyt+SuN2v0g+kDg@mail.gmail.com' \
--to=dpotapov@gmail.com \
--cc=git@vger.kernel.org \
--cc=mislav@github.com \
--cc=peff@github.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).