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

[PATCH] Actually add config variable diff.external

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Dec 17, 2007, 13:42 UTC
Message-ID
<Pine.LNX.4.64.0712171341110.9446@racer.site>
In-Reply-To
<Pine.LNX.4.64.0712171220540.9446@racer.site>

We had the diff.external variable in the documentation of the config file since its conception, but failed to respect it.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
	On Mon, 17 Dec 2007, Johannes Schindelin wrote:
	> Subject: [PATCH] Document diff.external and mergetool.<tool>.path
	> 
	> There was no documentation for the config variables 
	> diff.external and mergetool.<tool>.path.
	Heh.  Missed that diff.external was actually never implemented...
	Also noticed by Sebastian.
 diff.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/diff.c b/diff.c
index 7d17754..a49c36a 100644
--- a/diff.c
+++ b/diff.c
@@ -20,6 +20,7 @@
 static int diff_detect_rename_default;
 static int diff_rename_limit_default = 100;
 static int diff_use_color_default;
+static const char *external_diff_cmd_cfg;
 int diff_auto_refresh_index = 1;
 
 static char diff_colors[][COLOR_MAXLEN] = {
@@ -163,6 +164,10 @@ int git_diff_ui_config(const char *var, const char *value)
 		diff_auto_refresh_index = git_config_bool(var, value);
 		return 0;
 	}
+	if (!strcmp(var, "diff.external")) {
+		external_diff_cmd_cfg = xstrdup(value);
+		return 0;
+	}
 	if (!prefixcmp(var, "diff.")) {
 		const char *ep = strrchr(var, '.');
 
@@ -209,6 +214,8 @@ static const char *external_diff(void)
 	if (done_preparing)
 		return external_diff_cmd;
 	external_diff_cmd = getenv("GIT_EXTERNAL_DIFF");
+	if (!external_diff_cmd)
+		external_diff_cmd = external_diff_cmd_cfg;
 	done_preparing = 1;
 	return external_diff_cmd;
 }
-- 
1.5.4.rc0.59.g1d10d
Previous: Johannes SchindelinNext: Junio C Hamano
Message 2 of 6 in “Document diff.external and mergetool.<tool>.path”
  1. Document diff.external and mergetool.<tool>.pathJohannes Schindelin, Dec 17, 2007
  2. Actually add config variable diff.externalJohannes Schindelin, Dec 17, 2007
  3. Junio C HamanoDec 18, 2007
  4. Johannes SchindelinDec 18, 2007
  5. Junio C HamanoDec 18, 2007
  6. Johannes SchindelinDec 18, 2007

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.