6

When using git-svn and dcommiting binary files (images and JAR files) there is one difference: Images are treated as binary in SVN too if they are initally committed via SVN. Neither JAR files nor new images added to git then dcommitted to SVN does have any Svn Property like svn:mime-type.

This causes, repository viewer like Fisheye will handle these files as text-files and will create non-sense changeset diffs for them.. I expect there will be other problems on merging too.

Is there a simple but user friendly way to automatically set the correct mime-type for correct binary file handling?

I know, i know, there will be users who will say: WHY DO YOU TRACK JAR files in SVN? USe Nexus and Maven....YES, You're right, but JAR files are just one of the examples. The main problems relates to images!

2 Answers 2

5

Looks like you can set an [auto-props] in your subversion config that git will pick up on. Go to http://trac.webkit.org/wiki/UsingGitWithWebKit and look at the section titled Misc. Tips and Tricks

Looks like you can add something like:

[miscellany] enable-auto-props = yes # Add an additonal line for each type of binary file you wish to commit. [auto-props] *.jpg = svn:mime-type=image/jpeg 

to your ~/.subversion/config

Sign up to request clarification or add additional context in comments.

4 Comments

Author is using git svn, not svn. Doesn't help.
Create a ./~subversion/config file? It looks like git will look at it.
Note that on Windows you may have two config files in %APPDATA%\Subversion\config and %USERPROFILE%\.subversion\config - you should make sure that they're both the same.
FWIW: It really works for me after having applied the above changes in ~/.subversion/config
2

Unfortunately, git-svn can't set the required property svn:mime-type.

We ignore all SVN properties except svn:executable. Any unhandled properties are logged to $GIT_DIR/svn//unhandled.log

You could create a post-commit (or even pre-commit?) hook that corrects this, but that's probably overkill?

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.