Problem
The gitconfig template incorrectly configures mergiraf as a mergetool when it should only be a merge driver.
Issues:
-
Line 129: Incorrect merge.tool setting
- Currently set to
merge.tool = mergiraf
- Mergiraf is a merge driver (automatic), NOT a mergetool (interactive)
- No
[mergetool "mergiraf"] section exists, causing fallback to nvim unexpectedly
-
Redundant mergetools
- Both
nvim (line 135) and fugitive (line 139) are configured
- Fugitive is a vim plugin, making it redundant with nvim
- Both have aliases (lines 206, 208)
Current Configuration (dot_gitconfig.tmpl)
# Lines 117-119: CORRECT - Merge driver for automatic conflict resolution
[merge "mergiraf"]
name = mergiraf
driver = mergiraf merge --git %O %A %B -s %S -x %X -y %Y -p %P -l %L
# Line 129: INCORRECT - mergiraf is not a mergetool!
[merge]
tool = mergiraf
# Lines 135-142: Redundant tools
[mergetool "nvim"]
cmd = nvim -d "$LOCAL" "$REMOTE" "$MERGED" -c 'wincmd J | wincmd ='
[mergetool "fugitive"]
cmd = nvim -f -c \"Gvdiffsplit!\" \"$MERGED\"
Expected Behavior
According to mergiraf docs:
- Mergiraf should be registered as a merge driver (already correct)
- When mergiraf cannot auto-resolve, git should leave conflict markers
- Users manually invoke a mergetool if needed (e.g.,
git nvimmerge)
Proposed Solution
dot_gitconfig.tmpl changes:
-
Remove or change merge.tool setting (line 129):
[merge]
log = true
conflictstyle = diff3
ff = only
# tool = mergiraf # REMOVE - mergiraf is a driver, not a tool
-
Remove fugitive (redundant):
- Delete lines 139-142:
[mergetool "fugitive"]
- Delete line 208:
fugmerge alias
-
Optional: Set default mergetool to nvim:
[merge]
tool = nvim # Explicit fallback for manual conflict resolution
Also verify gitattributes:
- Ensure
~/.gitattributes_global or .git/info/attributes has:
Or specific extensions: *.py merge=mergiraf
Impact
- Current: Unexpected nvim popups when mergiraf can't auto-merge
- Fixed: Clean failure with conflict markers, user decides when to invoke mergetool
Files to modify:
dot_gitconfig.tmpl
dot_gitattributes_global (verify mergiraf is registered)
README.md (document merge workflow)
Problem
The gitconfig template incorrectly configures mergiraf as a mergetool when it should only be a merge driver.
Issues:
Line 129: Incorrect
merge.toolsettingmerge.tool = mergiraf[mergetool "mergiraf"]section exists, causing fallback to nvim unexpectedlyRedundant mergetools
nvim(line 135) andfugitive(line 139) are configuredCurrent Configuration (dot_gitconfig.tmpl)
Expected Behavior
According to mergiraf docs:
git nvimmerge)Proposed Solution
dot_gitconfig.tmpl changes:
Remove or change
merge.toolsetting (line 129):Remove fugitive (redundant):
[mergetool "fugitive"]fugmergealiasOptional: Set default mergetool to nvim:
Also verify gitattributes:
~/.gitattributes_globalor.git/info/attributeshas:*.py merge=mergirafImpact
Files to modify:
dot_gitconfig.tmpldot_gitattributes_global(verify mergiraf is registered)README.md(document merge workflow)