Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mapping of old sha1 to new sha1 #48

Open
hkrpavan opened this issue Dec 2, 2017 · 2 comments
Open

Mapping of old sha1 to new sha1 #48

hkrpavan opened this issue Dec 2, 2017 · 2 comments

Comments

@hkrpavan
Copy link

hkrpavan commented Dec 2, 2017

After running git-lfs-migrate how to get mapping of old sha1 to new sha1 of all commits?

Also, what is the file git-lfs-migrate.mapdb? If it has old commit id to new commit id mapping how to dump it to text or csv file?

@antaln
Copy link

antaln commented Dec 14, 2018

I think git-lfs-migrate.mapdb is just a cache used during LFS conversion. The map of old to new commits is kept in the ConcurrentHashMap object ('converted'). I just added this in Main.java after the "Recreating refs..." loop block to dump old and new sha1 values:

        log.info("Dumping ObjectId maps...");
        for (Map.Entry<TaskKey, ObjectId> entry : converted.entrySet()) {
          ObjectId oldId = entry.getKey().getObjectId();
          ObjectId newId = entry.getValue();
          log.info(" convert objId: {} -> {}", oldId.getName(), newId.getName());
        } 

Caveats:

  • This dumps sha1 of all objects, not just commits
  • Some items will have same oldId and newId

I'll see about making a PR for this, but I just hacked this for a migration I was doing.

@hkrpavan
Copy link
Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants