From 3706eda8f3db4b30a53c1c952a86844fbf104eab Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Wed, 10 Jan 2024 22:20:30 -0500 Subject: [PATCH] Use meld for git merges. --- ansible/roles/base/files/gitconfig_home | 15 +++++++++++++++ ansible/roles/base/files/gitconfig_work | 15 +++++++++++++++ ansible/roles/base/tasks/common.yaml | 1 + 3 files changed, 31 insertions(+) diff --git a/ansible/roles/base/files/gitconfig_home b/ansible/roles/base/files/gitconfig_home index 139287f..a03f09d 100644 --- a/ansible/roles/base/files/gitconfig_home +++ b/ansible/roles/base/files/gitconfig_home @@ -18,3 +18,18 @@ date = local [init] defaultBranch = main + +# Use meld for `git difftool` and `git mergetool` +[diff] + tool = meld +[difftool] + prompt = false +[difftool "meld"] + cmd = meld "$LOCAL" "$REMOTE" +[merge] + tool = meld +[mergetool "meld"] + # Make the middle pane start with partially-merged contents: + cmd = meld "$LOCAL" "$MERGED" "$REMOTE" --output "$MERGED" + # Make the middle pane start without any merge progress: + # cmd = meld "$LOCAL" "$BASE" "$REMOTE" --output "$MERGED" diff --git a/ansible/roles/base/files/gitconfig_work b/ansible/roles/base/files/gitconfig_work index dfc0231..c9b2a3e 100644 --- a/ansible/roles/base/files/gitconfig_work +++ b/ansible/roles/base/files/gitconfig_work @@ -18,3 +18,18 @@ date = local [init] defaultBranch = main + +# Use meld for `git difftool` and `git mergetool` +[diff] + tool = meld +[difftool] + prompt = false +[difftool "meld"] + cmd = meld "$LOCAL" "$REMOTE" +[merge] + tool = meld +[mergetool "meld"] + # Make the middle pane start with partially-merged contents: + cmd = meld "$LOCAL" "$MERGED" "$REMOTE" --output "$MERGED" + # Make the middle pane start without any merge progress: + # cmd = meld "$LOCAL" "$BASE" "$REMOTE" --output "$MERGED" diff --git a/ansible/roles/base/tasks/common.yaml b/ansible/roles/base/tasks/common.yaml index 4d2dcf8..f83db1f 100644 --- a/ansible/roles/base/tasks/common.yaml +++ b/ansible/roles/base/tasks/common.yaml @@ -17,6 +17,7 @@ - colordiff - ipcalc - kdiff3 + - meld - tcpdump - moreutils # for ts [%Y-%m-%d %H:%M:%.S] - ddrescue