From: Alexander Potashev Date: Sat, 10 Jan 2009 11:39:03 GMT Subject: [PATCH] format-patch: avoid generation of empty patches Message-ID: <20090110113903.GB25723@myhost> In-Reply-To: <20090110113642.GA25723@myhost> 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 --- 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