From: <rsbecker@nexbridge•com>
To: <git@vger•kernel.org>
Subject: [QUESTION] mergetool environment variables
Date: Fri, 12 Sep 2025 16:16:24 -0400 [thread overview]
Message-ID: <074901dc2422$2039a910$60acfb30$@nexbridge.com> (raw)
I am trying to integrate a custom mergetool with a shell wrapper.
What I get from the online help is the following description referring
to the command and environment variables.
mergetool.<tool>.cmd
Specify the command to invoke the specified merge tool.
The specified command is evaluated in shell with the
following variables available: BASE is the name of a
temporary file containing the common base of the files
to be merged, if available; LOCAL is the name of a
temporary file containing the contents of the file on
the current branch; REMOTE is the name of a temporary
file containing the contents of the file from the branch
being merged; MERGED contains the name of the file
to which the merge tool should write the results of a
successful merge.
When I try to use this from a shell, simply with:
#!/bin/sh
env
exit 1
the described environment variables: BASE, LOCAL,
REMOTE, and MERGED, are not present.
The history is trivial, but has a 1 line conflict after a
git merge. The file is called a, with two lines at the
parent commit and the middle line changed in both
branches being merged. There are correct temp files
in the directory while the shell script is being run. The
merged file looks as follows:
Hello
<<<<<<< HEAD
Ours
=======
Theirs
>>>>>>> Incoming
World
This applies to git 2.45.1 in cygwin and 2.51.0 on NonStop.
There are no upstreams. Is this the problem?
Any thoughts on this?
Thanks,
Randall
--
Brief whoami: NonStop&UNIX developer since approximately
UNIX(421664400)
NonStop(211288444200000000)
-- In real life, I talk too much.
next reply other threads:[~2025-09-12 20:16 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-12 20:16 rsbecker [this message]
2025-09-13 7:04 ` [QUESTION] mergetool environment variables Johannes Sixt
2025-09-13 14:42 ` rsbecker
2025-09-13 21:03 ` Johannes Sixt
2025-09-14 0:18 ` rsbecker
2025-09-14 6:38 ` Junio C Hamano
2025-09-14 13:48 ` Phillip Wood
2025-09-15 15:35 ` D. Ben Knoble
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='074901dc2422$2039a910$60acfb30$@nexbridge.com' \
--to=rsbecker@nexbridge$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox