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

Re: [PATCH v3 1/3] replay: allow callers to control what happens with empty commits

From
Junio C Hamano <gitster@pobox.com>
Date
May 12, 2026, 04:51 UTC
Message-ID
<xmqq7bp9p6wz.fsf@gitster.g>
In-Reply-To
<20260427-b4-pks-history-fixup-v3-1-cb908f06264b@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 13 quoted lines
> +	/* 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;
> +		}
> +	}
Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 13 of 17 in “builtin/history: introduce "fixup" subcommand”
  1. 0/2 builtin/history: introduce "fixup" subcommandPatrick Steinhardt, Apr 22, 2026
  2. 1/2 builtin/history: generalize function to commit treesPatrick Steinhardt, Apr 22, 2026
  3. 2/2 builtin/history: introduce "fixup" subcommandPatrick Steinhardt, Apr 22, 2026
  4. D. Ben KnobleApr 22, 2026
  5. Patrick SteinhardtApr 23, 2026
  6. D. Ben KnobleApr 23, 2026
  7. Patrick SteinhardtApr 24, 2026
  8. D. Ben KnobleApr 24, 2026
  9. Tian YuchenApr 22, 2026
  10. Patrick SteinhardtApr 23, 2026
  11. 0/3 builtin/history: introduce "fixup" subcommandPatrick Steinhardt, Apr 27, 2026
  12. 1/3 replay: allow callers to control what happens with empty commitsPatrick Steinhardt, Apr 27, 2026
  13. Junio C HamanoMay 12, 2026
  14. 2/3 builtin/history: generalize function to commit treesPatrick Steinhardt, Apr 27, 2026
  15. 3/3 builtin/history: introduce "fixup" subcommandPatrick Steinhardt, Apr 27, 2026
  16. Junio C HamanoMay 12, 2026
  17. Patrick SteinhardtMay 12, 2026

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.