On Tue, Jul 01, 2008 at 12:44:23AM +0200, Olivier Marin [off-list ref] wrote:
quoted
+ if (new_head && show_diffstat) {
+ struct diff_options opts;
+ diff_setup(&opts);
+ opts.output_format |=
+ DIFF_FORMAT_SUMMARY | DIFF_FORMAT_DIFFSTAT;
+ opts.detect_rename = DIFF_DETECT_RENAME;
+ if (diff_use_color_default > 0)
+ DIFF_OPT_SET(&opts, COLOR_DIFF);
Ah, I missed that. You should call diff_setup_done(), to finish diff_setup()
and have a recursive diffstat.
For example:
$ git checkout -b test c0f5c69
$ git merge 2dce956
Updating c0f5c69..2dce956
Fast forward
help.c | 22 ++++++++++++++--------
1 files changed, 14 insertions(+), 8 deletions(-)
is wrong. Correct diffstat is:
$ git diff --stat c0f5c69..2dce956
Documentation/gitcli.txt | 37 +++++++++++++++++++++++++++++++++----
Documentation/gittutorial-2.txt | 10 +++++-----
help.c | 22 ++++++++++++++--------
t/test-lib.sh | 2 +-
4 files changed, 53 insertions(+), 18 deletions(-)
Fixed in my working branch.
quoted
+ git_config(git_merge_config, NULL);
+
+ /* for color.diff and diff.color */
+ git_config(git_diff_ui_config, NULL);
Also, what about doing "return git_diff_ui_config(k, v, cb)" at the end of
git_merge_config() instead, to avoid parsing config files twice.
Sure, changed.
Thanks! :)