Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can git-svn be made to handle CRLF like native subversion clients?

I have a subversion repository hosted on Linux but only ever accessed via windows clients as it's for the source of a large Windows application.

It would be awesome if I could work on this repository using git-svn (provided by msysgit).

I'm having a heck of a time trying to get the repository to not get itself in a jam over the windows style line endings.

After svn clone a checkout of the git repository with:

  • core.autocrlf = true shows modifications to any file which actually does use LF in the repository.
  • core.autocrlf = input shows modifications to any file which actually does use LF in the repository.
  • core.autocrlf = false shows modifications to everything.

What's the best option here? Should I use core.autocrlf = true and commit the LF to CRLF changes for affected files?

I'm very close to throwing in the towel and just putting my Subversion working copy into a git repository. This would be a poor solution but would at least allow local branches and stashes. It will obviously become a huge pain to keep adding files when they are added to subversion.

EDIT: For those who are interested. git-svn is a royal pain if you are on Windows. hasen j's answer below is probably the right one but I can't follow his advice without attracting the ire of the other developers in my team.

I'm essentially abandoning this question since it isn't going to lead to a reasonable outcome. Hopefully the next Google Summer of Code will attract someone who wants to pickup their "Proper git-svn support on Windows" project. See http://git.or.cz/gitwiki/SoC2009Ideas#Propergit-svnsupportonWindows

like image 540
toholio Avatar asked Jul 01 '09 01:07

toholio


People also ask

Is SVN same as Subversion?

SVN stands for Subversion. So, SVN and Subversion are the same. SVN is used to manage and track changes to code and assets across projects.

What is the use of Git SVN?

What is Git-SVN? The git-svn tool is an interface between a local Git repository and a remote SVN repository. Git-svn lets developers write code and create commits locally with Git, then push them up to a central SVN repository with svn commit-style behavior.

What is diff between SVN & Git?

The difference between Git and SVN version control systems is that Git is a distributed version control system, whereas SVN is a centralized version control system. Git uses multiple repositories including a centralized repository and server, as well as some local repositories.

What are the advantages of SVN?

SVN also enables you to quickly retrieve versions of a code repository through the checkout process. While SVN doesn't support nested repositories, you can still retrieve and combine changes found in multiple code repositories into one working copy of the code using the command svn:externals.


1 Answers

Do yourself a favor and don't mess with line-endings, keep them as-is. set autocrlf to false.

Any half-decent text editor in windows should be able to handle unix-style line endings.

core.autocrlf = false shows modifications to everything.

I think that if you only do that after the fact, it won't do you any good.

You have to delete this repository, set autocrlf to false, and then do the clone.

like image 79
hasen Avatar answered Oct 14 '22 03:10

hasen