From 16a1d7e3bac7d9890a6b2642373794a1ab95d6b8 Mon Sep 17 00:00:00 2001 From: George Vaintrub Date: Sun, 31 May 2026 14:01:46 +0100 Subject: [PATCH] fix(git): gate merge.conflictStyle zdiff3 on git >= 2.35 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit zdiff3 was added in git 2.35.0; older git (Ubuntu jammy = 2.34.1) errors 'unknown style zdiff3' on checkout/merge — surfaced on the jetson during mise upgrade (git failed reclone). Render-time gate via git --version: zdiff3 on >=2.35, diff3 (universally supported) below. git --version doesn't read merge config, so this renders even on a currently-broken box. --- dot_gitconfig.tmpl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dot_gitconfig.tmpl b/dot_gitconfig.tmpl index fd32dea..96c8359 100644 --- a/dot_gitconfig.tmpl +++ b/dot_gitconfig.tmpl @@ -45,7 +45,14 @@ autoSetupRemote = true [merge] +{{- $gitVersion := output "git" "--version" | regexFind "[0-9]+\\.[0-9]+\\.[0-9]+" }} + # zdiff3 (zealous diff3) needs git >= 2.35; older git (e.g. Ubuntu jammy + # 2.34) errors "unknown style 'zdiff3'" on checkout/merge. diff3 elsewhere. +{{- if semverCompare ">=2.35.0" $gitVersion }} conflictStyle = zdiff3 +{{- else }} + conflictStyle = diff3 +{{- end }} [rebase] autoSquash = true