我正在玩 Adium 源代码,发现他们在 adium-1.4
中有一个未发布的分支,它使用 XMPP 修复了 facebook 聊天集成,名为facebook-xmpp。一切都很好,遵守了它并且有效。
问题是,如果我想在最新的 Adium 1.5 中拥有相同的功能,它的代码大约在两年前从旧版本中分离出来(旧版本的一些变更集不时被移植),我想我' d 必须以某种方式对构成 facebook-xmpp 分支的整个变更集范围进行变基,并将其应用到较新的 adium-1.5 分支的尖端。我认为这可能会起作用,因为 facebook-xmpp 看起来主要添加了新代码,因此它应该可以轻松地与最新的开发代码集成。
然而,由于 facebook-xmpp
分支与 adium-1.4
合并了几次,我发现变基会引入 adium-1.4
的合并更改也到 adium-1.5
上,这会导致很多合并冲突。
--------------------------------------- adium-1.4
| \--- facebook-xmpp (created 1 month ago)
|
\----------------------- adium-1.5
^ sometime in 2009
问题是,有没有办法只将添加到 facebook-xmpp
分支的变更集移植到 adium-1.5
上,不包括与 adium- 合并的变更集1.4 ?
I was playing around with the Adium source code and discovered that they had an unreleased branch in the adium-1.4
that fixes the facebook chat integration by using XMPP, called facebook-xmpp
. All good there, complied it and it works.
Problem is, if I wanted to have the same functionality in the latest Adium 1.5, whose code got split from the older version's about two years ago (with some changesets from the older version being transplanted over from time to time), I figured I'd have to somehow rebase the entire range of changesets that makes up the facebook-xmpp
branch and apply it onto the tip of the newer adium-1.5
branch. I thought this might work since facebook-xmpp
looks like it mostly adds new code, so it should be easily integrated with the newest development code.
However, since facebook-xmpp
branch merged with adium-1.4
several times, I found that rebasing would pull in the merged changes from adium-1.4
onto adium-1.5
as well, which makes for a lot of merge conflicts.
--------------------------------------- adium-1.4
| \--- facebook-xmpp (created 1 month ago)
|
\----------------------- adium-1.5
^ sometime in 2009
Question is, is there a way to transplant onto adium-1.5
only the changesets that added to the facebook-xmpp
branch, excluding the ones that merged with adium-1.4
?
发布评论
评论(1)
方法1(手动补丁)
如果您只想在
audium-1.5
中使用facebook-xmpp
功能,您可以audium-1.4<的提示/code> 进入
facebook-xmpp
,然后audium-1.4
和facebook-xmpp
的提示之间创建差异,并这应该可行,但新补丁与原始开发历史脱节。
基本上这些命令应该可以做到这一点:
方法 2(选择性合并)
另一种解决方案更加尊重历史图,是将 facebook-xmpp 直接合并到audium-1.5 中> 当使用使用
internal:local
作为默认合并工具(到阻止合并工具弹出 1000 次),但会定期合并任何facebook-xmpp
相关文件(如果您知道哪些文件与其功能相关)。然后,在提交合并之前,恢复与 facebook 无关的所有文件。更新:以下是第二个解决方案的一些示例说明。假设 facebook-xmpp 分支创建了一些名为 fb-.c 的新文件,并更改了现有文件
foo.c
和 < code>bar.c (您可以从facebook-xmpp
及其与audium-1.4
的最新合并之间的差异中获取这些文件)。将facebook-xmpp
合并到audium-1.5
时,请使用以下合并工具配置:第一个合并配置确保通常
audium-1.5
更改是保留在audium-1.4
和audium-1.5
中更改的文件。其他配置选项确保对于 facebook-xmpp 分支涉及的任何文件执行常规合并,可能存在需要手动解决的冲突。例如,如果 foo.c 引发冲突,请运行以使用您最喜欢的手动合并工具解决冲突。最后,您必须提交合并,同时不提交源自
audium-1.4
的任何新文件。只需提交 facebook-xmpp 内容即可:Method 1 (manual patch)
If you just want the
facebook-xmpp
functionality to be available inaudium-1.5
, you couldaudium-1.4
intofacebook-xmpp
, thenaudium-1.4
andfacebook-xmpp
andThat should work but the new patch is disconnected from the original development history.
Basically these commands should do it:
Method 2 (selective merge)
Another solution, which shows more respect to the history graph, would be to directly merge
facebook-xmpp
intoaudium-1.5
while using a merge tool configuration that usesinternal:local
as the default merge tool (to stop your merge tool from popping up 1000 times) but that merges regularly for anyfacebook-xmpp
related files (if your know which files are related to its functionality). Then, before committing the merge, revert all files not related to the facebook thing.UPDATE: Here are some example instructions for this second solution. Supposed the
facebook-xmpp
branch created some new files namedfb-<something>.c
and changed the existing filesfoo.c
andbar.c
(you get these files from a diff betweenfacebook-xmpp
and its latest merge withaudium-1.4
). When mergingfacebook-xmpp
intoaudium-1.5
, use the following merge tool configuration:The first merge config ensures that generally
audium-1.5
changes are kept on files changed in bothaudium-1.4
andaudium-1.5
. The other config options ensure that for any files touched by thefacebook-xmpp
branch a regular merge is performed, potentially with conflicts which need to be resolved manually. For instance iffoo.c
raised conflicts, runto resolve the conflicts with your favorite manual merge tool. Finally, you have to commit the merge while not committing any new files originating in
audium-1.4
. Just commit thefacebook-xmpp
stuff: