Replies: 1 comment 1 reply
-
--preserve-commit-hashes is only about leaving commit hashes within commit messages alone. You cannot leave the commit hashes themselves alone by git's design. The commit hashes are a hash of the several things, including the commit message. So, this isn't a bug, and you aren't doing anything wrong, you're just asking for something that is impossible within git's design. If you really need to preserve commit hashes, then rewriting history is not an option for you. You could look into git notes if you want to provide an updated annotation of sorts that provides additional information to correct mistakes in commit messages. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to update commit messages and keep the same hash.
i try both options --message-callback and --commit-callback but no mater which one i choose, it generates new hashes. Here how i do that:
python3 git-filter-repo.py --preserve-commit-hashes --message-callback (or --commit-callback) '
if b"blabla" not in message:
message = b"MyMessage " + message
return message' --force
Is this a kind of bug? Or i do something completely wrong?
Any help is appreciated
Beta Was this translation helpful? Give feedback.
All reactions