From: Junio C Hamano Date: Fri, 28 Aug 2026 16:18:17 GMT Subject: Re: [PATCH v3 5/5] commit: refuse partial commits during conflict resolution Message-ID: In-Reply-To: <050b9e8a52e531bcb17f483d0d574aaca3875adf.1787903085.git.gitgitgadget@gmail.com> "Elijah Newren via GitGitGadget" writes: > - if (whence != FROM_COMMIT) { > - if (whence == FROM_MERGE) > - die(_("cannot do a partial commit during a merge.")); > - else if (is_from_cherry_pick(whence)) > - die(_("cannot do a partial commit during a cherry-pick.")); > + switch (sequencer_ongoing_operation(the_repository, whence)) { > + case ONGOING_NONE: > + break; > + case ONGOING_MERGE: > + die(_("cannot do a partial commit during a merge.")); > + case ONGOING_CHERRY_PICK: > + die(_("cannot do a partial commit during a cherry-pick.")); > + case ONGOING_REBASE_EMPTY: > + /* > + * A pick that became empty is not a conflict, and creating > + * a new commit (partial or not) poses no problem. > + */ > + break; > + case ONGOING_REVERT: > + die(_("cannot do a partial commit during a revert.")); > + case ONGOING_AM: > + die(_("cannot do a partial commit during an am session.")); > + case ONGOING_REBASE_CONFLICT: > + die(_("cannot do a partial commit while resolving conflicts during a rebase.")); > } Looks quite thorough. Deliberate ommission of "default:" is a plus ;-)