Fossil SCM

Rename --ignore-space-at-eol to --ignore-eolws|-w, make it work with "fossil stash diff" as well, and make it the default with "fossil diff --tk".

jan.nijtmans 2014-03-03 09:31 diff-eolws
Commit 31d25923bd1626fc1477ea108c68a6aff1febb76
2 files changed +2 +3 -6
+2
--- src/diff.c
+++ src/diff.c
@@ -1838,10 +1838,11 @@
18381838
**
18391839
** --brief Show filenames only DIFF_BRIEF
18401840
** --context|-c N N lines of context. DIFF_CONTEXT_MASK
18411841
** --html Format for HTML DIFF_HTML
18421842
** --invert Invert the diff DIFF_INVERT
1843
+** --ignore-eolws|-w Ignore eol-whitespaces DIFF_IGNORE_EOLWS
18431844
** --linenum|-n Show line numbers DIFF_LINENO
18441845
** --noopt Disable optimization DIFF_NOOPT
18451846
** --side-by-side|-y Side-by-side diff. DIFF_SIDEBYSIDE
18461847
** --unified Unified diff. ~DIFF_SIDEBYSIDE
18471848
** --width|-W N N character lines. DIFF_WIDTH_MASK
@@ -1860,10 +1861,11 @@
18601861
f *= DIFF_CONTEXT_MASK+1;
18611862
if( f > DIFF_WIDTH_MASK ) f = DIFF_CONTEXT_MASK;
18621863
diffFlags |= f;
18631864
}
18641865
if( find_option("html",0,0)!=0 ) diffFlags |= DIFF_HTML;
1866
+ if( find_option("ignore-eolws","w",0)!=0 ) diffFlags |= DIFF_IGNORE_EOLWS;
18651867
if( find_option("linenum","n",0)!=0 ) diffFlags |= DIFF_LINENO;
18661868
if( find_option("noopt",0,0)!=0 ) diffFlags |= DIFF_NOOPT;
18671869
if( find_option("invert",0,0)!=0 ) diffFlags |= DIFF_INVERT;
18681870
if( find_option("brief",0,0)!=0 ) diffFlags |= DIFF_BRIEF;
18691871
return diffFlags;
18701872
--- src/diff.c
+++ src/diff.c
@@ -1838,10 +1838,11 @@
1838 **
1839 ** --brief Show filenames only DIFF_BRIEF
1840 ** --context|-c N N lines of context. DIFF_CONTEXT_MASK
1841 ** --html Format for HTML DIFF_HTML
1842 ** --invert Invert the diff DIFF_INVERT
 
1843 ** --linenum|-n Show line numbers DIFF_LINENO
1844 ** --noopt Disable optimization DIFF_NOOPT
1845 ** --side-by-side|-y Side-by-side diff. DIFF_SIDEBYSIDE
1846 ** --unified Unified diff. ~DIFF_SIDEBYSIDE
1847 ** --width|-W N N character lines. DIFF_WIDTH_MASK
@@ -1860,10 +1861,11 @@
1860 f *= DIFF_CONTEXT_MASK+1;
1861 if( f > DIFF_WIDTH_MASK ) f = DIFF_CONTEXT_MASK;
1862 diffFlags |= f;
1863 }
1864 if( find_option("html",0,0)!=0 ) diffFlags |= DIFF_HTML;
 
