Thread (7 messages) flat view 7 messages, 3 authors, 2016-06-15
DORMANTno replies

[PATCH 4/3] Rename --pretty=changelog to --pretty=gnucl, and fix a bug

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:42:57
Subsystem: documentation, the rest · Maintainers: Jonathan Corbet, Linus Torvalds

It was pointed out that this format is rather specific. So, rename it
to "gnucl".

Also fix a bug where it would crash with an empty commit message.

Signed-off-by: Johannes Schindelin <redacted>
---
 Documentation/pretty-formats.txt |   10 ++++++++++
 commit.c                         |    2 +-
 diff.c                           |    2 ++
 3 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/Documentation/pretty-formats.txt b/Documentation/pretty-formats.txt
index 2fe6c31..f9ce4fb 100644
--- a/Documentation/pretty-formats.txt
+++ b/Documentation/pretty-formats.txt
@@ -77,6 +77,16 @@ displayed in full, regardless of whether --abbrev or
 true parent commits, without taking grafts nor history
 simplification into account.
 
+	* 'gnucl'
++
+--------------------------------------------------------------
+2007-02-22  Simon Josefsson <simon@josefsson.org>
+
+    * link-warning.h, gl/getaddrinfo.c, gl/gnulib.mk,
+         gl/string_.h, lgl/m4/unistd_h.m4: Update.
+--------------------------------------------------------------
+
+
 	* 'format:'
 +
 The 'format:' format allows you to specify which information
diff --git a/commit.c b/commit.c
index 64ddb56..abd84a8 100644
--- a/commit.c
+++ b/commit.c
@@ -38,7 +38,7 @@ struct cmt_fmt_map {
 	{ "fuller",	5,	CMIT_FMT_FULLER },
 	{ "oneline",	1,	CMIT_FMT_ONELINE },
 	{ "format:",	7,	CMIT_FMT_USERFORMAT},
-	{ "changelog",	9,	CMIT_FMT_CHANGELOG}
+	{ "gnucl",	1,	CMIT_FMT_CHANGELOG}
 };
 
 static char *user_format;
diff --git a/diff.c b/diff.c
index aed5388..f2d162f 100644
--- a/diff.c
+++ b/diff.c
@@ -1892,6 +1892,8 @@ static void run_changelog(struct diff_filepair *p, struct diff_options *o,
 static void finalize_changelog(struct diff_options *options,
 		struct changelog_t *changelog)
 {
+	if (!options->stat_sep)
+		return;
 	changelog->offset = print_wrapped_text(": ", -changelog->offset,
 		CHANGELOG_TAB_SIZE + 2, CHANGELOG_WIDTH);
 	changelog->offset = print_wrapped_text(options->stat_sep,
-- 
1.5.0.2.778.g534f-dirty
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help