git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/4] Changed the documented variable for mergetool's target file

From
Charles Bailey <charles@hashpling.org>
Date
Feb 17, 2008, 10:23 UTC
Message-ID
<2bc96ddc3df496c5d078c646336c85a15dd8e892.1203242325.git.charles@hashpling.org>
In-Reply-To
<b63a66ef2a97cd3e791476a74bdb7081bcd57637.1203242325.git.charles@hashpling.org>

Previously it was $path, now it is $MERGED which is more consistent with the other documented variables for merge tools and a little more meaningful.

Signed-off-by: Charles Bailey <charles@hashpling.org>
---
 Documentation/config.txt |    2 +-
 git-mergetool.sh         |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 12d87d4..53f790d 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -727,7 +727,7 @@ mergetool.<tool>.cmd::
 	'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; 'path' contains the name of the file to which the merge
+	merged; 'MERGED' contains the name of the file to which the merge
 	tool should write the results of a successful merge.
 
 mergetool.<tool>.trustExitCode::
diff --git a/git-mergetool.sh b/git-mergetool.sh
index cf30e21..4681e9a 100755
--- a/git-mergetool.sh
+++ b/git-mergetool.sh
@@ -275,10 +275,10 @@ merge_file () {
 	    if test -n "$merge_tool_cmd"; then
 		if test "$merge_tool_trust_exit_code" = "false"; then
 		    touch "$BACKUP"
-		    ( eval $merge_tool_cmd )
+		    ( MERGED="$path" eval $merge_tool_cmd )
 		    check_unchanged
 		else
-		    ( eval $merge_tool_cmd )
+		    ( MERGED="$path" eval $merge_tool_cmd )
 		    status=$?
 		fi
 		save_backup
-- 
1.5.4.1.34.g94bf
Previous: Charles BaileyNext: Charles Bailey
Message 2 of 5 in “Teach git mergetool to use custom commands defined at config time”
  1. 1/4 Teach git mergetool to use custom commands defined at config timeCharles Bailey, Feb 17, 2008
  2. 2/4 Changed the documented variable for mergetool's target fileCharles Bailey, Feb 17, 2008
  3. 3/4 Allow a different mergetool command to be used for 'no base' mergesCharles Bailey, Feb 17, 2008
  4. 4/4 Tidy up git mergetool's handling of backup filesCharles Bailey, Feb 17, 2008
  5. Junio C HamanoFeb 17, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.