Repository navigation
Conversation
Every git process bb spawns through the shared runGit now carries one set of command-scope config overrides (no colour, a/ b/ prefixes, suppressBlankEmpty and relative off, short submodule format), merged with any GIT_CONFIG_* entries already present, plus LANGUAGE=C so error matching sees English while hooks keep the user's LANG/LC_*. New worktrees refresh their index after git worktree add, waiting into the next second when needed, so status stops re-hashing racily clean files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A second, delayed refresh only ran when checkout and the first refresh finished within the same second, which happens only for small repos whose racily clean entries cost almost nothing to re-hash. It added up to about a second to worktree setup for no measurable status gain. log.showSignature=true made every bb log/show verify commit signatures and print the result into output bb parses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ymichael
deleted the
bb/make-git-machine-reads-ignore-user-git-settings-thr_9c4hyjtuus
branch
November 18, 2026 22:00
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.
Human comments
What was wrong
bb parses git output as if git ran with its defaults, but every git process inherited the user's git config and locale:
color.ui=always,diff.mnemonicPrefix,diff.noprefix,diff.suppressBlankEmptyordiff.submodule=log|diff, the patches bb hands to the Diff panel either fail to parse or parse wrong.diff.relativedrops changes outside the cwd when git runs from a subdirectory.isMissingHeadRevisionErrorand similar matchers look for English stderr. Homebrew git with a non-EnglishLANGanswers in that language, so on a freshgit initrepo the Diff shows a git error instead of the untracked files.git worktree addwrites the index in the same second as the last checked-out files. Nothing bb runs rewrites that index (status usesGIT_OPTIONAL_LOCKS=0), so every status re-hashes those files.Found by auditing recent T3 Code fixes against bb: pingdotgg/t3code#29126 (colour), pingdotgg/t3code#28361 (
diff.relative), pingdotgg/t3code#29579 (suppressBlankEmpty), pingdotgg/t3code#29852 (diff.submodule), pingdotgg/t3code#32252 (LANGUAGE=C) and pingdotgg/t3code#21341 (worktree index refresh).What changed
packages/environment-provider-host/src/workspace-git.ts:resolveGitProcessEnv, which builds the environment for the sharedrunGitand for host-workspace's blob reads, now adds one set of command-scope config overrides throughGIT_CONFIG_COUNT/KEY_n/VALUE_n:color.ui/color.diff/color.branch/color.status=never,diff.noprefix=false,diff.mnemonicPrefix=false,diff.srcPrefix=a/,diff.dstPrefix=b/,diff.suppressBlankEmpty=false,diff.relative=false,diff.submodule=short. Entries that are already present are kept, not overwritten: inherited ones (such as machine credential helpers) go first and caller-supplied ones (such ascore.splitIndex=false) go last. Before this change a caller'sGIT_CONFIG_*replaced the inherited entries.LANGUAGE=Cunless the caller passes its own. gettext then prints English, andLANG/LC_*still reach hooks unchanged.execFile("git")sites. They already setLC_ALL=Cand read only output that doesn't depend on config: storage-retention worktree lists, host-watcher'sstatus --porcelain -z, and the GitHub plugin'sremote get-url.plugins/environment-git-worktree/host/worktree.ts: worktree setup now runsgit update-index -q --refresh --force-write-indexbefore it hands the worktree out. If the rewritten index still falls in the checkout's second, it waits until 50 ms past that second and refreshes again. It skips that second pass if the wait would be 2 s or more (clock mismatch). Failures are ignored and cancellation still propagates.-coptions. A hook that runsgit diffsees standard, uncoloured output.HOST_DAEMON_PROTOCOL_VERSIONis unchanged. No CLI or docs changes.How you verified
Repro on origin/main (02264cf), real daemon: I ran a
pnpm start:worktreeinstance withGIT_CONFIG_GLOBALpointing at a scratch config and a Homebrew git 2.56.1 bottle (German catalog,LANG=de_DE.UTF-8) first on the daemon's PATH. I readbb git diff/bb git patchoutput and fed it to the app's own parser (parseGitDiffFilesfrom@bb/shared-ui):blank.txtwith 2 context linescolor.ui=alwaysdiff.mnemonicPrefix=true""(invalid git diff header diff --git c/… w/…)diff.noprefix=true""diff.suppressBlankEmpty=trueblank.txt1 context line (processFile: invalid rawLine)diff.submodule=logsubmissing;patch sub→ 0 filessubpresentgit initrepoDiff unavailable: git diff --no-ext-diff --binary HEAD failed: Schwerwiegend: mehrdeutiges Argument 'HEAD' …A hi.txt+ patchNew worktree of a 40,000-file repo created by the same instance:
git --no-optional-locks statusmedian (9 runs)The timings ran on a heavily loaded host and are only indicative. The racy-entry count is the deterministic signal.
Tests (each fails on origin/main, passes here):
workspace-git.test.ts › user Git settings on machine reads: a table with one repo per setting (color.ui,color.diff,diff.noprefix,diff.mnemonicPrefix,diff.srcPrefix/dstPrefix,diff.suppressBlankEmpty,diff.relative,diff.submodule=log,diff.submodule=diff). Each runsdiff,log -p,showand a working-treedifffrom a subdirectory and must match the unconfigured repo. The locale case uses a fake git that answers in German unlessLANGUAGE=C, and asserts thatLANG/LC_ALLpass through unchanged. A merge case checks that inherited and callerGIT_CONFIG_*entries survive alongside the overrides. On main: 11 failed. Here: 32/32.environment-git-worktree/host.test.ts › writes a new worktree's index after its checkout second…. On main:expected 1795034299 to be greater than 1795034299. Here: 65/65.pnpm exec turbo run typecheck lintforbb-environment-provider-host,bb-plugin-environment-git-worktreeand@bb/host-workspace: pass.pnpm exec turbo run testforbb-environment-provider-host,bb-plugin-environment-git-worktree,bb-plugin-bb--git,@bb/host-workspace,bb-plugin-bb--github-pr-status,bb-plugin-bb--storage-retentionand@bb/host-daemon(894 passed): pass. Storage-retention timed out 3 tests in the parallel run under load and passed 103/103 alone. It doesn't use the changed code.Not checked: Windows or Linux with a translated git. The locale test is skipped on Windows because its fake git is a shell script.
🤖 Generated with Claude Code