Re: [PATCH v2 1/3] commit: reword the empty-commit rebase errors
From: Elijah Newren <hidden>
Date: 2026-08-28 07:39:05
On Thu, Aug 27, 2026 at 9:55 AM Junio C Hamano [off-list ref] wrote:
Phillip Wood [off-list ref] writes:quoted
quoted
@@ -521,7 +521,7 @@ static const char *prepare_index(const char **argv, const char *prefix, else if (is_from_cherry_pick(whence)) die(_("cannot do a partial commit during a cherry-pick.")); else if (is_from_rebase(whence)) - die(_("cannot do a partial commit during a rebase.")); + die(_("cannot do a partial commit while resolving a commit that became empty."));"while committing a commit that became empty" would be clearer to me, but I what you have is definitely an improvement on the existing message.A stupid question, but wouldn't a partial commit of an empty commit still an empty commit? IOW, why do we need to reject a partial commit while committing a commit that became empty?
Not stupid at all. After some digging... Originally, we just checked for doing partial commit during merges or cherry-picks. Then in commit 430b75f7209c (commit: give correct advice for empty commit during a rebase, 2019-12-06) it was noted that the "cannot do a partial commit during a cherry-pick" message was also printed when rebasing a commit that became empty. Noting the misleading message, rather than drop the check in that case (likely an oversight), that commit opted to make the message print the actual operation that was in progress. I can fix it in v3, with another preparatory patch.