Fossil SCM

Added the "Colorized Diffs" section to the gitusers doc.

wyoung 2021-01-14 15:36 trunk
Commit f9e3a59174c31f5266afcd5c13acd908f6a06dc2b1cf30eb7b07ded2b9a8f711
1 file changed +23 -1
+23 -1
--- www/gitusers.md
+++ www/gitusers.md
@@ -703,10 +703,32 @@
703703
compatible with Fossil yet which currently has no functional equivalent.
704704
We cover [this and the workaround for it](#csplit) above.
705705
706706
[3]: ./rebaseharm.md
707707
708
+
709
+## <a name="cdiff"></a> Colorized Diffs
710
+
711
+The graphical diffs in the Fossil web UI and `fossil diff --tk` use
712
+color to distinguish insertions, deletions, and replacements, but unlike
713
+with `git diff` when the output is to an ANSI X3.64 capable terminal,
714
+`fossil diff` does not.
715
+
716
+There’s an easy way to add this feature to Fossil, though: install
717
+[`colordiff`][cdiff], which is included in [many package systems][cdpkg],
718
+then say:
719
+
720
+ fossil set --global diff-command 'colordiff -wu'
721
+
722
+Because this is unconditional, unlike `git diff --color=auto`, you will
723
+then have to remember to add the `-i` option to `fossil diff` commands
724
+when you want color disabled, such as when piping diff output to another
725
+command that doesn’t understand ANSI escape sequences. There’s an
726
+example of this [below](#dstat).
727
+
728
+[cdpkg]: https://repology.org/project/colordiff/versions
729
+
708730
709731
## <a id="show"></a> Showing Information About Commits
710732
711733
While there is no direct equivalent to Git’s “`show`” command, similar
712734
functionality may be present in Fossil under other commands:
@@ -770,11 +792,11 @@
770792
771793
We gave the `-i` flag in both cases to force Fossil to use its internal
772794
diff implementation, bypassing [your local `diff-command` setting][dcset].
773795
The `--numstat` option has no effect when you have an external diff
774796
command set, and some diff command alternatives like
775
-[`colordiff`][cdiff] produce output that confuses `diffstat`.
797
+[`colordiff`][cdiff] (covered [above](#cdiff)) produce output that confuses `diffstat`.
776798
777799
If you leave off the `-N` flag in the second example, the `diffstat`
778800
output won’t include info about any newly-added files.
779801
780802
[cdiff]: https://www.colordiff.org/
781803
--- www/gitusers.md
+++ www/gitusers.md
@@ -703,10 +703,32 @@
703 compatible with Fossil yet which currently has no functional equivalent.
704 We cover [this and the workaround for it](#csplit) above.
705
706 [3]: ./rebaseharm.md
707
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
708
709 ## <a id="show"></a> Showing Information About Commits
710
711 While there is no direct equivalent to Git’s “`show`” command, similar
712 functionality may be present in Fossil under other commands:
@@ -770,11 +792,11 @@
770
771 We gave the `-i` flag in both cases to force Fossil to use its internal
772 diff implementation, bypassing [your local `diff-command` setting][dcset].
773 The `--numstat` option has no effect when you have an external diff
774 command set, and some diff command alternatives like
775 [`colordiff`][cdiff] produce output that confuses `diffstat`.
776
777 If you leave off the `-N` flag in the second example, the `diffstat`
778 output won’t include info about any newly-added files.
779
780 [cdiff]: https://www.colordiff.org/
781
--- www/gitusers.md
+++ www/gitusers.md
@@ -703,10 +703,32 @@
703 compatible with Fossil yet which currently has no functional equivalent.
704 We cover [this and the workaround for it](#csplit) above.
705
706 [3]: ./rebaseharm.md
707
708
709 ## <a name="cdiff"></a> Colorized Diffs
710
711 The graphical diffs in the Fossil web UI and `fossil diff --tk` use
712 color to distinguish insertions, deletions, and replacements, but unlike
713 with `git diff` when the output is to an ANSI X3.64 capable terminal,
714 `fossil diff` does not.
715
716 There’s an easy way to add this feature to Fossil, though: install
717 [`colordiff`][cdiff], which is included in [many package systems][cdpkg],
718 then say:
719
720 fossil set --global diff-command 'colordiff -wu'
721
722 Because this is unconditional, unlike `git diff --color=auto`, you will
723 then have to remember to add the `-i` option to `fossil diff` commands
724 when you want color disabled, such as when piping diff output to another
725 command that doesn’t understand ANSI escape sequences. There’s an
726 example of this [below](#dstat).
727
728 [cdpkg]: https://repology.org/project/colordiff/versions
729
730
731 ## <a id="show"></a> Showing Information About Commits
732
733 While there is no direct equivalent to Git’s “`show`” command, similar
734 functionality may be present in Fossil under other commands:
@@ -770,11 +792,11 @@
792
793 We gave the `-i` flag in both cases to force Fossil to use its internal
794 diff implementation, bypassing [your local `diff-command` setting][dcset].
795 The `--numstat` option has no effect when you have an external diff
796 command set, and some diff command alternatives like
797 [`colordiff`][cdiff] (covered [above](#cdiff)) produce output that confuses `diffstat`.
798
799 If you leave off the `-N` flag in the second example, the `diffstat`
800 output won’t include info about any newly-added files.
801
802 [cdiff]: https://www.colordiff.org/
803

Keyboard Shortcuts

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