Fossil

Changes On Branch diff-numstat-total
Login

Changes On Branch diff-numstat-total

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Changes In Branch diff-numstat-total Excluding Merge-Ins

This is equivalent to a diff from 08ad0f52 to f8a5a6a7

2021-01-07
16:21
The --numstat option to "fossil diff" now shows a total at the end. (check-in: 9bb61a42 user: drh tags: trunk)
2020-12-19
14:16
Prepend the text "Note:" instead of a bullet on the timeline display of a technote. (check-in: 2d1ef1e1 user: drh tags: trunk)
2020-12-18
15:30
Enhance "fossil diff --numstat" to print a grand total line, and not display statistics for non-modified files. (Closed-Leaf check-in: f8a5a6a7 user: danield tags: diff-numstat-total)
15:05
Extend the timeline command to allow customized "pretty" formats. (check-in: 5d3239bf user: danield tags: timeline-cmd-formatting)
2020-12-17
23:58
Moved the -lpthread for --static builds from the end of EXTRA_LDFLAGS to the end of LIBS, since the latter ends up at the end of "LIB" in the Makefile. In other words, the prior formulation put -lpthread in the *middle* of the LIB line, not at the end as intended. (check-in: 08ad0f52 user: wyoung tags: trunk)
2020-12-16
20:14
Comment improvements to [6f9d265234 | the recent change] in auto.def. (check-in: 53caec95 user: wyoung tags: trunk)

Changes to src/diff.c.

1953
1954
1955
1956
1957
1958
1959




1960

1961
1962
1963
1964
1965
1966
1967
  if( pOut ){
    if( diffFlags & DIFF_NUMSTAT ){
      int nDel = 0, nIns = 0, i;
      for(i=0; c.aEdit[i] || c.aEdit[i+1] || c.aEdit[i+2]; i+=3){
        nDel += c.aEdit[i+1];
        nIns += c.aEdit[i+2];
      }




      blob_appendf(pOut, "%10d %10d", nIns, nDel);

    }else if( diffFlags & DIFF_SIDEBYSIDE ){
      sbsDiff(&c, pOut, pRe, diffFlags);
    }else{
      contextDiff(&c, pOut, pRe, diffFlags);
    }
    fossil_free(c.aFrom);
    fossil_free(c.aTo);







>
>
>
>
|
>







1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
  if( pOut ){
    if( diffFlags & DIFF_NUMSTAT ){
      int nDel = 0, nIns = 0, i;
      for(i=0; c.aEdit[i] || c.aEdit[i+1] || c.aEdit[i+2]; i+=3){
        nDel += c.aEdit[i+1];
        nIns += c.aEdit[i+2];
      }
      g.diffCnt[1] += nIns;
      g.diffCnt[2] += nDel;
      if( nIns+nDel ){
        g.diffCnt[0]++;
        blob_appendf(pOut, "%10d %10d", nIns, nDel);
      }
    }else if( diffFlags & DIFF_SIDEBYSIDE ){
      sbsDiff(&c, pOut, pRe, diffFlags);
    }else{
      contextDiff(&c, pOut, pRe, diffFlags);
    }
    fossil_free(c.aFrom);
    fossil_free(c.aTo);

Changes to src/diffcmd.c.

853
854
855
856
857
858
859

860
861
862
863
864
865
866
  const char *zBranch;       /* Branch to diff */
  const char *zDiffCmd = 0;  /* External diff command. NULL for internal diff */
  const char *zBinGlob = 0;  /* Treat file names matching this as binary */
  int fIncludeBinary = 0;    /* Include binary files for external diff */
  int againstUndo = 0;       /* Diff against files in the undo buffer */
  u64 diffFlags = 0;         /* Flags to control the DIFF */
  FileDirList *pFileDir = 0; /* Restrict the diff to these files */


  if( find_option("tk",0,0)!=0 || has_option("tclsh") ){
    diff_tk("diff", 2);
    return;
  }
  isGDiff = g.argv[1][0]=='g';
  isInternDiff = find_option("internal","i",0)!=0;







>







853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
  const char *zBranch;       /* Branch to diff */
  const char *zDiffCmd = 0;  /* External diff command. NULL for internal diff */
  const char *zBinGlob = 0;  /* Treat file names matching this as binary */
  int fIncludeBinary = 0;    /* Include binary files for external diff */
  int againstUndo = 0;       /* Diff against files in the undo buffer */
  u64 diffFlags = 0;         /* Flags to control the DIFF */
  FileDirList *pFileDir = 0; /* Restrict the diff to these files */
  g.diffCnt[0] = g.diffCnt[1] = g.diffCnt[2] = 0;

  if( find_option("tk",0,0)!=0 || has_option("tclsh") ){
    diff_tk("diff", 2);
    return;
  }
  isGDiff = g.argv[1][0]=='g';
  isInternDiff = find_option("internal","i",0)!=0;
956
957
958
959
960
961
962



963
964
965
966
967
968
969
      ){
        fossil_fatal("not found: '%s'", g.argv[i+2]);
      }
      fossil_free(pFileDir[i].zName);
    }
    fossil_free(pFileDir);
  }



}

/*
** WEBPAGE: vpatch
** URL: /vpatch?from=FROM&to=TO
**
** Show a patch that goes from check-in FROM to check-in TO.







>
>
>







957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
      ){
        fossil_fatal("not found: '%s'", g.argv[i+2]);
      }
      fossil_free(pFileDir[i].zName);
    }
    fossil_free(pFileDir);
  }
  if ( diffFlags & DIFF_NUMSTAT )
    fossil_print("%d files changed, %d insertions, %d deletions\n", 
                 g.diffCnt[0], g.diffCnt[1], g.diffCnt[2]);
}

/*
** WEBPAGE: vpatch
** URL: /vpatch?from=FROM&to=TO
**
** Show a patch that goes from check-in FROM to check-in TO.

Changes to src/main.c.

318
319
320
321
322
323
324

325
326
327
328
329
330
331
      cson_value *v;
      cson_object *o;
    } reqPayload;              /* request payload object (if any) */
    cson_array *warnings;      /* response warnings */
    int timerId;               /* fetched from fossil_timer_start() */
  } json;
#endif /* FOSSIL_ENABLE_JSON */

};

/*
** Macro for debugging:
*/
#define CGIDEBUG(X)  if( g.fDebug ) cgi_debug X








>







318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
      cson_value *v;
      cson_object *o;
    } reqPayload;              /* request payload object (if any) */
    cson_array *warnings;      /* response warnings */
    int timerId;               /* fetched from fossil_timer_start() */
  } json;
#endif /* FOSSIL_ENABLE_JSON */
  int diffCnt[3];         /* Counts for DIFF_NUMSTAT: files, ins, del */
};

/*
** Macro for debugging:
*/
#define CGIDEBUG(X)  if( g.fDebug ) cgi_debug X