1

Is it possible to set svn:externals property using git svn propset?

I have successfully used git svn propset to set the svn:eol property. However, for svn:externals I am unsure if/how it can be done because svn:externals is a multi-line property, and I'm not sure if/how multiple lines of the property value may be expressed on the command line.

For svn:externals, it would be ideal if the git svn propset command had an --edit option, which would allow the property to be edited in the text editor (similar to editing commit text or git config).

I'm using git version 2.11.1 on Windows.

1 Answer 1

1

If you are using Git Bash, just enclose the argument in question in quotes like

git svn propset svn:externals "foo
bar" baz/bam
Sign up to request clarification or add additional context in comments.

3 Comments

I tried it, but when I did git svn dcommit I got errors of the form <my-extern-name> is not a valid attribute name: src/.gitattributes:1 (one line for each extern reference). So it looks as though multi-line SVN properties just cannot be set.
I looked at the .gitattributes file, and it looks as though there's a small chance it might be remedied by manually editing it to add quotes around the svn-properties=svn:externals= value. I'll try it next time I'm wanting to update svn:externals. But that would be a work-around; it looks as though it's worth reporting this issue to the git mailing list.
How about adding quotes in the command like (replace \n by newline, comments cannot display newlines) git svn propset svn:externals "'foo\nbar'" baz/bam or git svn propset svn:externals '"foo\nbar"' baz/bam. You might even be able to do (do not replace the \n this time) git svn propset svn:externals $'"foo\nbar"' baz/bam, but I didn't try this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.