Hi, all,

another minor milestone has been reached in the long and glorious libfossil
effort: a CLI app which can generate diffs of arbitrary versions:

[stephan@host:~/cvs/fossil/libfossil/f-apps]$ ./f-vdiff prev current
DIFF: a4835dda ==> afaa2806 f-apps/f-adiff.c
@@ -105,7 +105,7 @@
   if(fcli_flag2("h", "html", NULL)){
     diffOpt.diffFlags |= FSL_DIFF_HTML;
   }
-  if(isatty(STDOUT_FILENO)
+  if(fsl_isatty(1)
      && !fcli_flag2("bw", "no-color", NULL)){
     diffOpt.diffFlags |= FSL_DIFF_ANSI_COLOR;
   }
DIFF: 06ec7bc2 ==> 3ed78c3d f-apps/f-vdiff.c
@@ -24,15 +24,42 @@
 /* #include "fossil-scm/fossil-internal.h" */
...

(The output isn't quiet conventions-conformant yet, but the app is only
about 30 minutes old.)

A summary of features and bugs:

[stephan@host:~/cvs/fossil/libfossil/f-apps]$ f-vdiff prev current -?
Usage:
f-vdiff [options]version1 version2

--from|-v1=VERSION the first version. May optionally be provided as the
first non-flag argument.

--to|-v2=VERSION the second version. May optionally be provided as the
second non-flag argument.

--width|-w=INTEGER enables side-by-side diffs width the given width.

--sbs is equivalent to --width=SOME_UNSPECIFIED_DEFAULT.

--no-color|-bw disables ANSI colorizing of output.

--html generates an HTML-format diff.

--invert|-i inverts the diffs (not the versions nor other displayed
components, e.g. ordering of UUIDs).

--glob|-g=STRING only lists changes to filenames matching the given glob.
There is probably a corner case or two involving renamed files, in
particular when diffing against more than one version away from the
original.

KNOWN BUGS:
1) this app cannot currently diff against the checkout version. All the
pieces are in place, it just needs to be done.
2) The unified diff(-like) output is not quite yet patch-compatible.


Whenever you're ready to try out alternatives to some of Fossil's features:

http://fossil.wanderinghorse.net/repos/libfossil/index.cgi/wiki?name=f-tools

PS: for interested C coders: the implementation was not all that difficult,
but it does require an understanding of how to traverse "manifests" in
fossil:

http://fossil.wanderinghorse.net/repos/libfossil/index.cgi/finfo?name=f-apps/f-vdiff.c

-- 
----- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
"Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do." -- Bigby Wolf
_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to