Skip to content

operations: Squash via patches if commits are not directly related

Patrick Steinhardt requested to merge pks-operations-squash-opportunistic into master

In commit 640b4de0 (operations: Implement squashing without worktrees, 2021-07-19), we've introduced a new squashing implementation which creates commits via git-commit-tree(1) based on the observation that a squashed merge of two commits which have a direct parent-child relation is exactly the same as a new commit with the parent's parent and the child's tree. As it turns out, the assumption that squashes are always performed on a line of history where child and parent are on the same first-parent-chain isn't correct though, and thus causes test failures in QA.

Fix the issue by falling back to patch-based squashing in the case where the start commit is not an ancestor of the end commit.

Changelog: fixed

Merge request reports

Loading