Fossil SCM

Improvements to help text for "diff" and "xdiff".

drh 2021-09-06 13:35 trunk
Commit dc757a5d0854d8774e77f70aee72c45cc59a1ac3721e6ad733f748c7a7414477
2 files changed +7 -5 +33 -23
+7 -5
--- src/diff.c
+++ src/diff.c
@@ -2789,17 +2789,19 @@
27892789
** COMMAND: test-diff
27902790
** COMMAND: xdiff
27912791
**
27922792
** Usage: %fossil xdiff [options] FILE1 FILE2
27932793
**
2794
-** This is the "external diff" feature. By "external" here we mean a diff
2795
-** applied to files that are not under version control. See the "diff"
2796
-** command for computing differences between files that are under control.
2794
+** Compute an "external diff" between two files. By "external diff" we mean
2795
+** a diff between two disk files that are not necessarily under management.
2796
+** In other words, this command provides a mechanism to use Fossil's file
2797
+** difference engine on arbitrary disk files. See the "diff" command for
2798
+** computing differences between files that are* under management.
27972799
**
27982800
** This command prints the differences between the two files FILE1 and FILE2.
2799
-** all of the usual diff command-line options apply. See the "diff" command
2800
-** for a full list of command-line options.
2801
+** all of the usual diff formatting options (--tk, --by, -c N, etc.) apply.
2802
+** See the "diff" command for a full list of command-line options.
28012803
**
28022804
** This command used to be called "test-diff". The older "test-diff" spelling
28032805
** still works, for compatibility.
28042806
*/
28052807
void test_diff_cmd(void){
28062808
--- src/diff.c
+++ src/diff.c
@@ -2789,17 +2789,19 @@
2789 ** COMMAND: test-diff
2790 ** COMMAND: xdiff
2791 **
2792 ** Usage: %fossil xdiff [options] FILE1 FILE2
2793 **
2794 ** This is the "external diff" feature. By "external" here we mean a diff
2795 ** applied to files that are not under version control. See the "diff"
2796 ** command for computing differences between files that are under control.
 
 
2797 **
2798 ** This command prints the differences between the two files FILE1 and FILE2.
2799 ** all of the usual diff command-line options apply. See the "diff" command
2800 ** for a full list of command-line options.
2801 **
2802 ** This command used to be called "test-diff". The older "test-diff" spelling
2803 ** still works, for compatibility.
2804 */
2805 void test_diff_cmd(void){
2806
--- src/diff.c
+++ src/diff.c
@@ -2789,17 +2789,19 @@
2789 ** COMMAND: test-diff
2790 ** COMMAND: xdiff
2791 **
2792 ** Usage: %fossil xdiff [options] FILE1 FILE2
2793 **
2794 ** Compute an "external diff" between two files. By "external diff" we mean
2795 ** a diff between two disk files that are not necessarily under management.
2796 ** In other words, this command provides a mechanism to use Fossil's file
2797 ** difference engine on arbitrary disk files. See the "diff" command for
2798 ** computing differences between files that are* under management.
2799 **
2800 ** This command prints the differences between the two files FILE1 and FILE2.
2801 ** all of the usual diff formatting options (--tk, --by, -c N, etc.) apply.
2802 ** See the "diff" command for a full list of command-line options.
2803 **
2804 ** This command used to be called "test-diff". The older "test-diff" spelling
2805 ** still works, for compatibility.
2806 */
2807 void test_diff_cmd(void){
2808
+33 -23
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -1024,40 +1024,48 @@
10241024
**
10251025
** Usage: %fossil diff|gdiff ?OPTIONS? ?FILE1? ?FILE2 ...?
10261026
**
10271027
** Show the difference between the current version of each of the FILEs
10281028
** specified (as they exist on disk) and that same file as it was checked
1029
-** out. Or if the FILE arguments are omitted, show the unsaved changes
1029
+** out. Or if the FILE arguments are omitted, show all unsaved changes
10301030
** currently in the working check-out.
10311031
**
1032
-** If the "--from VERSION" or "-r VERSION" option is used it specifies
1033
-** the source check-in for the diff operation. If not specified, the
1034
-** source check-in is the base check-in for the current check-out.
1035
-**
1036
-** If the "--to VERSION" option appears, it specifies the check-in from
1037
-** which the second version of the file or files is taken. If there is
1038
-** no "--to" option then the (possibly edited) files in the current check-out
1039
-** are used.
1040
-**
1041
-** The "--checkin VERSION" option shows the changes made by
1042
-** check-in VERSION relative to its primary parent.
1043
-**
1044
-** The "-i" command-line option forces the use of the internal diff logic
1045
-** rather than any external diff program that might be configured using
1046
-** the "setting" command. If no external diff program is configured, then
1047
-** the "-i" option is a no-op. The "-i" option converts "gdiff" into "diff".
1048
-**
1049
-** The "-v" or "--verbose" option causes the complete text of added or
1050
-** deleted files to be displayed. -N and --new-file are aliases for
1051
-** verbose mode.
1032
+** The default output format is a "unified patch" (the same as the
1033
+** output of "diff -u" on most unix systems). Many alternative formats
1034
+** are available. A few of the more useful alternatives:
1035
+**
1036
+** --tk Pop up a TCL/TK-based GUI to show the diff
1037
+** --by Show a side-by-side diff in the default web browser
1038
+** -b Show a linear diff in the default web browser
1039
+** -y Show a text side-by-side diff
1040
+** --webpage Format output as HTML
1041
+** --webpage -y HTML output in the side-by-side format
1042
+**
1043
+** The "--from VERSION" option is used it specifies the source check-in
1044
+** for the diff operation. If not specified, the source check-in is the
1045
+** base check-in for the current check-out. Similarly, the "--to VERSION"
1046
+** option specifies the check-in from which the second version of the file
1047
+** or files is taken. If there is no "--to" option then the (possibly edited)
1048
+** files in the current check-out are used. The "--checkin VERSION" option
1049
+** shows the changes made by check-in VERSION relative to its primary parent.
1050
+** The "--branch BRANCHNAME" shows all then changes on the branch BRANCHNAME.
1051
+**
1052
+** The "-i" command-line option forces the use of Fossils own the internal
1053
+** diff logic rather than any external diff program that might be configured
1054
+** using the "setting" command. If no external diff program is configured,
1055
+** then the "-i" option is a no-op. The "-i" option converts "gdiff" into
1056
+** "diff".
10521057
**
10531058
** The "--diff-binary" option enables or disables the inclusion of binary files
10541059
** when using an external diff program.
10551060
**
10561061
** The "--binary" option causes files matching the glob PATTERN to be treated
10571062
** as binary when considering if they should be used with external diff program.
10581063
** This option overrides the "binary-glob" setting.
1064
+**
1065
+** These command show differences between managed files. Use the "fossil xdiff"
1066
+** command to see differences in unmanaged files.
10591067
**
10601068
** Options:
10611069
** --binary PATTERN Treat files that match the glob PATTERN
10621070
** as binary
10631071
** --branch BRANCH Show diff of all changes on BRANCH
@@ -1064,22 +1072,24 @@
10641072
** --brief Show filenames only
10651073
** -b|--browser Show the diff output in a web-browser
10661074
** --by Shorthand for "--browser -y"
10671075
** --checkin VERSION Show diff of all changes in VERSION
10681076
** --command PROG External diff program. Overrides "diff-command"
1069
-** -c|--context N Use N lines of context
1077
+** -c|--context N Show N lines of context around each change
10701078
** --diff-binary BOOL Include binary files with external commands
10711079
** --exec-abs-paths Force absolute path names on external commands
10721080
** --exec-rel-paths Force relative path names on external commands
10731081
** -r|--from VERSION Select VERSION as source for the diff
10741082
** -w|--ignore-all-space Ignore white space when comparing lines
10751083
** -i|--internal Use internal diff logic
1084
+** --json Output formatted as JSON
10761085
** -N|--new-file Alias for --verbose
10771086
** --numstat Show only the number of lines delete and added
10781087
** -y|--side-by-side Side-by-side diff
10791088
** --strip-trailing-cr Strip trailing CR
1080
-** --tclsh PATH Tcl/Tk used for --tk (default: "tclsh")
1089
+** --tcl TCL-formated output used internally by --tk
1090
+** --tclsh PATH TCL/TK used for --tk (default: "tclsh")
10811091
** --tk Launch a Tcl/Tk GUI for display
10821092
** --to VERSION Select VERSION as target for the diff
10831093
** --undo Diff against the "undo" buffer
10841094
** --unified Unified diff
10851095
** -v|--verbose Output complete text of added or deleted files
10861096
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -1024,40 +1024,48 @@
1024 **
1025 ** Usage: %fossil diff|gdiff ?OPTIONS? ?FILE1? ?FILE2 ...?
1026 **
1027 ** Show the difference between the current version of each of the FILEs
1028 ** specified (as they exist on disk) and that same file as it was checked
1029 ** out. Or if the FILE arguments are omitted, show the unsaved changes
1030 ** currently in the working check-out.
1031 **
1032 ** If the "--from VERSION" or "-r VERSION" option is used it specifies
1033 ** the source check-in for the diff operation. If not specified, the
1034 ** source check-in is the base check-in for the current check-out.
1035 **
1036 ** If the "--to VERSION" option appears, it specifies the check-in from
1037 ** which the second version of the file or files is taken. If there is
1038 ** no "--to" option then the (possibly edited) files in the current check-out
1039 ** are used.
1040 **
1041 ** The "--checkin VERSION" option shows the changes made by
1042 ** check-in VERSION relative to its primary parent.
1043 **
1044 ** The "-i" command-line option forces the use of the internal diff logic
1045 ** rather than any external diff program that might be configured using
1046 ** the "setting" command. If no external diff program is configured, then
1047 ** the "-i" option is a no-op. The "-i" option converts "gdiff" into "diff".
1048 **
1049 ** The "-v" or "--verbose" option causes the complete text of added or
1050 ** deleted files to be displayed. -N and --new-file are aliases for
1051 ** verbose mode.
 
 
 
 
 
1052 **
1053 ** The "--diff-binary" option enables or disables the inclusion of binary files
1054 ** when using an external diff program.
1055 **
1056 ** The "--binary" option causes files matching the glob PATTERN to be treated
1057 ** as binary when considering if they should be used with external diff program.
1058 ** This option overrides the "binary-glob" setting.
 
 
 
1059 **
1060 ** Options:
1061 ** --binary PATTERN Treat files that match the glob PATTERN
1062 ** as binary
1063 ** --branch BRANCH Show diff of all changes on BRANCH
@@ -1064,22 +1072,24 @@
1064 ** --brief Show filenames only
1065 ** -b|--browser Show the diff output in a web-browser
1066 ** --by Shorthand for "--browser -y"
1067 ** --checkin VERSION Show diff of all changes in VERSION
1068 ** --command PROG External diff program. Overrides "diff-command"
1069 ** -c|--context N Use N lines of context
1070 ** --diff-binary BOOL Include binary files with external commands
1071 ** --exec-abs-paths Force absolute path names on external commands
1072 ** --exec-rel-paths Force relative path names on external commands
1073 ** -r|--from VERSION Select VERSION as source for the diff
1074 ** -w|--ignore-all-space Ignore white space when comparing lines
1075 ** -i|--internal Use internal diff logic
 
1076 ** -N|--new-file Alias for --verbose
1077 ** --numstat Show only the number of lines delete and added
1078 ** -y|--side-by-side Side-by-side diff
1079 ** --strip-trailing-cr Strip trailing CR
1080 ** --tclsh PATH Tcl/Tk used for --tk (default: "tclsh")
 
1081 ** --tk Launch a Tcl/Tk GUI for display
1082 ** --to VERSION Select VERSION as target for the diff
1083 ** --undo Diff against the "undo" buffer
1084 ** --unified Unified diff
1085 ** -v|--verbose Output complete text of added or deleted files
1086
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -1024,40 +1024,48 @@
1024 **
1025 ** Usage: %fossil diff|gdiff ?OPTIONS? ?FILE1? ?FILE2 ...?
1026 **
1027 ** Show the difference between the current version of each of the FILEs
1028 ** specified (as they exist on disk) and that same file as it was checked
1029 ** out. Or if the FILE arguments are omitted, show all unsaved changes
1030 ** currently in the working check-out.
1031 **
1032 ** The default output format is a "unified patch" (the same as the
1033 ** output of "diff -u" on most unix systems). Many alternative formats
1034 ** are available. A few of the more useful alternatives:
1035 **
1036 ** --tk Pop up a TCL/TK-based GUI to show the diff
1037 ** --by Show a side-by-side diff in the default web browser
1038 ** -b Show a linear diff in the default web browser
1039 ** -y Show a text side-by-side diff
1040 ** --webpage Format output as HTML
1041 ** --webpage -y HTML output in the side-by-side format
1042 **
1043 ** The "--from VERSION" option is used it specifies the source check-in
1044 ** for the diff operation. If not specified, the source check-in is the
1045 ** base check-in for the current check-out. Similarly, the "--to VERSION"
1046 ** option specifies the check-in from which the second version of the file
1047 ** or files is taken. If there is no "--to" option then the (possibly edited)
1048 ** files in the current check-out are used. The "--checkin VERSION" option
1049 ** shows the changes made by check-in VERSION relative to its primary parent.
1050 ** The "--branch BRANCHNAME" shows all then changes on the branch BRANCHNAME.
1051 **
1052 ** The "-i" command-line option forces the use of Fossils own the internal
1053 ** diff logic rather than any external diff program that might be configured
1054 ** using the "setting" command. If no external diff program is configured,
1055 ** then the "-i" option is a no-op. The "-i" option converts "gdiff" into
1056 ** "diff".
1057 **
1058 ** The "--diff-binary" option enables or disables the inclusion of binary files
1059 ** when using an external diff program.
1060 **
1061 ** The "--binary" option causes files matching the glob PATTERN to be treated
1062 ** as binary when considering if they should be used with external diff program.
1063 ** This option overrides the "binary-glob" setting.
1064 **
1065 ** These command show differences between managed files. Use the "fossil xdiff"
1066 ** command to see differences in unmanaged files.
1067 **
1068 ** Options:
1069 ** --binary PATTERN Treat files that match the glob PATTERN
1070 ** as binary
1071 ** --branch BRANCH Show diff of all changes on BRANCH
@@ -1064,22 +1072,24 @@
1072 ** --brief Show filenames only
1073 ** -b|--browser Show the diff output in a web-browser
1074 ** --by Shorthand for "--browser -y"
1075 ** --checkin VERSION Show diff of all changes in VERSION
1076 ** --command PROG External diff program. Overrides "diff-command"
1077 ** -c|--context N Show N lines of context around each change
1078 ** --diff-binary BOOL Include binary files with external commands
1079 ** --exec-abs-paths Force absolute path names on external commands
1080 ** --exec-rel-paths Force relative path names on external commands
1081 ** -r|--from VERSION Select VERSION as source for the diff
1082 ** -w|--ignore-all-space Ignore white space when comparing lines
1083 ** -i|--internal Use internal diff logic
1084 ** --json Output formatted as JSON
1085 ** -N|--new-file Alias for --verbose
1086 ** --numstat Show only the number of lines delete and added
1087 ** -y|--side-by-side Side-by-side diff
1088 ** --strip-trailing-cr Strip trailing CR
1089 ** --tcl TCL-formated output used internally by --tk
1090 ** --tclsh PATH TCL/TK used for --tk (default: "tclsh")
1091 ** --tk Launch a Tcl/Tk GUI for display
1092 ** --to VERSION Select VERSION as target for the diff
1093 ** --undo Diff against the "undo" buffer
1094 ** --unified Unified diff
1095 ** -v|--verbose Output complete text of added or deleted files
1096

Keyboard Shortcuts

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