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".
Commit
31d25923bd1626fc1477ea108c68a6aff1febb76
Parent
554607d35b835ba…
2 files changed
+2
+3
-6
+2
| --- src/diff.c | ||
| +++ src/diff.c | ||
| @@ -1838,10 +1838,11 @@ | ||
| 1838 | 1838 | ** |
| 1839 | 1839 | ** --brief Show filenames only DIFF_BRIEF |
| 1840 | 1840 | ** --context|-c N N lines of context. DIFF_CONTEXT_MASK |
| 1841 | 1841 | ** --html Format for HTML DIFF_HTML |
| 1842 | 1842 | ** --invert Invert the diff DIFF_INVERT |
| 1843 | +** --ignore-eolws|-w Ignore eol-whitespaces DIFF_IGNORE_EOLWS | |
| 1843 | 1844 | ** --linenum|-n Show line numbers DIFF_LINENO |
| 1844 | 1845 | ** --noopt Disable optimization DIFF_NOOPT |
| 1845 | 1846 | ** --side-by-side|-y Side-by-side diff. DIFF_SIDEBYSIDE |
| 1846 | 1847 | ** --unified Unified diff. ~DIFF_SIDEBYSIDE |
| 1847 | 1848 | ** --width|-W N N character lines. DIFF_WIDTH_MASK |
| @@ -1860,10 +1861,11 @@ | ||
| 1860 | 1861 | f *= DIFF_CONTEXT_MASK+1; |
| 1861 | 1862 | if( f > DIFF_WIDTH_MASK ) f = DIFF_CONTEXT_MASK; |
| 1862 | 1863 | diffFlags |= f; |
| 1863 | 1864 | } |
| 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; | |
| 1865 | 1867 | if( find_option("linenum","n",0)!=0 ) diffFlags |= DIFF_LINENO; |
| 1866 | 1868 | if( find_option("noopt",0,0)!=0 ) diffFlags |= DIFF_NOOPT; |
| 1867 | 1869 | if( find_option("invert",0,0)!=0 ) diffFlags |= DIFF_INVERT; |
| 1868 | 1870 | if( find_option("brief",0,0)!=0 ) diffFlags |= DIFF_BRIEF; |
| 1869 | 1871 | return diffFlags; |
| 1870 | 1872 |
| --- 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 @@ | ||
| 971 | 971 | int i; |
| 972 | 972 | Blob script; |
| 973 | 973 | char *zTempFile = 0; |
| 974 | 974 | char *zCmd; |
| 975 | 975 | 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", | |
| 977 | 977 | g.nameOfExe, zSubCmd); |
| 978 | 978 | for(i=firstArg; i<g.argc; i++){ |
| 979 | 979 | const char *z = g.argv[i]; |
| 980 | 980 | if( z[0]=='-' ){ |
| 981 | 981 | if( strglob("*-html",z) ) continue; |
| 982 | 982 | if( strglob("*-y",z) ) continue; |
| 983 | 983 | if( strglob("*-i",z) ) continue; |
| 984 | + if( strglob("*-w",z) ) continue; | |
| 984 | 985 | /* The undocumented --script FILENAME option causes the Tk script to |
| 985 | 986 | ** be written into the FILENAME instead of being run. This is used |
| 986 | 987 | ** for testing and debugging. */ |
| 987 | 988 | if( strglob("*-script",z) && i<g.argc-1 ){ |
| 988 | 989 | i++; |
| @@ -1085,11 +1086,11 @@ | ||
| 1085 | 1086 | ** --branch BRANCH Show diff of all changes on BRANCH |
| 1086 | 1087 | ** --brief Show filenames only |
| 1087 | 1088 | ** --context|-c N Use N lines of context |
| 1088 | 1089 | ** --diff-binary BOOL Include binary files when using external commands |
| 1089 | 1090 | ** --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 | |
| 1091 | 1092 | ** --internal|-i use internal diff logic |
| 1092 | 1093 | ** --side-by-side|-y side-by-side diff |
| 1093 | 1094 | ** --tk Launch a Tcl/Tk GUI for display |
| 1094 | 1095 | ** --to VERSION select VERSION as target for the diff |
| 1095 | 1096 | ** --unified unified diff |
| @@ -1122,14 +1123,10 @@ | ||
| 1122 | 1123 | verboseFlag = find_option("verbose","v",0)!=0; |
| 1123 | 1124 | if( !verboseFlag ){ |
| 1124 | 1125 | verboseFlag = find_option("new-file","N",0)!=0; /* deprecated */ |
| 1125 | 1126 | } |
| 1126 | 1127 | if( verboseFlag ) diffFlags |= DIFF_VERBOSE; |
| 1127 | - if( find_option("ignore-space-at-eol",0,0)!=0 ) { | |
| 1128 | - diffFlags |= DIFF_IGNORE_EOLWS; | |
| 1129 | - } | |
| 1130 | - | |
| 1131 | 1128 | if( zBranch ){ |
| 1132 | 1129 | if( zTo || zFrom ){ |
| 1133 | 1130 | fossil_fatal("cannot use --from or --to with --branch"); |
| 1134 | 1131 | } |
| 1135 | 1132 | zTo = zBranch; |
| 1136 | 1133 |
| --- 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 |