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

[PATCH] format-patch: avoid generation of empty patches

From: Alexander Potashev <hidden>
Date: 2016-06-15 22:45:55
Subsystem: the rest · Maintainer: Linus Torvalds

If 'log.showroot' is not set, format-patch shouldn't even try to create
a patch for the root commit.

Signed-off-by: Alexander Potashev <redacted>
---
 builtin-log.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/builtin-log.c b/builtin-log.c
index 4a02ee9..62134d4 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -972,6 +972,9 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 				has_commit_patch_id(commit, &ids))
 			continue;
 
+		if (!commit->parents && !rev.show_root_diff)
+			break;
+
 		nr++;
 		list = xrealloc(list, nr * sizeof(list[0]));
 		list[nr - 1] = commit;
-- 
1.6.1.77.g569c.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