How to adjust SVN settings to convert line endlings on Windows?
Asked Answered
H

3

10

I need to use SVN on Windows and would like to set it up such that line endings are always checked out in Windows style and always committed in Unix style, regardless which repository is used.

  1. Is this possible or will I have to write a configuration file for each repo?

    If I have to write a config file to each repo, where do I put it, what's the right filename, what goes into the file and what effect will it have on other users of the repo?

  2. I made the following changes to the global SVN config file but it had no effect. What else do I need to do? Or will I have to call SVN with some specific parameters for changes to take effect on Windows?

    enable-auto-props = yes
    [auto-props]
    *.c = svn:eol-style=native
    *.cpp = svn:eol-style=native
    *.cxx = svn:eol-style=native
    *.h = svn:eol-style=native
    *.hpp = svn:eol-style=native
    *.hxx = svn:eol-style=native
    *.txt = svn:eol-style=native
    *.tex = svn:eol-style=native
    *.bib = svn:eol-style=native
    
Hallel answered 15/4, 2012 at 17:0 Comment(0)
G
14

You need to set the svn:eol-style property to native for all files in the repository. Autoprops will set the property for files newly added to a repository, but for existing files, you need to add the property manually:

svn propset svn:eol-style native example.c
svn commit
Gerry answered 15/4, 2012 at 17:8 Comment(3)
Thanks for clarifying the difference between existing and newly added files! This solution is specific to the repository and the file type. Is there no way to tell subversion to always do it, regardless of the settings of the repo and regardless of the file type (as long as it's not binary)?Hallel
I don't know such an option, no. But since the properties are tracked as part of the repository, other people checking out the code will get them too and have the line endings converted correctly, without having to configure their Subversion client in a special way.Gerry
Along the same linesHallel
C
1

Daniel Roethisberger already gave you the correct answer. However you might want someway to ensure that all files have svn:eol-style set to `native.

I have a pre-commit hook that can ensure that the svn:eol-style property is set to native on all relevant files before it will allow a commit to take place. You might want to take a look at it to ensure that your policy is followed.

Cocaine answered 15/4, 2012 at 21:37 Comment(1)
Your link to "pre-commit hook" matches the "correct answer" link. Did you mean to post something else? Maybe it didn't properly copy to your clipboard.Habitat
M
-3

This command line android tool worked for me:

cd <install_dir>/adt-bundle-mac-x86_64-20140702/sdk/tools
./android list target 

Make sure you pick a target listed above for the --target switch below.

./android create project --target 1 --name MyFirstApp \
  --path ~/projects/android/MyFirstApp --activity MainActivity \
  --package com.example.myfirstapp

This is documented at https://developer.android.com/training/basics/firstapp/creating-project.html

Then open eclipse and import the project created above.

Mayamayakovski answered 23/7, 2014 at 18:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.