{"thread":{"id":"25863","subject":"[PATCH/RFC 1/3] diffstat width: #define defaults in diff.h","startedAt":"2010-11-28T23:50:41Z","lastAt":"2010-11-29T00:44:25Z","messageCount":2,"participants":["Matthew Ruffalo","Thiago Farina"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"156783","messageId":"4CF2EAD1.8030007@case.edu","threadId":"25863","inReplyTo":null,"subject":"[PATCH/RFC 1/3] diffstat width: #define defaults in diff.h","fromName":"Matthew Ruffalo","fromEmail":"mmr15@case.edu","sentAt":"2010-11-28T23:50:41Z","receivedAt":"2010-11-28T23:50:41Z","isPatch":true,"sender":{"key":"mmr15@case.edu","avatar":null},"body":">From 500a39e27a12151703924f42a97a50c528c289c8 Mon Sep 17 00:00:00 2001\nFrom: Matthew Ruffalo <matthew.ruffalo@case.edu>\nDate: Sun, 28 Nov 2010 13:33:59 -0500\nSubject: [PATCH 1/3] diffstat width: #define defaults in diff.h\n\nSigned-off-by: Matthew Ruffalo <matthew.ruffalo@case.edu>\n---\n diff.c |    4 ++--\n diff.h |    3 +++\n 2 files changed, 5 insertions(+), 2 deletions(-)\n\ndiff --git a/diff.c b/diff.c\nindex c248bc6..a151681 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -1247,8 +1247,8 @@ static void show_stats(struct diffstat_t *data,\nstruct diff_options *options)\n                line_prefix = msg->buf;\n        }\n \n-       width = options->stat_width ? options->stat_width : 80;\n-       name_width = options->stat_name_width ? options->stat_name_width\n: 50;\n+       width = options->stat_width ? options->stat_width :\nDIFF_STAT_DEFAULT_WIDTH;\n+       name_width = options->stat_name_width ? options->stat_name_width\n: DIFF_STAT_DEFAULT_NAME_WIDTH;\n \n        /* Sanity: give at least 5 columns to the graph,\n         * but leave at least 10 columns for the name.\ndiff --git a/diff.h b/diff.h\nindex 0083d92..7b509c5 100644\n--- a/diff.h\n+++ b/diff.h\n@@ -86,6 +86,9 @@ typedef struct strbuf *(*diff_prefix_fn_t)(struct\ndiff_options *opt, void *data)\n #define DIFF_XDL_SET(opts, flag)    ((opts)->xdl_opts |= XDF_##flag)\n #define DIFF_XDL_CLR(opts, flag)    ((opts)->xdl_opts &= ~XDF_##flag)\n \n+#define DIFF_STAT_DEFAULT_WIDTH       80\n+#define DIFF_STAT_DEFAULT_NAME_WIDTH  50\n+\n enum diff_words_type {\n        DIFF_WORDS_NONE = 0,\n        DIFF_WORDS_PORCELAIN,\n-- \n1.7.1\n"},{"id":"156785","messageId":"AANLkTim6ddTgcYqfZQFK+wzYo2dm-nhVh-DFO5S3Ei4o@mail.gmail.com","threadId":"25863","inReplyTo":"4CF2EAD1.8030007@case.edu","subject":"Re: [PATCH/RFC 1/3] diffstat width: #define defaults in diff.h","fromName":"Thiago Farina","fromEmail":"tfransosi@gmail.com","sentAt":"2010-11-29T00:44:25Z","receivedAt":"2010-11-29T00:44:25Z","isPatch":true,"sender":{"key":"tfransosi@gmail.com","avatar":"https://avatars.githubusercontent.com/u/970071?v=4"},"body":"On Sun, Nov 28, 2010 at 9:50 PM, Matthew Ruffalo <mmr15@case.edu> wrote:\n> diff --git a/diff.h b/diff.h\n> index 0083d92..7b509c5 100644\n> --- a/diff.h\n> +++ b/diff.h\n> @@ -86,6 +86,9 @@ typedef struct strbuf *(*diff_prefix_fn_t)(struct\n> diff_options *opt, void *data)\n>  #define DIFF_XDL_SET(opts, flag)    ((opts)->xdl_opts |= XDF_##flag)\n>  #define DIFF_XDL_CLR(opts, flag)    ((opts)->xdl_opts &= ~XDF_##flag)\n>\n> +#define DIFF_STAT_DEFAULT_WIDTH       80\n> +#define DIFF_STAT_DEFAULT_NAME_WIDTH  50\n> +\n\nIf this is only used in diff.c, can this be moved to diff.c instead?\n"}]}