Fix doc/comment accuracy for pushed v1.1 ref (PR #1380 review) · Entire

Fix doc/comment accuracy for pushed v1.1 ref (PR #1380 review)

55e30ba→main·

computermode·1mo ago·3 files·+9 added/-6 removed

Address Copilot review comments: with milestone 2 pushing v1.1 to the remote, three places still described it as a local-only, never-pushed mirror.

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

Sessions

b6a5f5f0fae4View transcript

Changes

3

100 unmodified lines

101
102
103
104
105
104
105
106
107
108
109

100 unmodified lines

want bool
    }{
    {"v1-only: reads target fetchable primary", CommittedRefs{Primary: v1, Read: v1, Push: []plumbing.ReferenceName{v1}}, true},
    // v1.1-push milestone: v1.1 is pushed, but reads target the local-only
    // mirror (Read != Primary), so reads still cannot bootstrap from origin.
    // v1.1-push milestone: v1.1 is pushed, but it's a non-branch ref with no
    // origin-tracking shadow and Read != Primary, so reads still cannot
    // bootstrap from origin.
    {"v1.1 pushed but reads target mirror", CommittedRefs{Primary: v1, Read: custom, Mirror: custom, Push: []plumbing.ReferenceName{v1, custom}}, false},
    {"reads target primary but primary not pushed", CommittedRefs{Primary: v1, Read: v1, Push: nil}, false},
}

Mcmd/entire/cli/checkpoint/committed_refs_test.go+3/-2

40 unmodified lines

41
42
43
44
45
46
44
45
46
47
48
49
50
51

40 unmodified lines

// MetadataRefName is the v1 custom ref that committed metadata is mirrored to
// when checkpoints_version is "1.1". It lives under refs/entire/ (not
// refs/heads/) so it stays invisible to `git branch -a` and is not pulled by a
// default `git clone`. v1 remains the source of truth; this ref is a local-only
// mirror. When v1.1 is enabled, committed reads resolve against this ref as-is;
// active v1 write/fetch paths update the mirror, and it is never pushed.
// default `git clone`. v1 remains the source of truth; this ref mirrors it.
// When v1.1 is enabled, committed reads resolve against this ref as-is, active
// v1 write/fetch paths update the mirror, and PrePush pushes it to the remote
// alongside v1. As a non-branch ref it gets no origin-tracking shadow, so reads
// still do not bootstrap it from origin.
const MetadataRefName = "refs/entire/checkpoints/v1.1"

// TrailsBranchName is the orphan branch used to store trail metadata.

Mcmd/entire/cli/paths/paths.go+5/-3

212 unmodified lines

213
214
215
216
216
217
218
219

212 unmodified lines

The v1.1 ref lives outside `refs/heads/` and does not appear in normal branch
listings. It is pushed to the configured remote alongside `entire/checkpoints/v1`
— the resolver adds it to the push set and `PrePush` advances every ref there.
— the resolver adds it to the push set and `PrePush` pushes every ref there.
Because it is not a branch it gets no `refs/remotes/origin/...` tracking ref,
and reads still resolve against the local ref rather than bootstrapping it from
origin (reads target v1.1 while the primary write/fetch ref stays.