fixup! mergetools: simplify how we handle "vim" and "defaults"
PATCH 1/1 fixup! mergetools: simplify how we handle "vim" and "defaults"
---
Junio, please can you squash this into f9924e5 on jk/mergetool, providing that David is OK with that?
The original change breaks custom mergetool by making changing the logic around default functions so that they are now only defined when the tool file exists in $MERGE_TOOLS_DIR but we need the default implementations when a custom tool is in use, which by definition means that the file doesn't exist in $MERGE_TOOLS_DIR.
git-mergetool--lib.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
git-mergetool--lib.sh +9 -9
@@ -48,15 +48,6 @@ valid_tool () { setup_tool () { tool="$1" - if ! test -f "$MERGE_TOOLS_DIR/$tool" - then - # Use a special return code for this case since we want to - # source "defaults" even when an explicit tool path is - # configured since the user can use that to override the - # default path in the scriptlet. - return 2 - fi - # Fallback definitions, to be overriden by tools. can_merge () { return 0
@@ -80,6 +71,15 @@ setup_tool () { echo "$1" } + if ! test -f "$MERGE_TOOLS_DIR/$tool" + then + # Use a special return code for this case since we want to + # source "defaults" even when an explicit tool path is + # configured since the user can use that to override the + # default path in the scriptlet. + return 2 + fi + # Load the redefined functions . "$MERGE_TOOLS_DIR/$tool"
Signature · 1 line
1.8.1.1
Quoted 3 lines · John Keeping
---
Junio, please can you squash this into f9924e5 on jk/mergetool, providing that David is OK with that?
This looks good to me.
Quoted 47 lines
The original change breaks custom mergetool by making changing the logic around default functions so that they are now only defined when the tool file exists in $MERGE_TOOLS_DIR but we need the default implementations when a custom tool is in use, which by definition means that the file doesn't exist in $MERGE_TOOLS_DIR.
git-mergetool--lib.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)git-mergetool--lib.sh +9
-10@@ -48,15 +48,6 @@ valid_tool () { setup_tool () { tool="$1" - if ! test -f "$MERGE_TOOLS_DIR/$tool" - then - # Use a special return code for this case since we want to - # source "defaults" even when an explicit tool path is - # configured since the user can use that to override the - # default path in the scriptlet. - return 2 - fi - # Fallback definitions, to be overriden by tools. can_merge () { return 0@@ -80,6 +71,15 @@ setup_tool () { echo "$1" } + if ! test -f "$MERGE_TOOLS_DIR/$tool" + then + # Use a special return code for this case since we want to + # source "defaults" even when an explicit tool path is + # configured since the user can use that to override the + # default path in the scriptlet. + return 2 + fi + # Load the redefined functions . "$MERGE_TOOLS_DIR/$tool" --1.8.1.1
Signature · 1 line
David
Quoted 6 lines · David Aguilar
Quoted 3 lines · John Keeping
---
Junio, please can you squash this into f9924e5 on jk/mergetool, providing that David is OK with that?This looks good to me.
Thanks for a quick response. Will squash this in and rebuild the two affected branches.