Learning center

Can you reproduce an old review from the recorded Git SHA?

A commit ID identifies the reviewed object. Reproduction also requires a repository or approved artifact that still has that object and its dependencies. Test retrieval from a fresh archive checkout.

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.

One month of free code review.

New organizations get one calendar month of hosted code review for private and public GitHub repositories. No card or cloud connection required. Eligibility and fair-use terms.

Start free with GitHub

Related reading