From: mmr15@case.edu
To: git@vger.kernel.org
Cc: Matthew Ruffalo <matthew.ruffalo@case.edu>
Subject: [PATCH 1/3] diffstat width: #define defaults in diff.h
Date: Tue, 7 Dec 2010 21:44:21 -0500 [thread overview]
Message-ID: <1291776263-16320-1-git-send-email-matthew.ruffalo@case.edu> (raw)
In-Reply-To: <7vzksr280s.fsf@alter.siamese.dyndns.org>
From: Matthew Ruffalo <matthew.ruffalo@case.edu>
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 db5e844..75938e4 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
next prev parent reply other threads:[~2010-12-08 2:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-28 23:51 [PATCH/RFC 2/3] diffstat: Use new diff.stat config values Matthew Ruffalo
2010-11-29 20:24 ` Junio C Hamano
2010-12-08 2:44 ` mmr15 [this message]
2010-12-08 2:44 ` [PATCH 2/3] diffstat: Use new diffstat " mmr15
2010-12-09 5:54 ` Junio C Hamano
2010-12-08 2:44 ` [PATCH 3/3] Add documentation for new diffstat config options mmr15
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1291776263-16320-1-git-send-email-matthew.ruffalo@case.edu \
--to=mmr15@case.edu \
--cc=git@vger.kernel.org \
--cc=matthew.ruffalo@case.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).