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

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

From
APAlexander Potashev <aspotashev@gmail.com>
Date
Jan 10, 2009, 11:39 UTC
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 <aspotashev@gmail.com>
---
 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
Previous: Alexander PotashevNext: Nathan W. Panike
Message 5 of 11 in “Get format-patch to show first commit after root commit”
  1. Get format-patch to show first commit after root commitNathan W. Panike, Jan 9, 2009
  2. Junio C HamanoJan 10, 2009
  3. Nathan W. PanikeJan 10, 2009
  4. Alexander PotashevJan 10, 2009
  5. format-patch: avoid generation of empty patchesAlexander Potashev, Jan 10, 2009
  6. Nathan W. PanikeJan 10, 2009
  7. Alexander PotashevJan 10, 2009
  8. Nathan W. PanikeJan 10, 2009
  9. Junio C HamanoJan 10, 2009
  10. Add new testcases for format-patch root commitsAlexander Potashev, Jan 10, 2009
  11. Alexander PotashevJan 10, 2009

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.