Repository navigation
refactor(git): include the agent config instead of replacing the global one - #52
Merged
Merged
Conversation
…al one Load users/home/git/agent.gitconfig through an env-provided include.path (GIT_CONFIG_COUNT/KEY/VALUE in ~/.claude/settings.json) instead of GIT_CONFIG_GLOBAL. The normal global config keeps loading, a missing file is skipped rather than dropping the whole global config and identity with it, and `git config --global` writes the normal config. That makes the Nix store copy at ~/.config/git-agent unnecessary, so the file stays in the version-controlled ~/.config/git folder symlink. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
PR #51 loads the agent git config through
GIT_CONFIG_GLOBAL, which replaces the global config. That forced a Nix store copy at~/.config/git-agent/config: otherwise a missing file (an older branch in the main checkout) would silently drop the whole global config, identity included. It also put an extra folder next to~/.config/git.This loads it as an include from the environment instead (
GIT_CONFIG_COUNT=1,GIT_CONFIG_KEY_0=include.path,GIT_CONFIG_VALUE_0=~/.config/git/agent.gitconfig, set in~/.claude/settings.json). The normal global config keeps loading. A missing file is skipped, so agents just get plain git.git config --globalwrites the normal config, as in a terminal. So the file stays in the version-controlled~/.config/gitfolder symlink, thegit-agentstore copy goes, andagent.gitconfigno longer includes the normal config itself..git/config, soagent.gitconfigmust hold only output settings, never identity or editor. That's also why the old[include]of the normal config is removed.GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=include.path GIT_CONFIG_VALUE_0=$PWD/users/home/git/agent.gitconfig git statusmake homeneeded for the file;make homeremoves the stale~/.config/git-agent), then add the threeenventries to~/.claude/settings.json.🤖 Generated with Claude Code