Re: git-svn does not seems to work with crlf convertion enabled.
- From
Dmitry Potapov <dpotapov@gmail.com>
- Date
- Aug 6, 2008, 16:11 UTC
- Message-ID
- <37fcd2780808060911g58fbab9ey6188280c8f318854@mail.gmail.com>
- In-Reply-To
- <20080806111545.GD32184@machine.or.cz>
On Wed, Aug 6, 2008 at 3:15 PM, Petr Baudis <pasky@suse.cz> wrote:
Show 5 quoted lines
> > If not, why do you want to drop git-svn from Windows Git? It seems > that the CRLF issue has trivial workaround to set autocrlf=false; > this will make git-svn-tracked repositories useful only on Windows, > but I'd bet this is fine for large majority of Windows git-svn users?
Actually, it is not so simple. If you have svn properties setup correctly for your text files (i.e. svn:eol-style=native) than autocrlf=false is not what you want, because then SVN uses LF as EOL when stores this files.
In many case, just setting svn:eol-style correctly in SVN may solve the problem.
However, to make git-svn work reliable in present files with different ending, it should import files from SVN without applying any filter. Therefore, the --no-filters option was recently added to git-hash-object. Adding its use to git-svn should be easy (I have not had time to test it): ===
diff --git a/perl/Git.pm b/perl/Git.pm index 087d3d0..438b7fd 100644 --- a/perl/Git.pm +++ b/perl/Git.pm @@ -829,7 +829,7 @@ sub _open_hash_and_insert_object_if_needed { ($self->{hash_object_pid}, $self->{hash_object_in}, $self->{hash_object_out}, $self->{hash_object_ctx}) = - command_bidi_pipe(qw(hash-object -w --stdin-paths)); + command_bidi_pipe(qw(hash-object -w --stdin-paths --no-filters)); } sub _close_hash_and_insert_object { === This should solve all problem with git-svn fetch. However, if you want to respect svn:eol-style and when you commit your changes, that will require synchronization svn:eol-style with values for crlf in your .gitattributes, which is a much more ambitious task. Dmitry