一句话:提出 AntiDiffamine,基于提交祖先关系对齐,自动消除 force-push 后 PR 差异中的基底分支噪声。
在 Pull Request(PR)开发中,作者常通过 amend、squash 或 rebase 后 force-push 回应评审,但这会把 PR 特有变更与 base 分支更新混同,干扰评审并污染 PR 数据集。本文对 1,445 个 GitHub 项目的 935,011 个 PR 进行实证研究,发现 242,624 个 PR 含 568,218 次 force-push,其中 210,837 对(37.1%)存在混同。作者提出 AntiDiffamine:一种基于祖先关系的提交对齐方法,将 force-push 前后的 HEAD 提交映射到共同参考,以隔离 PR 特有变更。该方法可自动去混同 98.1% 的修订,将 diff 缩小 1 至 3 个数量级;在 Kubernetes 的 523 对 fail-fix 修订中,130 对存在混同,应用后识别出的修复文件与人工标注重叠更高。作者还提供 GitHub Action 模板以便实际采用。
In pull-based development, Pull Requests (PRs) undergo peer review. To address review feedback, authors may "force-push" after amending, squashing, or rebasing commits. Such revisions can conflate PR-specific changes with updates on the base branch, hindering further review and introducing noise into PR-based datasets. In this paper, we empirically study 935,011 PRs from 1,445 well-maintained GitHub projects. We observe 568,218 force-push events in 242,624 PRs that span 1,366 projects. We denote the HEAD commits of the PR before and after force-pushing as a force-push pair, and observe that 210,837 pairs (37.1%) have a relationship that conflates PR changes with updates to the base branch. To systematically isolate PR-specific changes in such revisions, we propose AntiDiffamine---an ancestry-based approach that aligns commits on a common reference. AntiDiffamine can automatically deconflate 98.1% of the studied revisions, decreasing the diff size by one to three orders of magnitude. We also evaluate AntiDiffamine on fail-fix pairs, i.e., revisions that fix failing builds. A case study of Kubernetes reveals that 130 of 523 pairs have conflated diffs. Moreover, the fixing files identified when AntiDiffamine is applied overlap more with a human-labelled ground truth than when conflation is untreated or excluded. AntiDiffamine is a first attempt at addressing force-push-based diff conflation, which is having a real-world impact on practical and research workflows. To ease practical adoption, we provide a template GitHub Action, which scans PR updates for force-push events and applies AntiDiffamine to deconflate the diff.
@inproceedings{paperbot12445,
title = {Recovering Revisions of Pull Requests with Altered History},
author = {Gengyi Sun and Georges Aaron Randrianaina and Tao Xiao and Yasutaka Kamei and Shane McIntosh},
booktitle = {ASE},
year = {2026},
doi = {10.1145/3832783.3837417}
}