Fossil

Check-in [8c4c93b215]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment: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.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 8c4c93b215df5c934e334da745f0f043347008b1ec755119bb5ed8cd6a73e8a5
User & Date: drh 2025-03-17 16:41:31.672
Context
2025-03-17
16:53
Improved error message when --tk fails. check-in: 8dcb0b8a59 user: drh tags: trunk
16:41
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. check-in: 8c4c93b215 user: drh tags: trunk
16:31
If the gdiff-command setting is undefined and if "tclsh" and "wish" are on PATH, then the various "gdiff" commands always try to use --tk as the graphical diff, rather than searching for an external diff program. check-in: 5bec7a698e user: drh tags: trunk
14:02
If the "gdiff-command" setting is not defined when the "fossil gdiff" command is run, go on a search for a suitable replacement. check-in: 954fb421e1 user: drh tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/db.c.
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
** commits.  If enabled on a server, whenever a client attempts
** to obtain a check-in lock during auto-sync, the server will
** send the "pragma avoid-delta-manifests" statement in its reply,
** which will cause the client to avoid generating a delta
** manifest.
*/
/*
** SETTING: gdiff-command    width=40 default=gdiff sensitive
** The value is an external command to run when performing a graphical
** diff. If undefined, text diff will be used.
*/
/*
** SETTING: gmerge-command   width=40 sensitive
** The value is a graphical merge conflict resolver command operating
** on four files.  Examples:







|







4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
** commits.  If enabled on a server, whenever a client attempts
** to obtain a check-in lock during auto-sync, the server will
** send the "pragma avoid-delta-manifests" statement in its reply,
** which will cause the client to avoid generating a delta
** manifest.
*/
/*
** SETTING: gdiff-command    width=40 sensitive
** The value is an external command to run when performing a graphical
** diff. If undefined, text diff will be used.
*/
/*
** SETTING: gmerge-command   width=40 sensitive
** The value is a graphical merge conflict resolver command operating
** on four files.  Examples:
Changes to src/diff.c.
3335
3336
3337
3338
3339
3340
3341




3342
3343
3344
3345
3346
3347
3348
      pCfg->zBinGlob = diff_get_binary_glob();
      zDiffBinary = find_option("diff-binary", 0, 1);
      if( zDiffBinary ){
        if( is_truth(zDiffBinary) ) diffFlags |= DIFF_INCBINARY;
      }else if( db_get_boolean("diff-binary", 1) ){
        diffFlags |= DIFF_INCBINARY;
      }




    }
  }
  if( find_option("verbose","v",0)!=0 ) diffFlags |= DIFF_VERBOSE;
  /* Deprecated, but retained for script compatibility. */
  else if( find_option("new-file","N",0)!=0 ) diffFlags |= DIFF_VERBOSE;

  pCfg->diffFlags = diffFlags;







>
>
>
>







3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
      pCfg->zBinGlob = diff_get_binary_glob();
      zDiffBinary = find_option("diff-binary", 0, 1);
      if( zDiffBinary ){
        if( is_truth(zDiffBinary) ) diffFlags |= DIFF_INCBINARY;
      }else if( db_get_boolean("diff-binary", 1) ){
        diffFlags |= DIFF_INCBINARY;
      }
    }else if( isGDiff) {
      /* No external gdiff command found, using --by */
      diffFlags |= DIFF_HTML|DIFF_WEBPAGE|DIFF_LINENO|DIFF_BROWSER
                     |DIFF_SIDEBYSIDE;
    }
  }
  if( find_option("verbose","v",0)!=0 ) diffFlags |= DIFF_VERBOSE;
  /* Deprecated, but retained for script compatibility. */
  else if( find_option("new-file","N",0)!=0 ) diffFlags |= DIFF_VERBOSE;

  pCfg->diffFlags = diffFlags;
Changes to src/diffcmd.c.
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201


/*
** Return the name of the external diff command, or return NULL if
** no external diff command is defined.
*/
const char *diff_command_external(int guiDiff){
  const char *zResult;
  const char *zName;

  zName = guiDiff ? "gdiff-command" : "diff-command";
  zResult = db_get(zName, "");
  if( zResult[0]==0 ){
    zResult = 0;
    if( guiDiff ){
      static const char *azGuiDiff[] = {
#if defined(_WIN32)
        "winmergeu", "meld", "kdiff3", "bcompare", "vimdiff", "examdiff"
#else
        "meld", "kdiff3"
#endif
      };
      int i;
      for(i=0; i<count(azGuiDiff); i++){
        if( fossil_app_on_path(azGuiDiff[i], 0) ){
          zResult = azGuiDiff[i];
          break;
        }
      }
    }
  }
  return zResult;
}

/*
** Return true if it reasonable to run "diff -tk" for "gdiff".
**
** Details: Return true if all of the following are true:
**







<

<

|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







1163
1164
1165
1166
1167
1168
1169

1170

1171
1172




















1173
1174
1175
1176
1177
1178
1179


/*
** Return the name of the external diff command, or return NULL if
** no external diff command is defined.
*/
const char *diff_command_external(int guiDiff){

  const char *zName;

  zName = guiDiff ? "gdiff-command" : "diff-command";
  return db_get(zName, 0);




















}

/*
** Return true if it reasonable to run "diff -tk" for "gdiff".
**
** Details: Return true if all of the following are true:
**