Fossil SCM

"fossil gdiff" uses internal diff under some conditions

Closed

1457156b277688c… · opened 16 years, 3 months ago

Type
Feature_Request
Priority
Severity
Minor
Resolution
Works_As_Designed
Subsystem
Created
Jan. 10, 2010 10:49 a.m.

Do for example: "fossil set gdiff bcompare" (to use Beyond Compare). Modify some file, so that "fossil diff" works.

Now, if you type "fossil gdiff whatever-file", then fossil will launch the set gdiff program. But if you only type "fossil gdiff", without any file name, it will only do the internal diff.


drh added on 2010-01-10 12:51:02:
Some gui differs (at least the one I use) will only diff a single pair of files at a time. So if you do:

fossil gdiff

And multiple files have changed, how is that suppose to work? Do you only show changes in one file? Does fossil try to concatenate all the changed files into one big file and diff those? Do you launch multiple instances of the gui differ?


anonymous added on 2010-01-10 13:03:43:
OK; but that behavior should be documented. As it is, it seems that it would show diffs for the entire tree (no, I don't know how that would work in fact -- but that's what the documentation as it stands would lead me to expect)


altufaltu added on 2010-01-11 04:49:59:
Can't one call external diff tool for each modified file? User may get multiple instances for diffs (in which case he may not use gdiff at all) or if the diff tool is smart, multiple diff windows in single instance.


anonymous claiming to be ron added on 2010-01-11 20:11:14:
Yes; "bcompare" for instance, puts all the files in separate tabs within one window (at least it does on Linux)


altufaltu added on 2010-01-15 09:30:28:
Here is the patch, if somebody is interested:


--- src/diffcmd.c
+++ src/diffcmd.c
@@ -267,13 +267,14 @@
       printf("ADDED_BY_MERGE %s\n", zPathname);
     }else{
       int srcid = db_column_int(&q, 4);
       Blob content;
       content_get(srcid, &content);
-      printf("Index: %s\n======================================="
-             "============================\n",
-             zPathname
+      if (!zDiffCmd)
+        printf("Index: %s\n======================================="
+               "============================\n",
+               zPathname
       );
       diff_file(&content, zFullName, zPathname, zDiffCmd);
       blob_reset(&content);
     }
     free(zFullName);
@@ -353,11 +354,11 @@
   zTo = find_option("to", 0, 1);

   if( zTo==0 ){
     db_must_be_within_tree();
     verify_all_options();
-    if( !isInternDiff && g.argc==3 ){
+    if( !isInternDiff ){
       zDiffCmd = db_get(isGDiff ? "gdiff-command" : "diff-command", 0);
     }
     if( g.argc==3 ){
       diff_one_against_disk(zFrom, zDiffCmd);
     }else{

Keyboard Shortcuts

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