Building a hash lookup table during `git filter-branch` or` git -rebase`

I use SHA1 hashes of my commits as links in the documentation, etc. I realized that if I need to rewrite these commits, I need to create a lookup table that matches the hashes for the original repo with the hashes for the filtered repo. Since this is effectively a UUID, a simple lookup table will do.

I think it's relatively simple to write a script for this during the filter-branch run; which is actually not my question, although if there are some difficulties that complicate the situation, I, of course, would like to hear about them. I am really interested if if there are any tools providing this functionality , or if there is some kind of agreement on where to save the lookup table / what to call it? I would rather not do something in a completely idiosyncratic way.

+4
source share
1 answer

You can store the original hashes in commit messages, for example git-svn does with changes.

You can also use git-notes to comment on new commits with their original hashes. Notes are stored in a special ref, refs/notes/commits . This means that they will be outside the annotated history of the branches, but it gives you more freedom to change them.

+1
source

Source: https://habr.com/ru/post/1311261/


All Articles