feat(setup): weave setup --global (#110) - #119
Merged
Merged
Conversation
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).
There was a problem hiding this comment.
inspect review
Triage: 7 entities analyzed | 0 critical, 0 high, 4 medium, 3 low
Verdict: standard_review
Findings (4)
- [low] Conflicting flags:
localandglobalcan both be true simultaneously, leading to undefined behavior. Inattributes_target(), if both are true,globaltakes precedence andlocalis silently ignored. This violates user expectations and could cause confusion. - [low] Git repo check is bypassed when
global=true, butgit_path()is still called whenlocal=trueandglobal=false. If user runsweave setup --localoutside a git repo, the code will fail atgit_path("info/attributes")with a confusing error instead of the clear "Not in a git repository" message. - [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~usernamedirectory. - [low] In
global_attributes_path(), whencore.attributesfileis not set or empty, the fallback path usesHOMEorUSERPROFILEenvironment variables. However, on Windows, the correct path should useUSERPROFILEwith 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
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.
Closes #110.
Adds a
weave setup --globalflag that configures git in~/.gitconfigand writes the supported file-type rules to git's global attributes file (~/.config/git/attributes, orcore.attributesfileif 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.)