统一DVCS命令 [英] Unification of DVCS commands

查看:98
本文介绍了统一DVCS命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在处理多个(开源)项目时,多个版本控制系统开始出现问题。虽然他们共享共同的操作,但我经常通过键入 hg add 而不是添加。我记得看到项目,通过在shell中提供基本的命令 commit / ci add 等,可以统一访问不同的源代码控制软件。根据存储库,它会依次调用 hg add git add 等。

我已经看过Amp: http://amp.carboni.ca/ (这似乎是关闭ATM)任何其他脚本就像那样?

解决方案

我认为两个版本控制系统(在这种情况下完全不同)版本控制系统的统一一个明智的尝试。尽管有一些共同之处,但它们之间的差异远大于共同点。更具体地说,虽然可以将某个系统的某些命令映射到另一个系统中的类似命令,但仍然存在语义差异,因为Mercurial和Git拥有完全不同的内部模型。只要考虑如何表示分支或git的分段区域。



不要试图在用户 级别上,我认为坚持使用一个版本控制系统是更加可取的,并且如果需要的话,使用桥接器(类似于git-svn)将您的更改/历史记录回送到另一个系统。



输入 hg add git add 并不是真正危险的东西,如果您目前目录不是在两个系统中管理的存储库,因此您将收到一条有意义的错误消息。

When working on multiple (open source) projects, multiple version controll systems start to be problematic. While they share common operations, I often make mistakes by typing hg add instead git add.

I remember seeing project some time ago that made access to different source control software in uniform way by providing basic commands commit/ci add etc. in shell. Depending on repository it would in turn call hg add or git add etc.

I've seen Amp: http://amp.carboni.ca/ (which seems to be down ATM) any other scripts like that?

解决方案

I think unifications of two (in this case completely different) version control systems is not a sensible thing to attempt. While there are certain commonalities, the differences far outweigh the commonalities. More specifically, while you could map certain commands from one system to a similar command in another system, there will still be semantic differences because Mercurial and Git have completely different internal models. Just consider how branching is represented or git's staging area.

Instead of trying to unify both systems at the "user" level, I think it is much more desirable to stick with one version control system and, if required, backport your changes/history to another system using a bridge (similar to git-svn).

Typing hg add vs. git add is not something that can get really dangerous if your current directory is not a repository managed in both systems, so you'll get a meaningful error message.

这篇关于统一DVCS命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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