[PR #1738] [MERGED] Scope pre-push history checks to pushed refs #3732

Closed
opened 2026-11-03 04:11:50 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1738
Author: @rdbtCVS
Created: 10/25/2026
Status: ✅ Merged
Merged: 10/25/2026
Merged by: @ludovic111

Base: main ← Head: fix/pre-push-ref-history


📝 Commits (1)

  • 2c80009 Scope pre-push history checks to pushed refs

📊 Changes

4 files changed (+175 additions, -5 deletions)

View changed files

📝 .githooks/pre-push (+1 -1)
📝 CONTRIBUTING.md (+2 -0)
➕ tests/test_pre_push.py (+147 -0)
📝 tools/check_public_tree.py (+25 -4)

📄 Description

🤖 Opened by the AI agent of rdbt (OpenCode, agentrouter/gpt-6.1-sol), not by rdbt directly.

What and why

The pre-push hook scanned git log --all, so private-artifact history on unrelated local branches, tags, remote-tracking refs, or backup refs blocked clean pushes and forced a clean-clone workaround.

  • Read the Git pre-push ref-update stream and inspect the full history reachable from every non-deleted local object ID being pushed.
  • Handle multi-ref pushes, annotated tags, raw revisions, and deletion-only or empty updates.
  • Preserve the private-artifact guard across deleted files and merge-only additions; inspect stored objects without local replacement refs masking or tainting their history.
  • Keep --history as the all-local-refs audit and document the hook scope.
  • Add 10 regression tests that exercise the hook against isolated Git repositories.

Vanilla reference

None — Git tooling.

Self-check

pr_ready (tools/pr_ready.py --quick on archlinux, against origin/main at 1ef5b82b7, 57 s)

Check Result
Scope ✅ 4 files, +175 −5
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 267 passed (49 s)
rustfmt ➖ no Rust change
clippy ➖ no Rust change
tests ➖ no crate touched
doc tests ➖ no crate touched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 43 affected, to run in CI (--quick): server_files, state_provider, stored_effect_notifications, structure_density, subtitle, suffocation, swimming, synced_bytes, synced_floats, tab_list, team_rules, teleport_consume and 31 more
Label skip-release

git diff --check also passes.

🤖 Generated with OpenCode (agentrouter/gpt-6.1-sol).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/1738 **Author:** [@rdbtCVS](https://github.com/rdbtCVS) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/25/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/pre-push-ref-history` --- ### 📝 Commits (1) - [`2c80009`](https://github.com/horizon-rust/horizon/commit/2c80009c70eeb2475c5332c7027e8daa8b95c86a) Scope pre-push history checks to pushed refs ### 📊 Changes **4 files changed** (+175 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `.githooks/pre-push` (+1 -1) 📝 `CONTRIBUTING.md` (+2 -0) ➕ `tests/test_pre_push.py` (+147 -0) 📝 `tools/check_public_tree.py` (+25 -4) </details> ### 📄 Description > 🤖 Opened by the AI agent of rdbt (OpenCode, agentrouter/gpt-6.1-sol), not by rdbt directly. ## What and why The pre-push hook scanned `git log --all`, so private-artifact history on unrelated local branches, tags, remote-tracking refs, or backup refs blocked clean pushes and forced a clean-clone workaround. - Read the Git pre-push ref-update stream and inspect the full history reachable from every non-deleted local object ID being pushed. - Handle multi-ref pushes, annotated tags, raw revisions, and deletion-only or empty updates. - Preserve the private-artifact guard across deleted files and merge-only additions; inspect stored objects without local replacement refs masking or tainting their history. - Keep `--history` as the all-local-refs audit and document the hook scope. - Add 10 regression tests that exercise the hook against isolated Git repositories. ## Vanilla reference None — Git tooling. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on archlinux, against origin/main at 1ef5b82b7, 57 s) | Check | Result | | --- | --- | | Scope | ✅ 4 files, +175 −5 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 267 passed (49 s) | | rustfmt | ➖ no Rust change | | clippy | ➖ no Rust change | | tests | ➖ no crate touched | | doc tests | ➖ no crate touched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 43 affected, to run in CI (--quick): server_files, state_provider, stored_effect_notifications, structure_density, subtitle, suffocation, swimming, synced_bytes, synced_floats, tab_list, team_rules, teleport_consume and 31 more | | Label | `skip-release` | `git diff --check` also passes. 🤖 Generated with [OpenCode](https://opencode.ai) (agentrouter/gpt-6.1-sol). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:11:50 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#3732
No description provided.