开发者

Git SVN with binary files

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!


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


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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