dusty-phillips / gitifyhg

Tools for using git as a client to mercurial repositories
GNU General Public License v3.0
62 stars 17 forks source link

gitifyhg should be "repeatable, lossless, and idempotent" #56

Open fingolfin opened 11 years ago

fingolfin commented 11 years ago

The recent release of Kiln Harmony has inspired me to write this issue, but the general idea has been on my wish list for a long time:

When two people independently make clones of the same hg repository using gitifyhg, one two different machines, possible on two different dates (so the remote repository may have changed state in between), then the resulting git commits should still have the same SHA-1s. So if user 1 looks at the git commit made from hg commit 1234abc, and the git commit has sha1 5678beef, and if user 2 also has hg commit 1234abc, then the corresponding git commit should also have sha1 5678beef

This extends even further: Two hg repositories may share some commits, but not all. This happens a lot in the hg camp, were one advocated branching strategy is to use a separate clone for each branch. If then two users clone these two repositories on two different machines, then we still want the common hg commits to map to the same git commits on both sides.

See also https://groups.google.com/d/msg/gitifyhg/W8IkoaEzLq0/3jytJ3FvCdYJ

I am not sure how far this is currently the case, but not long ago, I cloned a repos using gitifyhg which I had cloned before; and while the "older" commits matched, at some point the two histories started to diverge. I have not investigated this, but we definitely should do that.