Decades of GNU Patch and Git Cherry-Pick: Can We Do Better?
Alexander Schultheiß, Alexander Boll, Paul Maximilian Bittner, Sandra Greiner, Thomas Thüm, Timo Kehrer
Abstract
Patching is a fundamental software maintenance and evolution task enabling the (semi-)automated propagation of changes across different software versions. Established and widely used languageagnostic patchers, such as GNU patch and Git cherry-pick, work on textual artifact representations (i.e., text files) and typically rely on line numbers and contexts (i.e., surrounding unchanged text fragments) to apply changes. This strategy often fails if source and target of a patch differ, provoking cumbersome manual effort. In this paper, we study the effectiveness of commonly-used patchers, and propose a novel technique that significantly increases patch automation. First, we curate and analyze a large dataset of more than 400,000 patch scenarios (i.e., cherry picks) from 5,000 GitHub projects. Next, we examine the effectiveness of established patchers on the gathered patch scenarios. Third, we develop a novel languageagnostic patch technique, mpatch, that utilizes a source-to-target matching to determine suitable change locations. By comparing mpatch to other patchers, we find that it can correctly apply 44% more patches automatically than other language-agnostic patchers, while it also requires fewer manual fixes in cases that cannot be automated completely. Thus, mpatch considerably reduces the burden of manually fixing failed patches in practice, specifically in projects with frequent patch applications.
• Software and its engineering → Software configuration management and version control systems; Software maintenance tools.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext f6e2c52e-740f-4a88-b263-3752579ce782Builds on6
- Automated patch backporting in Linux (experience paper)Ridwan Shariffdeen, Xiang Gao, Gregory J. Duck, Shin Hwei Tan et al.ISSTA 2021 · 23 citations
- Seamless Variability Management With the Virtual PlatformWardah Mahmood, Daniel Strüber, Thorsten Berger, Ralf Lämmel et al.ICSE 2021 · 23 citations
- Enhancing OSS Patch Backporting with SemanticsSu Yang, Yang Xiao, Zhengzi Xu, Chengyi Sun et al.CCS 2023 · 8 citations
- PaReco: patched clones and missed patches among the divergent variants of a software familyPoedjadevie Kadjel Ramkisoen, John Businge, Brent van Bladel, Alexandre Decan et al.FSE 2022 · 8 citations
- Automating Zero-Shot Patch Porting for Hard ForksShengyi Pan, You Wang, Zhongxin Liu, Xing Hu et al.ISSTA 2024 · 5 citations
Related papers
- Maximizing Patch Coverage for Testing of Highly-Configurable Software without Exploding Build TimesNecip Fazil Yildiran, Jeho Oh, Julia Lawall, Paul GazzilloFSE 2024 · 7 citations
- Strengthening Supply Chain Security with Fine-grained Safe Patch IdentificationChanghua Luo, Wei Meng, Shuai WangICSE 2024 · 1 citation
- BackportBench: A Multilingual Benchmark for Automated Patch BackportingZhiqing Zhong, Jiaming Huang, Pinjia HeFSE 2026 · 1 citation
- pPatch: Automated Vulnerability UnpatchingTianyi Jing, Pengyu Ding, Meng Xu, Yinhao Hu et al.FSE 2026
- A Large-Scale Empirical Review of Patch Correctness Checking ApproachesJun Yang, Yuehan Wang, Yiling Lou, Ming Wen et al.FSE 2023 · 11 citations
