Skip to content

fix: refine pre-push range#15

Merged
bniladridas merged 1 commit into
mainfrom
fix-pre-push-range
May 21, 2026
Merged

fix: refine pre-push range#15
bniladridas merged 1 commit into
mainfrom
fix-pre-push-range

Conversation

@bniladridas

Copy link
Copy Markdown
Contributor

Summary

  • Exclude the remote default branch when validating rewritten push ranges.
  • Prevent already-merged main commits from being checked during branch rebases and force-pushes.

Verification

  • bash -n git-hooks/pre-push
  • shellcheck git-hooks/pre-push
  • ./bin/lint.sh

@github-actions github-actions Bot mentioned this pull request May 21, 2026
Comment thread git-hooks/pre-push
commits=$(git rev-list "$local_sha" --not --all)
else
commits=$(git rev-list "$local_sha" --not "$remote_sha")
default_remote_ref=$(git symbolic-ref -q --short "refs/remotes/$remote_name/HEAD" || true)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cargo was needed for this dotfiles repo because its own lint and pre-push checks run cargo fmt and cargo clippy. The browser repo did not need Cargo for the Android PR; that earlier failure exposed this shared hook range issue, and this source repo is the right place to fix it so future installed hooks do not validate commits already on the remote default branch.

@bniladridas bniladridas merged commit d3cb701 into main May 21, 2026
5 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators May 21, 2026
@github-actions github-actions Bot deleted the fix-pre-push-range branch May 21, 2026 20:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant