Fix the status line git cost and its wrong optional-locks comment #1608
Labels
No labels
P0
P1
P2
P3
bug
category/code-change
category/cross-repo
category/eval-run
category/investigation
category/no-test-target
category/owner-ruling
category/prose-artifact
category/recurring-chore
category/structure
category/umbrella
crc-refactor
create
delete
enhancement
filed-by/agent
filed-by/user
frozen
lint-rule
needs-info
needs-triage
next
plugin/cc-architect
plugin/os
plugin/os-adr
plugin/os-aidd-lint
plugin/os-backlog
plugin/os-context
plugin/os-doc-hygiene
plugin/os-sdlc
plugin/os-vault
project/cc-os
ready-for-agent
ready-for-human
recurring
review
rule-proposal
update
waiting
wayfinder:grilling
wayfinder:map
wayfinder:map
wayfinder:research
wayfinder:task
wayfinder:task
wontfix
worklist/deviations
worklist/lint-rule
worklist/new-implement-build
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jared/cc-os#1608
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
~/.claude/statusline-command.shruns three git processes on every render (rev-parse --git-dir,symbolic-ref --short HEADorrev-parse --short HEAD, andstatus --porcelain). The comment at line 30 says it skips optional locks, but nothing setsGIT_OPTIONAL_LOCKS=0. A fullstatus --porcelainruns on every render. This is row G-066 and open item Q-1 indocs/os-git/call-site-checklist.md. It does not depend onos-git.Observed
statusline-command.sh:30says "skip optional locks". Lines 31, 32, and 34 start the git processes. No line setsGIT_OPTIONAL_LOCKS.Reproduce
The command prints nothing.
Approach
Set
GIT_OPTIONAL_LOCKS=0on the git calls, so the status line never takes a lock that blocks the user's own git commands. Remove the false comment or make it true. Cut the process count where the same answer needs fewer calls (for example, read the branch and the dirty flag from onegit status --porcelain=v2 --branchcall). The file is outside the cc-os repository: edit it in place.Required work: none beyond the acceptance criteria.
Acceptance criteria
GIT_OPTIONAL_LOCKS, then the git calls run withGIT_OPTIONAL_LOCKS=0.Non-goals
Porting the script to Ruby or to
os-git.Origin
Work started by the #1610 orchestrator, session 5b14a4ef-91b2-45c0-a729-baa17682a39a. Branch: ticket-1608.
Resolution
Done: statusline-command.sh runs one GIT_OPTIONAL_LOCKS=0 git status --porcelain=v2 --branch call per render; false comment removed; G-066 and Q-1 marked.
Evidence: PATH-shim process counts: clean 3 to 1, dirty 3 to 1, detached 4 to 1, unborn 3 to 1, non-repo 1 to 1. Old and new output byte-identical in seven scenarios. Checklist commit
f725c77f.Follow-ups: none (detached sha is now fixed at 7 characters; accepted as cosmetic)