Skip to content

sync-skill: fetch upstream main by explicit refspec - #132

Merged
zpyoung merged 1 commit into
mainfrom
sync-lessons/v1.4.237
Oct 22, 2026
Merged

zpyoung merged 1 commit into
mainfrom
sync-lessons/v1.4.237

Conversation

@zpyoung

@zpyoung zpyoung commented Oct 22, 2026

Copy link
Copy Markdown
Owner

ELI5

The sync skill's first fetch didn't actually update upstream/main in this clone, so the run worked from an old copy of upstream's trunk without noticing. This changes Step 1 to fetch by explicit refspec, which always updates the ref.

What Changed

Step 1 of .claude/skills/sync-upstream/SKILL.md now fetches upstream/main, origin/main and origin/upstream by explicit refspec, and says why the bare form fails.

Why

This clone's remote.upstream.fetch is narrowed:

$ git config --get-all remote.upstream.fetch
+refs/heads/FixDeleteWorktree*:refs/remotes/upstream/FixDeleteWorktree*
$ git fetch upstream main
 * branch                  main       -> FETCH_HEAD

On the v1.4.237 run (#131), after git fetch upstream main, upstream/main was still at bfc436be60 while upstream's tip was fd8b2dc3a7. Steps 2 and 7 exclude upstream/main when counting fork commits, and Step 12 fast-forwards the mirror branch from it, so all three read the stale ref. The run caught it and re-fetched with refs/heads/main:refs/remotes/upstream/main. The fork commit count (726) was unaffected that time.

Linked Issue

N/A. Sync-skill lesson from the v1.4.237 run.

Visual Proof

N/A. Docs only.

Testing

Ran both new fetch commands in this clone; each updates its remote-tracking ref.

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

Docs-only change to a skill file; no tests apply.

…/main is never stale

The clone's remote.upstream.fetch maps only refs/heads/FixDeleteWorktree*,
so Step 1's 'git fetch upstream main' wrote FETCH_HEAD and left upstream/main
at bfc436b while upstream's real tip was fd8b2dc (v1.4.237 run). Every
--not upstream/main count and the Step 12 mirror push read the stale ref.
Copilot AI balanced review requested due to automatic review settings October 22, 2026 11:53
@greptile-apps

greptile-apps Bot commented Oct 22, 2026

Copy link
Copy Markdown

Your organization has run out of review credits. Add credits to resume code reviews.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@zpyoung
zpyoung merged commit 98b5867 into main Oct 22, 2026
12 checks passed
@zpyoung
zpyoung deleted the sync-lessons/v1.4.237 branch October 22, 2026 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants