改变“不可变”:Git 标签变更的大规模研究
Mutating the "Immutable": A Large-Scale Study of Git Tag Alterations
AI总结:
通过分析3.284亿软件仓库,发现1020万次标签变更影响18.9万仓库,并与Nixpkgs交叉验证表明标签变更导致可重现构建失败,建议使用加密提交哈希固定依赖并建立审计日志。
摘要:
Git 标签在软件开发中通常被视为不可变的引用,用于标记发布和特定的仓库状态,这些状态支撑着构建的可重现性和软件供应链的完整性。尽管标签本应具有不可变性,但 Git 允许通过强制推送更新来删除或修改标签。此类变更的普遍性威胁到可重现构建和依赖完整性。我们对公共代码仓库中的标签变更进行了首次大规模实证研究,分析了来自 Software Heritage 的 3.284 亿个软件仓库,识别出影响 18.9 万个独立仓库的 1020 万次标签变更。与 Nixpkgs 的交叉分析显示,有 32 个包引用了我们数据集中被变更的标签,其中 7 个包出现确认的构建错误,这提供了具体证据表明标签变更会破坏可重现的包构建。我们的发现挑战了标签作为已发布软件不可变锚点的普遍假设。因此,我们建议构建系统和包管理器将依赖固定到加密提交哈希,开发平台公开标签变更审计日志,并且社区将标签变更的系统性监控作为标准的供应链安全实践。
英文摘要:
Git tags are commonly viewed as immutable references in software development, marking releases and specific repository states that underpin build reproducibility and software supply-chain integrity. Despite their intended immutability, Git allows tags to be altered through deletion or modification via force-pushed updates. The prevalence of such alterations threatens reproducible builds and dependency integrity. We conduct the first large-scale empirical study of tag alterations in public code repositories, analyzing 328.4 M software repositories from Software Heritage and identifying 10.2 M tag alterations affecting 189 k unique repositories. A cross-analysis with Nixpkgs reveals that 32 packages reference tags altered in our dataset, with 7 exhibiting confirmed build errors, providing concrete evidence that tag alterations break reproducible package builds. Our findings challenge the widespread assumption that tags are immutable anchors for released software. We therefore recommend that build systems and package managers pin dependencies to cryptographic commit hashes, that development forges expose tagmutation audit logs, and that the community adopt systematic monitoring of tag alterations as a standard supply-chain security practice.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。