git-svn能正确填充svn:mergeinfo属性吗? [英] Can git-svn correctly populate svn:mergeinfo properties?

查看:247
本文介绍了git-svn能正确填充svn:mergeinfo属性吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在评估git-svn并试图确定它将如何与特定的svn存储库一起玩。我主要关心的是让git-svn以这样的方式执行合并,即在subversion回购中正确设置svn:mergeinfo属性。这是可能的吗?



这是我迄今为止所做的:

 #检出SVN回购。 
$ git svn clone svn:// server / project1 -T trunk -b branches -t tags

#确保我们正在使用trunk。
$ git reset --hard remotes / trunk

#修改工作副本。
$ vim file.txt

#本地提交到git仓库。
$ git commit -a

#将提交推回到SVN服务器。
$ git svn dcommit
承诺svn:// server / project1 / trunk ...
M file.txt
提交r178
M file.txt
R178 = b6e4a3a0c28e7b9aa71d8058d96dcfe7c8a2b349(主干)

现在我将如何去合并该特定提交到的一个颠覆分支?同样,对于我来说git在提交更改时正确地设置svn:mergeinfo属性是非常重要的。

解决方案

即使这这是一个古老的问题,git-svn的事态发生了变化,因为它被问到了。具体来说,在git 1.7.5中,当dcommitting返回svn时,有一些设置svn:mergeinfo的支持。



git svn dcommit 现在接受 -mergeinfo =< mergeinfo> 标志。引用 1.7.5+手册页

< blockquote>

-mergeinfo =< mergeinfo>


在dcommit期间添加给定的合并信息(例如 - 合并信息= /分支/富:1-10)。所有的svn服务器版本都可以存储这些信息(作为一个属性),从1.5版开始的svn客户端可以使用它。



一个人应该非常小心当使用这个虽然。即使手册页上说添加它的真正含义是替换。也就是说,根据传递的内容设置 svn:mergeinfo 属性,它不会将指定的修订添加到已存在的 svn:mergeinfo 。从我的错误中学习......

编辑:



看来他们还在努力进一步改进。从 git-svn 1.7.7 开始,以下文本是添加到git-svn手册页:
$ b



配置密钥:svn.pushmergeinfo


如果可能,此选项将导致git-svn尝试自动填充SVN存储库中的svn:mergeinfo属性。目前,这只能在dcommitting非快进合并的情况下完成,其中第一个父母已经被推入SVN。


I am evaluating git-svn and trying to determine how well it will play with a particular svn repository. I am mostly concerned with getting git-svn to perform merges in such a way that the svn:mergeinfo property is correctly set in the subversion repo. Is this possible?

Here is what I have done so far:

# Checkout the SVN repo.
$ git svn clone svn://server/project1 -T trunk -b branches -t tags

# Make sure we are working on trunk.
$ git reset --hard remotes/trunk

# Modify the working copy.
$ vim file.txt

# Commit locally to the git repo.
$ git commit -a

# Push the commits back to the SVN server.
$ git svn dcommit
Committing to svn://server/project1/trunk ...
    M   file.txt
Committed r178
    M   file.txt
r178 = b6e4a3a0c28e7b9aa71d8058d96dcfe7c8a2b349 (trunk)

Now how would I go about merging that particular commit into one of the subversion branches? Again, it is very important to me that git properly set the svn:mergeinfo property when committing the change.

解决方案

Even though this is an old question, the current state of affairs with git-svn has changed since it was asked. Specifically, in git 1.7.5, there is some limited support for setting the svn:mergeinfo when dcommitting back to svn.

git svn dcommit now accepts the -mergeinfo=<mergeinfo> flag. To quote from the 1.7.5+ man page:

-mergeinfo=<mergeinfo>

Add the given merge information during the dcommit (e.g. --mergeinfo="/branches/foo:1-10"). All svn server versions can store this information (as a property), and svn clients starting from version 1.5 can make use of it. git svn currently does not use it and does not set it automatically.

One should be very careful when using this though. Even though the man page says "add" what it really means is "replace". That is, the svn:mergeinfo attribute is set based on what is passed, it does not add the specified revisions to the already existing svn:mergeinfo. Learn from my mistake…

Edit:

It appears that they are still working on improving this even further. As of git-svn 1.7.7, the following text was added to the git-svn man page:

config key: svn.pushmergeinfo

This option will cause git-svn to attempt to automatically populate the svn:mergeinfo property in the SVN repository when possible. Currently, this can only be done when dcommitting non-fast-forward merges where all parents but the first have already been pushed into SVN.

这篇关于git-svn能正确填充svn:mergeinfo属性吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