Review a refactor before its behavior change#
Suppose the first commit extracts the function that chooses a sensor timeout. The second changes its default. As a single diff, the moved code and new behavior appear together. The recipient wants to run the old timeout test after the extraction and inspect the expectation that changes in the second commit.
git format-patch --base=approved-base -o transfer approved-base..review
In a clean recipient checkout, resolve the recorded base ID and create a branch there. With the example’s two numbered patch files, import the series in filename order:
git switch -c inspect-series <recorded-base-commit>
git am /approved-transfer/0001-*.patch /approved-transfer/0002-*.patch
Inspect or check out each imported commit for the two tests. If a mail gateway wraps lines and git am fails, ask for the original patch files through the approved transfer. Resolving the broken import by hand changes the material under review. Git format-patch and base information · Git am
The import writes new commits. If the decision must reference the sender’s exact commit IDs or a merge commit, use a Git bundle. Git format-patch omits merge commits from its output.