public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Jeff King <peff@peff•net>
To: Dominique Martinet <asmadeus@codewreck•org>
Cc: git@vger•kernel.org, "Junio C Hamano" <gitster@pobox•com>,
	"René Scharfe" <l.s.r@web•de>,
	"Julien Moutinho" <julm@sourcephile•fr>
Subject: Re: [RFC PATCH] builtin/format-patch: print a warning for skipped merge commits?
Date: Fri, 2 Jan 2026 02:33:58 -0500	[thread overview]
Message-ID: <20260102073358.GC2581074@coredump.intra.peff.net> (raw)
In-Reply-To: <20251231034217.2498648-1-asmadeus@codewreck.org>

On Wed, Dec 31, 2025 at 12:42:17PM +0900, Dominique Martinet wrote:

> @@ -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

      parent reply	other threads:[~2026-01-02  7:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-31  3:42 [RFC PATCH] builtin/format-patch: print a warning for skipped merge commits? Dominique Martinet
2025-12-31  5:12 ` Junio C Hamano
2026-01-03 12:24   ` Dominique Martinet
2026-01-04  2:27     ` Junio C Hamano
2026-02-01  8:38       ` Dominique Martinet
2026-01-02  7:33 ` Jeff King [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260102073358.GC2581074@coredump.intra.peff.net \
    --to=peff@peff$(echo .)net \
    --cc=asmadeus@codewreck$(echo .)org \
    --cc=git@vger$(echo .)kernel.org \
    --cc=gitster@pobox$(echo .)com \
    --cc=julm@sourcephile$(echo .)fr \
    --cc=l.s.r@web$(echo .)de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox