Subject: Re: [QUESTION] mergetool environment variables

From: Junio C Hamano <[email-masked]>
Date: Sat, 13 Sep 2025 23:38:15 -0700

<[email-masked]> writes:

> Yes, it needs to be in the git install area. Adding export BASE export LOCAL, etc.,
> works to resolve the situation. I wonder whether that should be documented.

I am not a mergetool user, but I do not think that is how the thing
was intended to be used in the first place.

The documentation that may talk about variables BASE etc. (not
"environment variables") are meant for those who add their new tool
to the existing mergetool/difftool infrastructure, which means that
their tool's definition must be dot-sourceable just like any of
these tools defined in mergetools/ directory.  You'd add yours
there, mimicking what they do, and add a handful of shell functions
to be called.  git-mergetool--lib would then use

    . "$MERGE_TOOLS_DIR/${tool%[0-9]}"

inside its setup_tool function to read your definition.