Keep a reviewed revision across a squash merge#
Suppose a pull request is squash-merged and the source branch is later removed. The merged tree matches the approved change, but the original head had two commits and an inline discussion on the first. The original commit may be reachable for a while through other refs or reflogs. Git’s cleanup behavior allows unreachable objects to be pruned over time.
If the archive is allowed to keep the original source, record the exact base and head in dedicated refs in the approved archive repository or retain a verified bundle with both revisions available. For example, in an approved archive repository that already holds the reviewed object:
git update-ref refs/reviews/42/head <reviewed-head>
git cat-file -t refs/reviews/42/head
Read it back from the archive store, then use the retained base and head to regenerate the comparison. Git object retention and garbage collection · Git update-ref
If policy permits only a patch, record the exact base and what you retained. Test the reconstruction in the review record restore drill.