git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH/RFC 1/3] diffstat width: #define defaults in diff.h
@ 2010-11-28 23:50 Matthew Ruffalo
  2010-11-29  0:44 ` Thiago Farina
  0 siblings, 1 reply; 2+ messages in thread
From: Matthew Ruffalo @ 2010-11-28 23:50 UTC (permalink / raw)
  To: git

>From 500a39e27a12151703924f42a97a50c528c289c8 Mon Sep 17 00:00:00 2001
From: Matthew Ruffalo <matthew.ruffalo@case.edu>
Date: Sun, 28 Nov 2010 13:33:59 -0500
Subject: [PATCH 1/3] diffstat width: #define defaults in diff.h

Signed-off-by: Matthew Ruffalo <matthew.ruffalo@case.edu>
---
 diff.c |    4 ++--
 diff.h |    3 +++
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/diff.c b/diff.c
index c248bc6..a151681 100644
--- a/diff.c
+++ b/diff.c
@@ -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 --git a/diff.h b/diff.h
index 0083d92..7b509c5 100644
--- a/diff.h
+++ b/diff.h
@@ -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,
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH/RFC 1/3] diffstat width: #define defaults in diff.h
  2010-11-28 23:50 [PATCH/RFC 1/3] diffstat width: #define defaults in diff.h Matthew Ruffalo
@ 2010-11-29  0:44 ` Thiago Farina
  0 siblings, 0 replies; 2+ messages in thread
From: Thiago Farina @ 2010-11-29  0:44 UTC (permalink / raw)
  To: Matthew Ruffalo; +Cc: git

On Sun, Nov 28, 2010 at 9:50 PM, Matthew Ruffalo <mmr15@case.edu> wrote:
> diff --git a/diff.h b/diff.h
> index 0083d92..7b509c5 100644
> --- a/diff.h
> +++ b/diff.h
> @@ -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?

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-11-29  0:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-28 23:50 [PATCH/RFC 1/3] diffstat width: #define defaults in diff.h Matthew Ruffalo
2010-11-29  0:44 ` Thiago Farina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).