Skip to content

feat(setup): weave setup --global (#110) - #119

Merged
rs545837 merged 1 commit into
mainfrom
feat/setup-global
Jun 26, 2026
Merged

feat(setup): weave setup --global (#110)#119
rs545837 merged 1 commit into
mainfrom
feat/setup-global

Conversation

@rs545837

Copy link
Copy Markdown
Member

Closes #110.

Adds a weave setup --global flag that configures git in ~/.gitconfig and writes the supported file-type rules to git's global attributes file (~/.config/git/attributes, or core.attributesfile if set), so weave becomes the default merge driver in every repo with no per-repo setup — the mergiraf-style flow @mikkelam asked for. No git repo required to run it. Documented in the README.

(#107 and #24 are covered by @edouard-andrei's #112 and #113.)

Add a --global flag that configures git in ~/.gitconfig and writes the
supported file-type rules to git's global attributes file
(~/.config/git/attributes, or core.attributesfile if set), so weave is the
default merge driver in every repo with no per-repo setup. No git repo
required. Documents the global path in the README (the mergiraf-style flow
mikkelam asked for).

@inspect-review inspect-review Bot 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.

inspect review

Triage: 7 entities analyzed | 0 critical, 0 high, 4 medium, 3 low
Verdict: standard_review

Findings (4)

  1. [low] Conflicting flags: local and global can both be true simultaneously, leading to undefined behavior. In attributes_target(), if both are true, global takes precedence and local is silently ignored. This violates user expectations and could cause confusion.
  2. [low] Git repo check is bypassed when global=true, but git_path() is still called when local=true and global=false. If user runs weave setup --local outside a git repo, the code will fail at git_path("info/attributes") with a confusing error instead of the clear "Not in a git repository" message.
  3. [low] In global_attributes_path(), the tilde expansion only handles ~/ prefix but git config can return other forms like ~username/path. This will fail to expand correctly and create a literal ~username directory.
  4. [low] In global_attributes_path(), when core.attributesfile is not set or empty, the fallback path uses HOME or USERPROFILE environment variables. However, on Windows, the correct path should use USERPROFILE with a different structure (not ~/.config/git/attributes). The code assumes Unix-style paths for the default case, which will create incorrect paths on Windows.

Reviewed by inspect | Entity-level triage found 0 high-risk changes

@rs545837
rs545837 merged commit b4d500b into main Jun 26, 2026
2 of 3 checks passed
@rs545837
rs545837 deleted the feat/setup-global branch June 26, 2026 18: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.

Global installation instructions

1 participant