来自本地参考的 CVS 补丁

发布于 2024-08-02 22:55:24 字数 260 浏览 1 评论 0原文

这是我的情况...

我正在开发一个项目,但无权提交到 CVS 存储库。相反,我必须创建并提交补丁。

然而,有时我需要与其他开发人员共享代码,他们向我发送我需要应用的他们自己的补丁...但是当需要生成我自己的补丁时,它也包含他们的代码,而我不这样做想要那个!

有没有办法使用 CVS 从存储库以外的引用生成补丁?这样我就可以检查该项目两次,对它们应用补丁并比较它们以检索我自己的修改......

或者有人有更好的主意吗?

谢谢!

Here's my situation...

I'm working on a project and don't have rights to commit to the CVS repository. Instead I have to create and submit patches.

However, sometimes I need to share code with other developers and they send me patches of their own that I need to apply... but then when comes the time to generate my own patch, it includes their code as well and I don't want that!

Is there a way with CVS to generate a patch from a reference other than the repository? This way I could checkout the project twice, apply patches to both of them and compare them to retreive my own modifications...

OR has anyone got a better idea then that?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

最美不过初阳 2024-08-09 22:55:24

您可以通过检查 3 个版本来模拟分支,并根据需要在它们之间应用补丁,其中一个仅包含您的更改,一个仅包含其他开发者补丁,最后一个可以包含两个补丁以进行测试。仅从第一次结帐时生成补丁,它们将是干净的。

更好的选择是获得对特定分支进行提交的许可,并根据需要应用其他开发人员的补丁。

更好的可能是在本地实现您自己的版本控制,您可以根据自己的喜好进行分支和合并,并且仅在准备好时才创建用于共享的补丁。

You could simulate branching by checking out 3 versions, and applying patches between them as needed, keeping one with just your changes, one with just other devs patches, and finally a third that can have both patches for testing. Generate your patches from the first checkout only and they will be clean.

A better option is to get permission to make commits to a particular branch and make commits to that, applying patches from other developers as needed.

Even better might be to implement your own version control locally, and you could branch and merge to your heart's content and only create patches for sharing when you're ready.

只想待在家 2024-08-09 22:55:24

您可以使用一些 DVCS 技术来跟踪您自己的更改。例如,git 支持跟踪 CVS 存储库 :您使 git 存储库与 CVS 存储库保持同步,并克隆该存储库以进行您自己的更改。当您收到外部补丁时,您可以在本地提交它们(也许根据需要创建更多克隆);这将允许您相当自由地合并和撤消内容。

从技术上讲要简单得多:保留一个包含您已应用的所有外部补丁的文件。在创建您自己的补丁之前,请恢复这些更改(使用 patch -R),然后创建您的补丁,然后重新应用其他更改以继续工作。

You could track your own changes with some DVCS technology. For example, git supports tracking CVS repositories: you keep a git repository synchronized with the CVS repository, and clone that for your own changes. When you receive external patches, you can commit them locally (perhaps creating further clones as necessary); this would allow you to merge and undo stuff fairly freely.

Technologically much more simple: keep a file containing all the external patches that you have applied. Before creating your own patch, revert those changes (with patch -R), then create your patch, then reapply the other changes to continue working.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文