Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Patrick Steinhardt <ps@pks.im>
Cc: git@vger.kernel.org,  Elijah Newren <newren@gmail.com>,
	 "D. Ben Knoble" <ben.knoble@gmail.com>,
	 Tian Yuchen <cat@malon.dev>
Subject: Re: [PATCH v3 1/3] replay: allow callers to control what happens with empty commits
Date: Tue, 12 May 2026 13:51:08 +0900	[thread overview]
Message-ID: <xmqq7bp9p6wz.fsf@gitster.g> (raw)
In-Reply-To: <20260427-b4-pks-history-fixup-v3-1-cb908f06264b@pks.im> (Patrick Steinhardt's message of "Mon, 27 Apr 2026 07:53:51 +0200")

Patrick Steinhardt <ps@pks.im> writes:

> +	/* Handle commits that become empty */
>  	if (oideq(&replayed_base_tree->object.oid, &result->tree->object.oid) &&
> -	    !oideq(&pickme_tree->object.oid, &base_tree->object.oid))
> -		return replayed_base;
> +	    !oideq(&pickme_tree->object.oid, &base_tree->object.oid)) {
> +		switch (empty) {
> +		case REPLAY_EMPTY_COMMIT_DROP:
> +			return replayed_base;
> +		case REPLAY_EMPTY_COMMIT_KEEP:
> +			break;
> +		case REPLAY_EMPTY_COMMIT_ABORT:
> +			result->clean = error(_("commit %s became empty after replay"),
> +					      oid_to_hex(&pickme->object.oid));

OK.  merge-ort.h clearly explains what negative values in .clean
member means, so this is a good way to signal a failure up the
call chain.

> +			return NULL;
> +		}
> +	}

  reply	other threads:[~2026-05-12  4:51 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-22 10:28 [PATCH 0/2] builtin/history: introduce "fixup" subcommand Patrick Steinhardt
2026-04-22 10:28 ` [PATCH 1/2] builtin/history: generalize function to commit trees Patrick Steinhardt
2026-04-22 10:28 ` [PATCH 2/2] builtin/history: introduce "fixup" subcommand Patrick Steinhardt
2026-04-22 19:06   ` D. Ben Knoble
2026-04-23  6:55     ` Patrick Steinhardt
2026-04-23 21:18       ` D. Ben Knoble
2026-04-24  6:53         ` Patrick Steinhardt
2026-04-24 14:43           ` D. Ben Knoble
2026-04-22 18:18 ` [PATCH 0/2] " Tian Yuchen
2026-04-23  6:55   ` Patrick Steinhardt
2026-04-23 14:21 ` [PATCH v2 0/3] " Patrick Steinhardt
2026-04-23 14:21   ` [PATCH v2 1/3] replay: allow callers to control what happens with empty commits Patrick Steinhardt
2026-04-23 14:21   ` [PATCH v2 2/3] builtin/history: generalize function to commit trees Patrick Steinhardt
2026-04-23 14:21   ` [PATCH v2 3/3] builtin/history: introduce "fixup" subcommand Patrick Steinhardt
2026-04-27  5:53 ` [PATCH v3 0/3] " Patrick Steinhardt
2026-04-27  5:53   ` [PATCH v3 1/3] replay: allow callers to control what happens with empty commits Patrick Steinhardt
2026-05-12  4:51     ` Junio C Hamano [this message]
2026-04-27  5:53   ` [PATCH v3 2/3] builtin/history: generalize function to commit trees Patrick Steinhardt
2026-04-27  5:53   ` [PATCH v3 3/3] builtin/history: introduce "fixup" subcommand Patrick Steinhardt
2026-05-12  5:47   ` [PATCH v3 0/3] " Junio C Hamano
2026-05-12  6:41     ` Patrick Steinhardt

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=xmqq7bp9p6wz.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=ben.knoble@gmail.com \
    --cc=cat@malon.dev \
    --cc=git@vger.kernel.org \
    --cc=newren@gmail.com \
    --cc=ps@pks.im \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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