Draft
Conversation
Add explicit cutoff conditions to but-graph traversal so debug output can distinguish natural roots, limit cutoffs, and shallow boundaries. Mark commits listed in the repository shallow boundary file and stop queueing their grafted parents so shallow clones traverse up to the boundary without treating it as a normal limit cutoff. This change replaces the boolean early-end traversal API with CutoffCondition bitflags, preserves existing stack projection behavior for limit cutoffs, updates statistics and debug helpers, and adds a file:// shallow-clone regression test. Validation: - cargo test -p but-graph
The rust-lint GitHub Actions job failed because clippy::single-char-add-str rejects push_str() with single-character string literals in cutoff debug rendering. Use String::push() for the root and shallow boundary marker characters. This keeps the debug output unchanged while satisfying clippy. Validation: - cargo clippy -p but-graph --all-targets -- -D warnings - cargo test -p but-graph
The new first-commit cutoff condition is rendered in debug graph output. Workspace rust-test also exercises but-rebase inline snapshots that include graph roots, so update those expected snapshots to include the root marker. Validation: - cargo test -p but-rebase --test rebase graph_rebase - cargo test -p but-rebase --test rebase
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Handle shallow clone boundaries in
but-graphtraversal and expose explicit cutoff conditions for graph debug output. The StGit patchhandle-shallow-cutoffsmarks shallow boundary commits, stops traversal at their grafted parents, and replaces the old boolean early-end API withCutoffConditionbitflags.Context
This session focused on making shallow clone traversal stop at Git's shallow boundary without presenting that stop as an ordinary traversal limit cutoff. The implementation follows the
gixshallow-boundary pattern: readrepo.shallow_commits(), yield boundary commits, and avoid queueing their recorded parents.The prior
is_early_end_of_traversal()boolean was replaced withtraversal_condition() -> Option<CutoffCondition>, where conditions can include limit cutoffs, natural first/root commits, and shallow boundaries. Debug rendering now shows each applicable condition distinctly, while stack projection keeps its existing user-facing early-end behavior for limit cutoffs only.Snapshots were updated for the newly visible root-commit debug marker, and a regression test creates a real
file://shallow clone because plain local-path clones ignore--depth.Validation
cargo fmt --package but-graph --package but-testsupportcargo test -p but-graphDisclosure
Created by Codex on behalf of Byron. Byron will review before this is ready to merge.
User Prompts