Thus said "j. van den hoff" on Thu, 08 Aug 2013 08:31:04 +0200:

> In  case this  e-mail  wraps,  I've marked  the  spurious lines  where
> `merge' and `i' are erroneously wrapped  by `fossil' to the next line.
> this happens with 1.26.

So my  initial patch  actually wasn't  too far off.  The reason  for the
strange cutoff  at the end of  the line was  actually not a bug  per se,
though I don't  think it desirable. Here is the  updated patch committed
for review:

http://www.fossil-scm.org/index.html/info/bdbf144ed3

It produces an output like this:

$ ./fossil finfo -b -n 10 BUILD.txt
d5f6e08c09 2013-06-10 drh ipv6 Merge all the latest trunk changes into
940b0b33c9 2013-04-21 ashish ashish-i Merge with trunk - Remove reverse-prox
f4b082d464 2012-10-09 viriketo annotate Updating from trunk. I solved some merg
abbc00fc5b 2012-08-24 jan.nijt eclipse- Merge in the mingw build enhancements 
4e93e84e55 2012-08-24 jan.nijt trunk wiki tweaks regarding MinGW build enhan
75aaf30aad 2011-08-30 viriketo merge_re Updating from trunk to keep up working 
c57830bec2 2011-08-22 dmitry symlinks Merge trunk. 
84e6f172af 2011-08-16 venkat venks-em update branch before making changes 
3eb07708b1 2011-08-04 ben ben-test Merge trunk into ben-testing 
75f02948fa 2011-07-22 drh trunk Merge the recent autosetup changes into


Which is fine, but I would actually like to propose another change which
will produce output like:

$ ./fossil finfo -b -n 10 BUILD.txt     
d5f6e08c09 2013-06-10      drh     ipv6 Merge all the latest trunk changes into
940b0b33c9 2013-04-21   ashish ashish-i Merge with trunk  - Remove reverse-prox
f4b082d464 2012-10-09 viriketo annotate Updating from trunk. I solved some merg
abbc00fc5b 2012-08-24 jan.nijt eclipse- Merge in the mingw build enhancements  
4e93e84e55 2012-08-24 jan.nijt    trunk wiki tweaks regarding MinGW build enhan
75aaf30aad 2011-08-30 viriketo merge_re Updating from trunk to keep up working 
c57830bec2 2011-08-22   dmitry symlinks Merge trunk.                           
84e6f172af 2011-08-16   venkat venks-em update branch before making changes    
3eb07708b1 2011-08-04      ben ben-test Merge trunk into ben-testing           
75f02948fa 2011-07-22      drh    trunk Merge the recent autosetup changes into

Now with  that output you can  clearly see what was  happening before...
all the  superfluous spaces were being  stripped from the output,  so it
truncated the line length.

Unfortunately,  the  patch  will  currently affect  the  output  of  the
non-brief output as well because now extra spaces are no longer stripped
(which others may not appreciate; feedback required):

Index: src/comformat.c
==================================================================
--- src/comformat.c
+++ src/comformat.c
@@ -37,10 +37,11 @@
   int si, sk, i, k;
   int doIndent = 0;
   char zBuf[400];
   int lineCnt = 0; 
 
+  memset(zBuf, 0, sizeof(zBuf));
   for(;;){
     while( fossil_isspace(zText[0]) ){ zText++; }
     if( zText[0]==0 ){
       if( doIndent==0 ){
         fossil_print("\n");
@@ -51,13 +52,11 @@
     for(sk=si=i=k=0; zText[i] && k<tlen; i++){
       char c = zText[i];
       if( fossil_isspace(c) ){
         si = i;
         sk = k;
-        if( k==0 || zBuf[k-1]!=' ' ){
-          zBuf[k++] = ' ';
-        }
+        zBuf[k++] = ' ';
       }else{
         zBuf[k] = c;
         if( c=='-' && k>0 && fossil_isalpha(zBuf[k-1]) ){
           si = i+1;
           sk = k+1;


Interesting note  regarding comformat.c... it has  been mostly untouched
since it was initially imported into the fossil sources!

http://www.fossil-scm.org/index.html/annotate?checkin=e805fa8db90fb3ef&filename=src/comformat.c

Andy
-- 
TAI64 timestamp: 4000000052044489


_______________________________________________
fossil-users mailing list
[email protected]
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to