diffstat width: #define defaults in diff.h
PATCH 1/3 diffstat width: #define defaults in diff.h
Quoted 1 line
From
500a39e27a12151703924f42a97a50c528c289c8Mon Sep 17 00:00:00 2001
From: Matthew Ruffalo <[email protected]>
Date: Sun, 28 Nov 2010 13:33:59 -0500
Subject: [PATCH 1/3] diffstat width: #define defaults in diff.h
--- diff.c | 4 ++-- diff.h | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-)
diff.c +0 -0
@@ -1247,8 +1247,8 @@ static void show_stats(struct diffstat_t *data,
struct diff_options *options)
line_prefix = msg->buf;
}- width = options->stat_width ? options->stat_width : 80;
- name_width = options->stat_name_width ? options->stat_name_width
: 50;
+ width = options->stat_width ? options->stat_width :DIFF_STAT_DEFAULT_WIDTH;
+ name_width = options->stat_name_width ? options->stat_name_width
: DIFF_STAT_DEFAULT_NAME_WIDTH;
/* Sanity: give at least 5 columns to the graph,
* but leave at least 10 columns for the name.
diff.h +0 -0
@@ -86,6 +86,9 @@ typedef struct strbuf *(*diff_prefix_fn_t)(struct
diff_options *opt, void *data)
#define DIFF_XDL_SET(opts, flag) ((opts)->xdl_opts |= XDF_##flag)
#define DIFF_XDL_CLR(opts, flag) ((opts)->xdl_opts &= ~XDF_##flag)
+#define DIFF_STAT_DEFAULT_WIDTH 80
+#define DIFF_STAT_DEFAULT_NAME_WIDTH 50
+
enum diff_words_type {
DIFF_WORDS_NONE = 0,
DIFF_WORDS_PORCELAIN,
Signature · 1 line
1.7.1
diff.h typedef struct strbuf *(*diff_prefix_fn_t)(struct · line 92
Quoted 12 lines · Matthew Ruffalo
diff.h +3
-0@@ -86,6 +86,9 @@ typedef struct strbuf *(*diff_prefix_fn_t)(struct diff_options *opt, void *data) #define DIFF_XDL_SET(opts, flag) ((opts)->xdl_opts |= XDF_##flag) #define DIFF_XDL_CLR(opts, flag) ((opts)->xdl_opts &= ~XDF_##flag) +#define DIFF_STAT_DEFAULT_WIDTH 80 +#define DIFF_STAT_DEFAULT_NAME_WIDTH 50 +
If this is only used in diff.c, can this be moved to diff.c instead?