1865 if( find_option("linenum","n",0)!=0 ) diffFlags |= DIFF_LINENO;
1866 if( find_option("noopt",0,0)!=0 ) diffFlags |= DIFF_NOOPT;
1867 if( find_option("invert",0,0)!=0 ) diffFlags |= DIFF_INVERT;
1868 if( find_option("brief",0,0)!=0 ) diffFlags |= DIFF_BRIEF;
1869 return diffFlags;
1870
--- src/diff.c
+++ src/diff.c
@@ -1838,10 +1838,11 @@
1838 **
1839 ** --brief Show filenames only DIFF_BRIEF
1840 ** --context|-c N N lines of context. DIFF_CONTEXT_MASK
1841 ** --html Format for HTML DIFF_HTML
1842 ** --invert Invert the diff DIFF_INVERT
1843 ** --ignore-eolws|-w Ignore eol-whitespaces DIFF_IGNORE_EOLWS
1844 ** --linenum|-n Show line numbers DIFF_LINENO
1845 ** --noopt Disable optimization DIFF_NOOPT
1846 ** --side-by-side|-y Side-by-side diff. DIFF_SIDEBYSIDE
1847 ** --unified Unified diff. ~DIFF_SIDEBYSIDE
1848 ** --width|-W N N character lines. DIFF_WIDTH_MASK
@@ -1860,10 +1861,11 @@
1861 f *= DIFF_CONTEXT_MASK+1;
1862 if( f > DIFF_WIDTH_MASK ) f = DIFF_CONTEXT_MASK;
1863 diffFlags |= f;
1864 }
1865 if( find_option("html",0,0)!=0 ) diffFlags |= DIFF_HTML;
1866 if( find_option("ignore-eolws","w",0)!=0 ) diffFlags |= DIFF_IGNORE_EOLWS;
1867 if( find_option("linenum","n",0)!=0 ) diffFlags |= DIFF_LINENO;
1868 if( find_option("noopt",0,0)!=0 ) diffFlags |= DIFF_NOOPT;
1869 if( find_option("invert",0,0)!=0 ) diffFlags |= DIFF_INVERT;
1870 if( find_option("brief",0,0)!=0 ) diffFlags |= DIFF_BRIEF;
1871 return diffFlags;
1872
+3 -6
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -971,18 +971,19 @@
971971
int i;
972972
Blob script;
973973
char *zTempFile = 0;
974974
char *zCmd;
975975
blob_zero(&script);
976
- blob_appendf(&script, "set fossilcmd {| \"%/\" %s --html -y -i -v",
976
+ blob_appendf(&script, "set fossilcmd {| \"%/\" %s --html -y -i -v -w",
977977
g.nameOfExe, zSubCmd);
978978
for(i=firstArg; i<g.argc; i++){
979979
const char *z = g.argv[i];
980980
if( z[0]=='-' ){
981981
if( strglob("*-html",z) ) continue;
982982
if( strglob("*-y",z) ) continue;
983983
if( strglob("*-i",z) ) continue;
984
+ if( strglob("*-w",z) ) continue;
984985
/* The undocumented --script FILENAME option causes the Tk script to
985986
** be written into the FILENAME instead of being run. This is used
986987
** for testing and debugging. */
987988
if( strglob("*-script",z) && i<g.argc-1 ){
988989
i++;
@@ -1085,11 +1086,11 @@
10851086
** --branch BRANCH Show diff of all changes on BRANCH
10861087
** --brief Show filenames only
10871088
** --context|-c N Use N lines of context
10881089
** --diff-binary BOOL Include binary files when using external commands
10891090
** --from|-r VERSION select VERSION as source for the diff
1090
-** --ignore-space-at-eol Ignore changes to end-of-line whitespace
1091
+** --ignore-eolws|-w Ignore changes to end-of-line whitespace
10911092
** --internal|-i use internal diff logic
10921093
** --side-by-side|-y side-by-side diff
10931094
** --tk Launch a Tcl/Tk GUI for display
10941095
** --to VERSION select VERSION as target for the diff
10951096
** --unified unified diff
@@ -1122,14 +1123,10 @@
11221123
verboseFlag = find_option("verbose","v",0)!=0;
11231124
if( !verboseFlag ){
11241125
verboseFlag = find_option("new-file","N",0)!=0; /* deprecated */
11251126
}
11261127
if( verboseFlag ) diffFlags |= DIFF_VERBOSE;
1127
- if( find_option("ignore-space-at-eol",0,0)!=0 ) {
1128
- diffFlags |= DIFF_IGNORE_EOLWS;
1129
- }
1130
-
11311128
if( zBranch ){
11321129
if( zTo || zFrom ){
11331130
fossil_fatal("cannot use --from or --to with --branch");
11341131
}
11351132
zTo = zBranch;
11361133
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -971,18 +971,19 @@
971 int i;
972 Blob script;
973 char *zTempFile = 0;
974 char *zCmd;
975 blob_zero(&script);
976 blob_appendf(&script, "set fossilcmd {| \"%/\" %s --html -y -i -v",
977 g.nameOfExe, zSubCmd);
978 for(i=firstArg; i<g.argc; i++){
979 const char *z = g.argv[i];
980 if( z[0]=='-' ){
981 if( strglob("*-html",z) ) continue;
982 if( strglob("*-y",z) ) continue;
983 if( strglob("*-i",z) ) continue;
 
984 /* The undocumented --script FILENAME option causes the Tk script to
985 ** be written into the FILENAME instead of being run. This is used
986 ** for testing and debugging. */
987 if( strglob("*-script",z) && i<g.argc-1 ){
988 i++;
@@ -1085,11 +1086,11 @@
1085 ** --branch BRANCH Show diff of all changes on BRANCH
1086 ** --brief Show filenames only
1087 ** --context|-c N Use N lines of context
1088 ** --diff-binary BOOL Include binary files when using external commands
1089 ** --from|-r VERSION select VERSION as source for the diff
1090 ** --ignore-space-at-eol Ignore changes to end-of-line whitespace
1091 ** --internal|-i use internal diff logic
1092 ** --side-by-side|-y side-by-side diff
1093 ** --tk Launch a Tcl/Tk GUI for display
1094 ** --to VERSION select VERSION as target for the diff
1095 ** --unified unified diff
@@ -1122,14 +1123,10 @@
1122 verboseFlag = find_option("verbose","v",0)!=0;
1123 if( !verboseFlag ){
1124 verboseFlag = find_option("new-file","N",0)!=0; /* deprecated */
1125 }
1126 if( verboseFlag ) diffFlags |= DIFF_VERBOSE;
1127 if( find_option("ignore-space-at-eol",0,0)!=0 ) {
1128 diffFlags |= DIFF_IGNORE_EOLWS;
1129 }
1130
1131 if( zBranch ){
1132 if( zTo || zFrom ){
1133 fossil_fatal("cannot use --from or --to with --branch");
1134 }
1135 zTo = zBranch;
1136
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -971,18 +971,19 @@
971 int i;
972 Blob script;
973 char *zTempFile = 0;
974 char *zCmd;
975 blob_zero(&script);
976 blob_appendf(&script, "set fossilcmd {| \"%/\" %s --html -y -i -v -w",
977 g.nameOfExe, zSubCmd);
978 for(i=firstArg; i<g.argc; i++){
979 const char *z = g.argv[i];
980 if( z[0]=='-' ){
981 if( strglob("*-html",z) ) continue;
982 if( strglob("*-y",z) ) continue;
983 if( strglob("*-i",z) ) continue;
984 if( strglob("*-w",z) ) continue;
985 /* The undocumented --script FILENAME option causes the Tk script to
986 ** be written into the FILENAME instead of being run. This is used
987 ** for testing and debugging. */
988 if( strglob("*-script",z) && i<g.argc-1 ){
989 i++;
@@ -1085,11 +1086,11 @@
1086 ** --branch BRANCH Show diff of all changes on BRANCH
1087 ** --brief Show filenames only
1088 ** --context|-c N Use N lines of context
1089 ** --diff-binary BOOL Include binary files when using external commands
1090 ** --from|-r VERSION select VERSION as source for the diff
1091 ** --ignore-eolws|-w Ignore changes to end-of-line whitespace
1092 ** --internal|-i use internal diff logic
1093 ** --side-by-side|-y side-by-side diff
1094 ** --tk Launch a Tcl/Tk GUI for display
1095 ** --to VERSION select VERSION as target for the diff
1096 ** --unified unified diff
@@ -1122,14 +1123,10 @@
1123 verboseFlag = find_option("verbose","v",0)!=0;
1124 if( !verboseFlag ){
1125 verboseFlag = find_option("new-file","N",0)!=0; /* deprecated */
1126 }
1127 if( verboseFlag ) diffFlags |= DIFF_VERBOSE;
 
 
 
 
1128 if( zBranch ){
1129 if( zTo || zFrom ){
1130 fossil_fatal("cannot use --from or --to with --branch");
1131 }
1132 zTo = zBranch;
1133

Keyboard Shortcuts

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