A subtree update is easier to backport when its merge commit is based on the previous subtree merge instead of on a newer master commit. The exact same merge commit can then be reused on release branches, making the backport trivial to verify without rereviewing a newly generated subtree merge.
Update git-subtree-check.sh to locate the merge that introduced the latest subtree squash reachable from COMMIT and error if its first parent is not the previous subtree merge.
Sometimes subtree and Bitcoin Core API changes are incompatible, making it necessary to base an update on a later commit. Add --incompatible to explicitly skip the backportability check in that case.
The CI lint job always sets --incompatible, so we rely on reviewers to run the new check.
As a preparatory refactor, replace getopts with explicit option parsing and add --remote as the preferred long alias for -r.
Example that passes:
test/lint/git-subtree-check.sh src/ipc/libmultiprocess 66b4e30e
Example that errors because the update is not based on the previous subtree merge:
test/lint/git-subtree-check.sh src/ipc/libmultiprocess 02afa661