Merge branch 'nd/diff-stat-with-summary'
authorJunio C Hamano <gitster@pobox.com>
Wed, 14 Mar 2018 19:01:02 +0000 (12:01 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 14 Mar 2018 19:01:02 +0000 (12:01 -0700)
"git diff" and friends learned "--compact-summary" that shows the
information usually given with the "--summary" option on the same
line as the diffstat output of the "--stat" option (which saves
vertical space and keeps info on a single path at the same place).

* nd/diff-stat-with-summary:
diff: add --compact-summary
diff.c: refactor pprint_rename() to use strbuf

1  2 
Documentation/diff-options.txt
diff.c
diff.h
Simple merge
diff --cc diff.c
index 915f4d6e9f8e4ce203221ebfe2ae9e6dc78b22c3,95124c0e7c2a0da04199c51d5c2393167ce695a3..4c59f5f5d3d32286daefbeeb25ed5291070fe762
--- 1/diff.c
--- 2/diff.c
+++ b/diff.c
@@@ -2045,11 -2045,10 +2045,10 @@@ static void fn_out_consume(void *priv, 
        }
  }
  
- static char *pprint_rename(const char *a, const char *b)
+ static void pprint_rename(struct strbuf *name, const char *a, const char *b)
  {
 -      const char *old = a;
 -      const char *new = b;
 +      const char *old_name = a;
 +      const char *new_name = b;
-       struct strbuf name = STRBUF_INIT;
        int pfx_length, sfx_length;
        int pfx_adjust_for_slash;
        int len_a = strlen(a);
diff --cc diff.h
index 6bd278aac11a4349ce76602113e45e31ae1229de,28a8fb43466427eecf885f29ecd62d5515e3b4a2..d29560f822ca0ee4738f769e2feb3939851d7ff1
--- 1/diff.h
--- 2/diff.h
+++ b/diff.h
@@@ -92,7 -91,9 +92,8 @@@ struct diff_flags 
        unsigned override_submodule_config:1;
        unsigned dirstat_by_line:1;
        unsigned funccontext:1;
 -      unsigned pickaxe_ignore_case:1;
        unsigned default_follow_renames:1;
+       unsigned stat_with_summary:1;
  };
  
  static inline void diff_flags_or(struct diff_flags *a,