Thread (2 messages) 2 messages, 2 authors, 2026-01-02

Re: [RFC PATCH] builtin/format-patch: print a warning for skipped merge commits?

From: Jeff King <hidden>
Date: 2026-01-02 07:33:59

On Wed, Dec 31, 2025 at 12:42:17PM +0900, Dominique Martinet wrote:
quoted hunk ↗ jump to hunk
@@ -2274,6 +2273,11 @@ int cmd_format_patch(int argc,
 		die(_("revision walk setup failed"));
 	rev.boundary = 1;
 	while ((commit = get_revision(&rev)) != NULL) {
+		if (commit->parents->next) {
+			warning(_("skipped merge commit %s"),
+				oid_to_hex(&commit->object.oid));
+			continue;
+		}
I don't have any thoughts on whether the patch is overall a good
direction or not, but I suspect this line will segfault if we ever see a
root commit. You probably want:

  if (commit->parents && commit->parents->next)

here.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help