On 01/04/2016 10:59 PM, Serhiy Storchaka wrote:
Is it possible to keep the same hashes in both Mercurial and Git? Or at least the same short hashes?

tl;dr: it's impossible.

The hash is a SHA1 of the revision's "manifest", which contains all the metadata about the revision.  To preserve the Mercurial hashes would mean doing something vile like rewriting these hashes after populating the repo.  If this worked at all, it would be terribly fragile; my guess is that many git commands (e.g. "git fsck") would notice and view it as damage.

The short hashes are simply the unique leading part of the hash, so they would only be preserved if we could preserve the full hashes.


/arry