Git development
 help / color / mirror / Atom feed
From: Elijah Newren <newren@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Phillip Wood <phillip.wood123@gmail.com>,
	 Elijah Newren via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org
Subject: Re: [PATCH v2 1/3] commit: reword the empty-commit rebase errors
Date: Fri, 28 Aug 2026 00:38:53 -0700	[thread overview]
Message-ID: <CABPp-BEaPtkT48-wpPmniWghhZ97VELkHAzFMgdckTAosmstgg@mail.gmail.com> (raw)
In-Reply-To: <xmqqwltba4gt.fsf@gitster.g>

On Thu, Aug 27, 2026 at 9:55 AM Junio C Hamano <gitster@pobox.com> wrote:
>
> Phillip Wood <phillip.wood123@gmail.com> writes:
>
> >> @@ -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.

  reply	other threads:[~2026-08-28  7:39 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-26  5:21 [PATCH] commit: refuse to amend during conflict resolution Elijah Newren via GitGitGadget
2026-08-26 13:56 ` Phillip Wood
2026-08-27  0:21   ` Elijah Newren
2026-08-26 16:22 ` Junio C Hamano
2026-08-27  0:23   ` Elijah Newren
2026-08-26 16:39 ` Junio C Hamano
2026-08-27  0:24   ` Elijah Newren
2026-08-27  1:02 ` [PATCH v2 0/3] " Elijah Newren via GitGitGadget
2026-08-27  1:02   ` [PATCH v2 1/3] commit: reword the empty-commit rebase errors Elijah Newren via GitGitGadget
2026-08-27 15:19     ` Phillip Wood
2026-08-27 16:54       ` Junio C Hamano
2026-08-28  7:38         ` Elijah Newren [this message]
2026-08-27 16:35     ` Junio C Hamano
2026-08-27 16:52       ` Junio C Hamano
2026-08-28  7:38         ` Elijah Newren
2026-08-27  1:02   ` [PATCH v2 2/3] commit: refuse to amend during conflict resolution Elijah Newren via GitGitGadget
2026-08-27 15:19     ` Phillip Wood
2026-08-27  1:02   ` [PATCH v2 3/3] commit: refuse partial commits " Elijah Newren via GitGitGadget
2026-08-27 15:19     ` Phillip Wood
2026-08-27 15:19   ` [PATCH v2 0/3] commit: refuse to amend " Phillip Wood
2026-08-27 16:28     ` Elijah Newren
2026-08-28  7:44 ` [PATCH v3 0/5] " Elijah Newren via GitGitGadget
2026-08-28  7:44   ` [PATCH v3 1/5] commit: clarify FROM_REBASE_PICK and is_from_rebase() names Elijah Newren via GitGitGadget
2026-08-28  7:44   ` [PATCH v3 2/5] commit: allow a partial commit when a rebase pick becomes empty Elijah Newren via GitGitGadget
2026-08-28  7:44   ` [PATCH v3 3/5] commit: reword the empty-commit rebase amend error Elijah Newren via GitGitGadget
2026-08-28  7:44   ` [PATCH v3 4/5] commit: refuse to amend during conflict resolution Elijah Newren via GitGitGadget
2026-08-28  7:44   ` [PATCH v3 5/5] commit: refuse partial commits " Elijah Newren via GitGitGadget

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=CABPp-BEaPtkT48-wpPmniWghhZ97VELkHAzFMgdckTAosmstgg@mail.gmail.com \
    --to=newren@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=gitster@pobox.com \
    --cc=phillip.wood123@gmail.com \
    /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