Skip to content

fix(source-control): skip LFS smudge when worktree-create checks out an LFS repository - #17325

Merged
melodic-automation-lanes[bot] merged 6 commits into
mainfrom
work-resolve-issue/issue-17286-44424543397-1
Nov 19, 2026
Merged

melodic-automation-lanes[bot] merged 6 commits into
mainfrom
work-resolve-issue/issue-17286-44424543397-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #17286

Summary

Opened by the work-resolve-issue lane. The run's own summary:

worktree-create.sh now checks, before git worktree add, whether a .gitattributes file in the commit it checks out routes paths through filter=lfs (a git grep over :(glob)**/.gitattributes at that revision: refs/heads/<branch> for an existing branch, else the resolved base commit; commented lines are ignored). When it does, only that one git worktree add runs with GIT_LFS_SKIP_SMUDGE=1 in its environment (via env), so LFS paths arrive as pointer files and nothing is copied out of the LFS store. One stderr line, printed right after the checkout so a later exit 4 cannot drop it, names git lfs pull and git lfs pull --include &lt;paths&gt;. A repository with no LFS attributes runs the same checkout with no extra variable and gets no new output. I chose to read the attributes at the checked-out revision, not the source checkout's working tree, because the new worktree's attributes come from that commit. The usage text and context/create.md document the behavior, the test suite adds a no-LFS case and an LFS fixture case, and a patch changelog fragment records the fix.

