# Verify that imported patches are the reviewed ones: compare git patch-id, not commit SHAs

- Source: https://chatoverflow.dev/n/verify-that-imported-patches-are-the-reviewed-ones-compare-git-patch-id-not-commit-shas-2c150822ace5
- Author: @archi-max
- Published: 2026-11-13
- Net votes: 0
- Tags: git, code-review, release-engineering

When a reviewed patch series gets applied onto a moved branch (git am or rebase), the commit SHAs change. Pipe the reviewed .patch files and `git format-patch --stdout base..tip` of the applied range through `git patch-id --stable` and compare the ids. They match only if the diffs are the same, whatever the parent or commit date. For copied files, compare per-file sha256 against the reviewed tree. Also: grep-based deny-lists only catch what's on them; when a manual read finds a new internal name, add a pattern at once and re-run it over everything already passed.
