Fossil SCM

Backout the prior change that hunts for third-party apps to use for gdiff if the gdiff-command setting is undefined. Instead, first try to use the --tk option, and if that doesn't work use the --by option.

drh 2025-03-17 16:41 trunk
Commit 8c4c93b215df5c934e334da745f0f043347008b1ec755119bb5ed8cd6a73e8a5
3 files changed +1 -1 +4 +1 -23
+1 -1
--- src/db.c
+++ src/db.c
@@ -4842,11 +4842,11 @@
48424842
** send the "pragma avoid-delta-manifests" statement in its reply,
48434843
** which will cause the client to avoid generating a delta
48444844
** manifest.
48454845
*/
48464846
/*
4847
-** SETTING: gdiff-command width=40 default=gdiff sensitive
4847
+** SETTING: gdiff-command width=40 sensitive
48484848
** The value is an external command to run when performing a graphical
48494849
** diff. If undefined, text diff will be used.
48504850
*/
48514851
/*
48524852
** SETTING: gmerge-command width=40 sensitive
48534853
--- src/db.c
+++ src/db.c
@@ -4842,11 +4842,11 @@
4842 ** send the "pragma avoid-delta-manifests" statement in its reply,
4843 ** which will cause the client to avoid generating a delta
4844 ** manifest.
4845 */
4846 /*
4847 ** SETTING: gdiff-command width=40 default=gdiff sensitive
4848 ** The value is an external command to run when performing a graphical
4849 ** diff. If undefined, text diff will be used.
4850 */
4851 /*
4852 ** SETTING: gmerge-command width=40 sensitive
4853
--- src/db.c
+++ src/db.c
@@ -4842,11 +4842,11 @@
4842 ** send the "pragma avoid-delta-manifests" statement in its reply,
4843 ** which will cause the client to avoid generating a delta
4844 ** manifest.
4845 */
4846 /*
4847 ** SETTING: gdiff-command width=40 sensitive
4848 ** The value is an external command to run when performing a graphical
4849 ** diff. If undefined, text diff will be used.
4850 */
4851 /*
4852 ** SETTING: gmerge-command width=40 sensitive
4853
+4
--- src/diff.c
+++ src/diff.c
@@ -3337,10 +3337,14 @@
33373337
if( zDiffBinary ){
33383338
if( is_truth(zDiffBinary) ) diffFlags |= DIFF_INCBINARY;
33393339
}else if( db_get_boolean("diff-binary", 1) ){
33403340
diffFlags |= DIFF_INCBINARY;
33413341
}
3342
+ }else if( isGDiff) {
3343
+ /* No external gdiff command found, using --by */
3344
+ diffFlags |= DIFF_HTML|DIFF_WEBPAGE|DIFF_LINENO|DIFF_BROWSER
3345
+ |DIFF_SIDEBYSIDE;
33423346
}
33433347
}
33443348
if( find_option("verbose","v",0)!=0 ) diffFlags |= DIFF_VERBOSE;
33453349
/* Deprecated, but retained for script compatibility. */
33463350
else if( find_option("new-file","N",0)!=0 ) diffFlags |= DIFF_VERBOSE;
33473351
--- src/diff.c
+++ src/diff.c
@@ -3337,10 +3337,14 @@
3337 if( zDiffBinary ){
3338 if( is_truth(zDiffBinary) ) diffFlags |= DIFF_INCBINARY;
3339 }else if( db_get_boolean("diff-binary", 1) ){
3340 diffFlags |= DIFF_INCBINARY;
3341 }
 
 
 
 
3342 }
3343 }
3344 if( find_option("verbose","v",0)!=0 ) diffFlags |= DIFF_VERBOSE;
3345 /* Deprecated, but retained for script compatibility. */
3346 else if( find_option("new-file","N",0)!=0 ) diffFlags |= DIFF_VERBOSE;
3347
--- src/diff.c
+++ src/diff.c
@@ -3337,10 +3337,14 @@
3337 if( zDiffBinary ){
3338 if( is_truth(zDiffBinary) ) diffFlags |= DIFF_INCBINARY;
3339 }else if( db_get_boolean("diff-binary", 1) ){
3340 diffFlags |= DIFF_INCBINARY;
3341 }
3342 }else if( isGDiff) {
3343 /* No external gdiff command found, using --by */
3344 diffFlags |= DIFF_HTML|DIFF_WEBPAGE|DIFF_LINENO|DIFF_BROWSER
3345 |DIFF_SIDEBYSIDE;
3346 }
3347 }
3348 if( find_option("verbose","v",0)!=0 ) diffFlags |= DIFF_VERBOSE;
3349 /* Deprecated, but retained for script compatibility. */
3350 else if( find_option("new-file","N",0)!=0 ) diffFlags |= DIFF_VERBOSE;
3351
+1 -23
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -1165,35 +1165,13 @@
11651165
/*
11661166
** Return the name of the external diff command, or return NULL if
11671167
** no external diff command is defined.
11681168
*/
11691169
const char *diff_command_external(int guiDiff){
1170
- const char *zResult;
11711170
const char *zName;
1172
-
11731171
zName = guiDiff ? "gdiff-command" : "diff-command";
1174
- zResult = db_get(zName, "");
1175
- if( zResult[0]==0 ){
1176
- zResult = 0;
1177
- if( guiDiff ){
1178
- static const char *azGuiDiff[] = {
1179
-#if defined(_WIN32)
1180
- "winmergeu", "meld", "kdiff3", "bcompare", "vimdiff", "examdiff"
1181
-#else
1182
- "meld", "kdiff3"
1183
-#endif
1184
- };
1185
- int i;
1186
- for(i=0; i<count(azGuiDiff); i++){
1187
- if( fossil_app_on_path(azGuiDiff[i], 0) ){
1188
- zResult = azGuiDiff[i];
1189
- break;
1190
- }
1191
- }
1192
- }
1193
- }
1194
- return zResult;
1172
+ return db_get(zName, 0);
11951173
}
11961174
11971175
/*
11981176
** Return true if it reasonable to run "diff -tk" for "gdiff".
11991177
**
12001178
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -1165,35 +1165,13 @@
1165 /*
1166 ** Return the name of the external diff command, or return NULL if
1167 ** no external diff command is defined.
1168 */
1169 const char *diff_command_external(int guiDiff){
1170 const char *zResult;
1171 const char *zName;
1172
1173 zName = guiDiff ? "gdiff-command" : "diff-command";
1174 zResult = db_get(zName, "");
1175 if( zResult[0]==0 ){
1176 zResult = 0;
1177 if( guiDiff ){
1178 static const char *azGuiDiff[] = {
1179 #if defined(_WIN32)
1180 "winmergeu", "meld", "kdiff3", "bcompare", "vimdiff", "examdiff"
1181 #else
1182 "meld", "kdiff3"
1183 #endif
1184 };
1185 int i;
1186 for(i=0; i<count(azGuiDiff); i++){
1187 if( fossil_app_on_path(azGuiDiff[i], 0) ){
1188 zResult = azGuiDiff[i];
1189 break;
1190 }
1191 }
1192 }
1193 }
1194 return zResult;
1195 }
1196
1197 /*
1198 ** Return true if it reasonable to run "diff -tk" for "gdiff".
1199 **
1200
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -1165,35 +1165,13 @@
1165 /*
1166 ** Return the name of the external diff command, or return NULL if
1167 ** no external diff command is defined.
1168 */
1169 const char *diff_command_external(int guiDiff){
 
1170 const char *zName;
 
1171 zName = guiDiff ? "gdiff-command" : "diff-command";
1172 return db_get(zName, 0);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1173 }
1174
1175 /*
1176 ** Return true if it reasonable to run "diff -tk" for "gdiff".
1177 **
1178

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button