git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/3] diffstat width: #define defaults in diff.h

From
Mmmr15@case.edu <mmr15@case.edu>
Date
Dec 8, 2010, 02:44 UTC
Message-ID
<1291776263-16320-1-git-send-email-matthew.ruffalo@case.edu>
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
Previous: Junio C HamanoNext: mmr15@case.edu
Message 3 of 6 in “diffstat: Use new diff.stat config values”
  1. 2/3 diffstat: Use new diff.stat config valuesMatthew Ruffalo, Nov 28, 2010
  2. Junio C HamanoNov 29, 2010
  3. 1/3 diffstat width: #define defaults in diff.hmmr15@case.edu, Dec 8, 2010
  4. 2/3 diffstat: Use new diffstat config valuesmmr15@case.edu, Dec 8, 2010
  5. Junio C HamanoDec 9, 2010
  6. 3/3 Add documentation for new diffstat config optionsmmr15@case.edu, Dec 8, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.