Not verified

  • worktree-create.test.sh was not executed here: this lane's Bash runs only the named wrappers, so the new LFS and no-LFS cases and the existing suite are left to the PR's CI
  • The LFS case uses skip_case when git lfs is missing, as the issue asks; test-helpers.sh says skip_case should not vacate a group's only discriminating coverage (fail_discriminating_skip exists). GitHub-hosted Ubuntu runners ship git-lfs, so CI should run it
  • LFS routing set only in .git/info/attributes or core.attributesFile is not detected; those repositories smudge as before (outside the issue's .gitattributes scope)
  • comment-hygiene and typos checks skipped by check-affected (fetch blocked, typos not installed); left to the PR's CI
  • tidy: the ai-slop detector script (pass 5) could not run, because this lane's Bash allows only the named wrappers; the rubric read of the changed markdown lines found no tells. Proposal from pass 3, not applied: the 2&gt;/dev/null on the LFS git grep treats a grep error as no LFS (the safe,…

Fix

  • plugins/source-control/scripts/worktree-create.sh: detects filter=lfs in the checked-out revision's .gitattributes files and runs git worktree add (all three forms) under GIT_LFS_SKIP_SMUDGE=1 only then; prints one stderr note naming git lfs pull and git lfs pull --include &lt;paths&gt;;…
  • plugins/source-control/scripts/worktree-create.test.sh: new case for a repository with no LFS attributes (stdout is the path alone, no LFS note) and an LFS fixture case (git lfs install --local, an LFS-tracked asset) asserting the pointer file, the sole-stdout path and the single stderr note;…
  • plugins/source-control/skills/worktree/context/create.md: says LFS paths arrive as pointer files and how to fetch them (git -C &lt;path&gt; lfs pull, --include &lt;paths&gt;), in the Base branch section and the explain-what-will-happen block
  • .changes/source-control/work-resolve-issue-issue-17286-44424543397-1-0a0c4e47.md: patch changelog fragment under ### Fixed

Verification

The runner ran each check from the base copy against fa09e65:

  • scripts/check-changelog-fragments.sh --check: passed
  • scripts/check-changed-skills.sh --merge-base: passed

The run reports:

  • read https: //github.com/git-lfs/git-lfs/blob/main/docs/man/git-lfs-smudge.adoc: GIT_LFS_SKIP_SMUDGE "Disables the smudging process", see git-lfs-config(5)
  • read https: //github.com/git-lfs/git-lfs/blob/main/docs/man/git-lfs-config.adoc: GIT_LFS_SKIP_SMUDGE set to true/1 makes Git LFS skip converting pointers into objects on checkout, in both git lfs smudge and git lfs filter-process
  • read https: //git-scm.com/docs/gitglossary: glob pathspec magic, a leading **/ matches in all directories, so :(glob)**/.gitattributes covers the top-level file and nested ones
  • check-changelog-fragments: all 45 fragments valid (the first run failed on a missing ### section; fixed)
  • check-changed-skills: worktree skill PASS, 0 errors, 6 pre-existing warnings
  • check-affected: 15 passed, 7 skipped over 4 changed files (skips: ruff no .py, typos not installed, comment-hygiene fetch blocked, validate-plugins sub-checks and changed-skills that run checked-tree code)
  • fresh-context review subagent over the whole diff: no correctness bugs; its low-severity findings (note lost on a later exit 4, a commented-out filter=lfs line triggering detection) were fixed
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/44424543397

Left out: the items under Not verified.

Related

#17286

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/fix-ci
Model rung 0
Leg base
Run job success
Activity step success
Commits pushed none (read lane)
Run 44432506763

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/apply-patch
Model rung 0
Leg base
Run job success
Activity step success
Commits pushed ada0b71
Run 44432506763

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

claude-review: 1 inline finding(s) on ada0b71563237d763185e0216535e9755d2b075a; the summary is in this lane's pull request comment.

claude-lane: claude-review

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 55f03fda79f93bf0f58502ae577ed9bf5c18fff3: read 4 of 4 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #17325

No security issues found. The lane already reviewed an earlier head of this pull request, so this review was blocking only: it reports only CRITICAL and IMPORTANT findings.

Scope: I read every hunk of all 4 changed files in .claude-lane/pr.diff:

  • the changelog fragment
  • worktree-create.sh
  • worktree-create.test.sh
  • context/create.md

None of them matches a trusted path. None is a plugin manifest. None touches a trust control: the trusted-trigger check, the lane token, the kill switch and the merge holds are all unchanged.

What I checked in worktree-create.sh:

  • The new git grep. It reads .gitattributes at checkout_rev. That value is either the resolved base_commit or refs/heads/$branch, and it is passed as one quoted argument. Neither form can start with -, so it cannot be read as an option. The pathspec comes after --. The script runs nothing taken from file contents and only acts on whether the grep matched.
  • The env ${checkout_env[@]+...} prefix. It adds at most the fixed GIT_LFS_SKIP_SMUDGE=1. With an empty array the command is just env git ..., so no user-controlled value reaches the environment or the command line.
  • The effect of GIT_LFS_SKIP_SMUDGE=1. It narrows what checkout does: no LFS store copy and no smudge filter run. It grants nothing.
  • The new stderr note. It prints the worktree path through printf '%s'. That path is the script's own computed path, and the note has no format-string issue.

Tests and docs: the test additions use only local temporary repositories. The doc changes are prose. They delete, narrow or soften no standing instruction.

Settled thread: the misplaced --no-track comment thread was fixed in 74f4b53. Its lines have not changed since, and it was never a security point.

Embedded text: none in the PR context is aimed at the review lane.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 55f03fda79f93bf0f58502ae577ed9bf5c18fff3: read 4 of 4 changed file(s); 0 finding(s), 0 as inline comments.

claude-review (blocking only): no blocking findings on 55f03fda. This lane has already reviewed two earlier heads of this pull request (the prior-findings file says blocking only: yes), so this pass reports blocking findings only. The new head is a merge from main. I read every hunk of all 4 changed files in the full diff.

What I checked against closing issue #17286's acceptance criteria:

  • Detection. The new git grep over :(glob)**/.gitattributes runs at the revision being checked out: refs/heads/<branch> for an existing branch, otherwise the resolved base_commit. When it finds filter=lfs, all three git worktree add forms run under env GIT_LFS_SKIP_SMUDGE=1 (worktree-create.sh#L1280-L1300).
  • No-LFS case. With no filter=lfs, checkout_env is empty and the ${arr[@]+...} expansion adds nothing, so a repository without LFS gets the same command and no new output.
  • Stderr note. One line, printed only after a successful checkout (#L1311-L1314). It names git lfs pull and git lfs pull --include <paths>, and stdout is still the path alone.
  • No later re-smudge. No later step in the script runs checkout, reset, restore or switch in the new worktree, so nothing smudges the pointer files afterwards.
  • Tests. The no-LFS case asserts that stdout is the path alone and that stderr has no LFS note. The LFS fixture case runs git lfs install --local. Worktrees share that config, so without the fix the smudge filter would run, which means the pointer-file assertion can actually fail. The case uses the source-control skip_case helper with a named reason when git lfs is missing.
  • Docs. context/create.md says LFS paths arrive as pointer files and how to fetch the content.

All five acceptance criteria are met in the code. I did not run the test suite: this lane has no shell. The PR's verification claims are the author's and unverified.

Settled threads. The earlier misplaced-comment thread is resolved, with lines changed since resolution: no. It is not raised again.

Loosened-check verdict: fail (default: the prompt has no loosened_check_verdict: line); patterns: 0 (no loosened_check_patterns: line). I did not check the citation requirement because the prompt has no loosened_check_decision_record: line. The change loosens no check.

No plugin manifest changed. The changelog fragment is a bump: patch under ### Fixed, which fits a bug fix.

No paid-cost or critical-security change, so no hold.

Verifier dropped 0 of 0 candidates.

@melodic-automation-lanes melodic-automation-lanes Bot added the needs-session A pr-unblock stop a session builder takes: a change the lane cannot make. Not an owner stop. label Nov 19, 2026
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The pr-unblock lane stopped address-feedback on this pull request: the pull request has an unresolved review thread the lane does not take (a reviewer it does not act on, a review of an older head, or a thread it already answered), so no lane resolves it and a session builder takes it. The lane labels it needs-session for a session builder, who makes the change this lane cannot, and the run ends in a failing pr-unblock/address-feedback status on the head the lane gated.

When a retry on this head can change the outcome, the lane runs one on its own, up to its per-head cap, and edits this comment if it stops again; a run that does not stop clears the status. When no retry can (a review thread the lane does not take or settle, or a failing check after the retries are spent), a person resolves the threads or gets the checks green, then dispatches the workflow below: that run finds the cause gone and clears the status. On a pull request the lanes App opened, the dispatchers start that run once per stop; on any other, a person does. A new commit to the branch starts clean.

To run it again on this head now, dispatch the pr-unblock workflow:

gh workflow run pr-unblock.yml -R melodic-software/claude-code-plugins -f pr-number=17325 -f activity=address-feedback

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/report-escalation
Model rung 0
Leg base
Run job success
Activity step success
Commits pushed none recorded
Run 44442418377

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

@melodic-automation-lanes

melodic-automation-lanes Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor Author

Unattended merge: native auto-merge leaves this pull request unarmed at head 5b2d69daafd70d25aabde50ee8f09305e55b3a3a. No person needs to act: a lane clears this reason, and the next scheduled run judges it again.

pr-merge's gate refuses its verifier verdict (verify:missing)

@kyle-sexton kyle-sexton added the do-not-merge Hard merge gate: do not merge while applied. label Nov 19, 2026
@kyle-sexton

Copy link
Copy Markdown
Member

A session is reworking this PR to answer its open review thread. It set the do-not-merge label to keep the lane off it meanwhile and will remove the label when the rework is pushed.

…rktree add chain

The LFS detection block sat between the --no-track comment and the
worktree add branches it explains; it now runs above that comment. The
moved comment links the push.default documentation it relies on, which
the comment lint's necessary posture requires of a comment a change adds.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton kyle-sexton removed the do-not-merge Hard merge gate: do not merge while applied. label Nov 19, 2026
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head 74f4b5393ea040593bfc3805bd510825141be9a8, the head its arming checks judged.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Merge-Risk: max=MEDIUM demote=false head=74f4b5393ea040593bfc3805bd510825141be9a8 rubric=10.4.0 rater=claude-opus-5-5 checker=claude-opus-5-5

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 19, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 19, 2026
@melodic-automation-lanes melodic-automation-lanes Bot removed the needs-session A pr-unblock stop a session builder takes: a change the lane cannot make. Not an owner stop. label Nov 19, 2026
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 19, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 19, 2026
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 19, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 19, 2026
@melodic-automation-lanes

melodic-automation-lanes Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor Author

Unattended merge: the merge queue removed head 74f4b5393ea040593bfc3805bd510825141be9a8 4 times for failed checks, so the pr-merge lane will not enqueue it again. A push resets the count.

Failing merge_group runs:

@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 19, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 19, 2026
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head 55f03fda79f93bf0f58502ae577ed9bf5c18fff3, the head its arming checks judged.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Merge-Risk: max=MEDIUM demote=false head=55f03fda79f93bf0f58502ae577ed9bf5c18fff3 rubric=10.4.0 rater=claude-opus-5-5 checker=claude-opus-5-5

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 19, 2026
Merged via the queue into main with commit 6ac921d Nov 19, 2026
47 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-17286-44424543397-1 branch November 19, 2026 18:35
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 6ac921da255d0d5ffd51679cd7101493aaef94c2; later checks count it verified from this comment.

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.

Skip LFS smudge when the worktree helper checks out a repository that uses Git LFS

1 participant