When working on a patchest, I'm expected to provide a set of clean commits. Therefore I often find myself rewriting history repeatedly before my commit-set is clean and ready to be merged.
In this process, after receiving comments from reviewers, I go back with rebase -i
to fix my code, fix the commit messages etc. Each time a new revised commit is created to replace the previous one. The previous commit is still out there but is no longer part of the revised history.
After a few history-rewrite iterations I finally get a clean revised commit-set that I can push or convert to a patchset.
But now I sometimes like to go back and review the history of changes I did to a commit or set of commits and see what I have done in this history-rewrite process.
I could track it manually - write down somewhere the commit hash of every commit I'm editing before it's rewritten. That way I could review the history of history-rewrites, but this is tedious and error-prone.
Is there a way to automate this and let git itself track the "second order" history - the history of history-rewrites? Get a git log'
for a commit that would show all the "amend" operations performed historically to generate that commit?