mirror of
https://github.com/newren/git-filter-repo.git
synced 2024-07-04 01:15:41 +02:00
Quickly rewrite git repository history (filter-branch replacement)
Pruning of empty commits can cause an entire line of history to become empty and be pruned, resulting in a merge commit that merges some commit with one of its ancestors. In such a case, we should remove the unnecessary parent(s) -- which can and will often result in the merge commit being empty so we can remove it as well. Currently, if the side that becomes empty is the first parent side, then we do not detect if the commit becomes empty, due to the way that fast-export lists changes in a merge commit relative to first parent only. A subsequent commit will address this. Note that the callbacks could theoretically insert additional commits or reparent our commit on top of something else, meaning that the ancestry graph might need post-callback updates. However, in any extreme case where that mattered, we would more or less need full updates to the ancestry graph to be made for all the new commits from the callback as well, and once we expect the callback to handle any ancestry graph updates it can handle modifying it for the current commit. However, it is hard to come up with a case where it matters, since for the most part we just want to know whether our filtering causes commits to become empty and knowing the source repo we are exporting from is sufficient information without knowing any new commits inserted or reparenting that happens elsewhere. Signed-off-by: Elijah Newren <newren@gmail.com> |
||
---|---|---|
COPYING | ||
git-filter-repo |