当处理多个(开源)项目时,多个版本控制系统开始出现问题。虽然它们共享共同的操作,但我经常因为输入 hg add 而不是 git add 而犯错误。
我记得前段时间看到一个项目,通过在 shell 中提供基本命令 commit/ci add 等,以统一的方式访问不同的源代码控制软件。根据存储库,它会依次调用 hg add 或 git add 等。
我见过 Amp:http://amp.carboni.ca/ (这似乎是 ATM 机上的)还有其他类似的脚本吗?
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?
发布评论
评论(4)
我认为两个(在这种情况下完全不同)版本控制系统的统一并不是一个明智的尝试。虽然存在某些共性,但差异远远大于共性。更具体地说,虽然您可以将一个系统中的某些命令映射到另一个系统中的类似命令,但仍然存在语义差异,因为Mercurial 和 Git 具有完全不同的内部模型。 只需考虑分支的表示方式或 git 的暂存区即可。
我认为与其尝试在“用户”级别统一两个系统,不如坚持使用一个版本控制系统,并且如果需要,使用桥接器将您的更改/历史记录向后移植到另一个系统(类似于 git-svn )。
如果您的当前目录不是两个系统中管理的存储库,那么输入
hg add
与git add
并不是真正危险的事情,因此您会收到有意义的错误信息。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.据我所知,没有。
amp 的两个存储库(GitHub 和 在 bitbucket 上)现在还没有完全爆发。
关于该项目的评论并不都是热情的。
所以现在,常见的别名/命令(能够识别它们的上下文 - hg 或 git repo - 并生成正确的命令)是你最好的选择。
Not that I know of.
The two repos for amp (on GitHub, and on bitbucket) are not exactly bursting right now.
And the comments about the project were not all enthusiastic.
So right now, common aliases/commands (able to recognized their context - hg or git repo - and generate the right command) are your best bet.
我认为这是 anyvcs 的目标之一,但我不知道能走多远沿着它是。
I think this was one of the goals of anyvcs, but I don't know how far along it is.
还有推我拉你和Qct 项目,都是多 DVCS GUI。
不过,我还没有检查过他们的状态。
There are also Push Me Pull You and Qct project, both are multi-DVCS GUIs.
I have not checked their status, though.