SIGN IN SIGN UP

misc/git_hook/githook: don't flag large blobs already on the remote

The pre-push large-blob check diffed the pushed tree only against the
remote's old tree for the same ref. After rebasing a stale branch past
an unrelated large-file change on the default branch, that diff shows
the large file as changed even though the exact blob is already on the
remote via main, rejecting the push with a false positive.

Diff against every available base tree instead: the remote's old
commit for the ref plus the merge base with the remote's default
branch. Only flag a file that is a large addition relative to all
bases, so blobs the remote already has are not reported, while
genuinely new large files on the branch are still rejected.

Updates tailscale/corp#9863

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
Change-Id: Ia0c98fc1f5ab67a2913f948aeff605c72641ada7
B
Brad Fitzpatrick committed
25877455e79d9e3ebd5e99200ca86fd62bcc0ed9
Parent: 8be8ff5
Committed by Brad Fitzpatrick <brad@danga.com> on 8/10/2026, 10:00:07 AM