From: "Avery Pennarun" <apenwarr@gmail.com>
To: "Steffen Prohaska" <prohaska@zib.de>
Cc: "Eyvind Bernhardsen" <eyvind-git@orakel.ntnu.no>,
"Dmitry Potapov" <dpotapov@gmail.com>,
"Johannes Schindelin" <Johannes.Schindelin@gmx.de>,
"Joshua Jensen" <jjensen@workspacewhiz.com>,
"Junio C Hamano" <gitster@pobox.com>,
git@vger.kernel.org
Subject: Re: [PATCH] Respect crlf attribute even if core.autocrlf has not been set
Date: Wed, 30 Jul 2008 14:33:51 -0400 [thread overview]
Message-ID: <32541b130807301133w4bfc8288oa2d15911b2317dca@mail.gmail.com> (raw)
In-Reply-To: <80518F08-A9A9-4190-9AC4-D24DD6A1188B@zib.de>
On 7/30/08, Steffen Prohaska <prohaska@zib.de> wrote:
> On Jul 29, 2008, at 11:17 PM, Eyvind Bernhardsen wrote:
> > I think the real penalty is that with autocrlf enabled, Git no longer
> > stores exactly what I committed.
>
> Git does *never* exactly store what you committed. Git compresses
> your data and creates packs containing many of your individual
> files in a single pack.
This is not really an argument; making perfectly reversible changes as
part of the storage process, then reversing them as part of the
retrieval process, doesn't count as not storing what I committed.
> What matters is that git gives you exactly back what you committed. It
> does so with core.autocrlf=true, unless you check out with a different
> setting for autocrlf.
You can tell that this statement isn't quite true because if you have
a file with mixed LF and CRLF line endings, which I do (thanks,
Windows!) then CRLF->LF conversion is not a reversible operation.
Interestingly LF->CRLF still is (because an LF->CRLF'd file will never
have a bare LF, and on such a subset of files, CRLF->LF is
reversible).
Also note that core.autocrlf=input is *definitely* not a perfectly
reversible operation.
And so here's the problem: svn hands you a file. It may or may not
have CRLFs in it, and the line endings may actually be a random mix of
LF and CRLF, as I am actually experiencing at the moment in a
particular repository at work. If core.autocrlf is anything other
than "false", git will modify the file, and git-svn won't be apply the
diff on the next revision.
It's conceivable that core.autocrlf=true will work if your svn
repository is pure and svn hands you files only with CRLF endings.
It's somewhat unlikely that most svn repositories are in that state
(remember: it has to be perfect in *every revision* for git-svn to
work).
So anyway, I can't see how git-svn can possibly work in the general
case if core.autocrlf is anything other than false *at git-svn fetch
time*. And that's what I do, and it works great, modulo a bunch of
stupid CRLFs that sneak into the repo via svn, but those can be fixed.
Someday we'll stop using svn, and git-filter-branch can fix them all
retroactively so that "blame" will work right.
Perhaps git-svn needs to actually ignore the core.autocrlf setting?
Have fun,
Avery
next prev parent reply other threads:[~2008-07-30 18:35 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-22 21:56 [PATCH] Respect crlf attribute even if core.autocrlf has not been set Johannes Schindelin
2008-07-22 23:11 ` Dmitry Potapov
2008-07-22 23:23 ` Johannes Schindelin
2008-07-23 0:14 ` Dmitry Potapov
2008-07-23 0:12 ` Junio C Hamano
2008-07-23 1:10 ` Johannes Schindelin
2008-07-23 1:31 ` [PATCH] Respect crlf attribute in "git add" " Johannes Schindelin
2008-07-23 5:49 ` Steffen Prohaska
2008-07-23 9:02 ` Johannes Schindelin
2008-07-23 11:40 ` Dmitry Potapov
2008-07-24 6:06 ` Steffen Prohaska
2008-07-24 12:39 ` Johannes Schindelin
2008-07-24 17:05 ` Dmitry Potapov
2008-07-24 14:09 ` Dmitry Potapov
2008-07-24 14:38 ` Johannes Schindelin
2008-07-24 14:52 ` Steffen Prohaska
2008-07-24 16:44 ` Avery Pennarun
2008-07-24 16:45 ` Johannes Schindelin
2008-07-24 20:44 ` Robin Rosenberg
2008-07-24 23:58 ` Johannes Schindelin
2008-07-23 17:07 ` [PATCH] Respect crlf attribute " Junio C Hamano
2008-07-23 17:22 ` Johannes Schindelin
2008-07-23 18:04 ` Joshua Jensen
2008-07-23 18:33 ` Avery Pennarun
2008-07-23 18:57 ` Johannes Schindelin
2008-07-23 19:20 ` Eyvind Bernhardsen
2008-07-23 19:44 ` Johannes Schindelin
2008-07-24 21:30 ` Eyvind Bernhardsen
2008-07-25 0:01 ` Johannes Schindelin
2008-07-25 12:30 ` Eyvind Bernhardsen
2008-07-25 14:01 ` Dmitry Potapov
2008-07-25 21:05 ` Eyvind Bernhardsen
2008-07-26 2:09 ` Johannes Schindelin
2008-07-29 19:11 ` Eyvind Bernhardsen
2008-07-29 13:46 ` Dmitry Potapov
2008-07-29 21:17 ` Eyvind Bernhardsen
2008-07-30 5:35 ` Steffen Prohaska
2008-07-30 18:33 ` Avery Pennarun [this message]
2008-07-30 19:25 ` Steffen Prohaska
2008-07-30 21:07 ` Avery Pennarun
2008-07-30 22:02 ` Dmitry Potapov
2008-07-30 22:14 ` Avery Pennarun
2008-08-03 16:54 ` Tarmigan
2008-08-03 17:33 ` Dmitry Potapov
2008-08-03 18:54 ` Tarmigan
2008-08-04 16:06 ` Dmitry Potapov
2008-07-30 21:45 ` Dmitry Potapov
2008-08-02 12:51 ` Eyvind Bernhardsen
2008-08-03 16:21 ` Dmitry Potapov
2008-07-23 19:22 ` Robin Rosenberg
2008-07-23 19:35 ` Junio C Hamano
2008-07-23 19:41 ` Johannes Schindelin
2008-07-23 19:33 ` Dmitry Potapov
2008-07-23 19:23 ` Junio C Hamano
2008-07-23 20:07 ` Johannes Schindelin
2008-07-24 16:53 ` Dmitry Potapov
2008-07-24 17:14 ` Johannes Schindelin
2008-07-24 17:55 ` Dmitry Potapov
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=32541b130807301133w4bfc8288oa2d15911b2317dca@mail.gmail.com \
--to=apenwarr@gmail.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=dpotapov@gmail.com \
--cc=eyvind-git@orakel.ntnu.no \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jjensen@workspacewhiz.com \
--cc=prohaska@zib.de \
/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).