Learning center

How to review a Git submodule update offline

Record both child commit IDs and verify they exist in the child repository before judging a parent diff. The parent tracks a reference to a submodule commit. The actual code under review lives in the child.

Follow a vendor firmware update#

A controller pull request changes vendor/protocol from one child commit to another. The maintainer’s parent bundle imports cleanly. A review of the parent alone shows the change in the reference. It still leaves open whether the child changed its byte ordering.

git diff approved-base review -- vendor/protocol
git ls-tree approved-base -- vendor/protocol
git ls-tree review -- vendor/protocol

In the authorized child checkout, use the old and new object IDs reported by ls-tree:

git -C vendor/protocol cat-file -t <old-child-commit>
git -C vendor/protocol cat-file -t <new-child-commit>
git -C vendor/protocol diff <old-child-commit> <new-child-commit>

The first two commands should report commit. If the new object is absent, request the child repository’s approved artifact or have a maintainer with access deliver a decision against those child IDs. Record whether you inspected the child code or only verified the parent’s reference change. Git submodule representation · Git diff submodule formats

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