views:

102

answers:

4

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?

A: 

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.

VonC
+9  A: 

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.

Johannes Rudolph
I completely agree with you about the significant differences between various VCSes. Unfortunately, sticking with one isn't always possible; in particular, I don't believe there's a good way to use git to work on a mercurial repo (i.e. there's hg-git but not git-hg).
Jefromi
Fact is, most common operations in both hg, and git are almost identical, and very common, so I'd much prefer simply typing _add file_ and for it to work in both hg and git directory, and do nothing (or print warnign message) in directories not under version controll.
Marcin Raczkowski
@Marcin Raczkowski `git add` and `hg add` aren't even _close_ to being the same.
mathepic
A: 

I think this was one of the goals of anyvcs, but I don't know how far along it is.

Ry4an
A: 

There are also Push Me Pull You and Qct project, both are multi-DVCS GUIs.

I have not checked their status, though.

Jakub Narębski