git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Phillip Wood via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org, Olliver Schinagl <oliver@schinagl.nl>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Phillip Wood <phillip.wood@dunelm.org.uk>
Subject: Re: [PATCH] rebase -i: allow a comment after a "break" command
Date: Thu, 12 Jan 2023 11:46:23 -0500	[thread overview]
Message-ID: <Y8A5X0kHE31kSH3z@coredump.intra.peff.net> (raw)
In-Reply-To: <xmqq358fu4vr.fsf@gitster.g>

On Fri, Jan 13, 2023 at 12:52:40AM +0900, Junio C Hamano wrote:

> "Phillip Wood via GitGitGadget" <gitgitgadget@gmail.com> writes:
> 
> > From: Phillip Wood <phillip.wood@dunelm.org.uk>
> >
> > When adding a "break" command to a rebase todo list it can be helpful to
> > add a comment as a reminder as to what the user was planning to do when
> > the rebase stopped. Anything following the command is interpreted as an
> > argument to the command and results in an error. Change this so that a
> > "break command may be followed by "# <comment>" in the same way as
> > a "merge" command. Requiring the comment to begin with "# " allows the
> > break command to start taking an argument in the future if that turns
> > out to be useful.
> 
> Why do we special case "break" and not give the same "comment is
> emitted when the control reaches the insn in the todo list" for
> others like "exec" or even "pick"?

I had somewhat the opposite thought. The "break" command is special in
that it is not doing anything useful except returning control to the
user. And hence producing a message is a useful add-on. So I expected
the patch to just allow:

  break this is a message the user will see

without any "#" at all.

That does close the door for further arguments, but I have trouble
imagining what they would be.

> Another comment with devil's advocate hat on is if we are better off
> not adding "# this comment is emitted" at all, and instead do
> 
>     pick ...
>     pick ...
>     exec echo this comment is emitted
>     break
>     pick ...

Yeah, I have certainly done something like that before. I think it is
just a matter of ergonomics. I'm pretty sure I have also forgotten to
put in the "break" afterwards.

Actually, before we had "break" I think I've done:

  x false this message will be visible when this fails

which is even more horrible. ;)

-Peff

  parent reply	other threads:[~2023-01-12 17:26 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-12 10:36 [PATCH] rebase -i: allow a comment after a "break" command Phillip Wood via GitGitGadget
2023-01-12 11:14 ` Andrei Rybak
2023-01-12 16:26   ` Phillip Wood
2023-01-12 11:26 ` Olliver Schinagl
2023-01-12 12:25 ` Ævar Arnfjörð Bjarmason
2023-01-12 12:47   ` Olliver Schinagl
2023-01-12 16:20   ` Phillip Wood
2023-01-12 16:28     ` Ævar Arnfjörð Bjarmason
2023-01-12 18:04       ` Elijah Newren
2023-01-12 17:14   ` Elijah Newren
2023-01-13 20:17     ` Junio C Hamano
2023-01-14  2:47       ` Elijah Newren
2023-01-12 15:52 ` Junio C Hamano
2023-01-12 16:29   ` Phillip Wood
2023-01-12 16:46   ` Jeff King [this message]
2023-01-13 20:22     ` Junio C Hamano
2023-01-13 20:29       ` Sergey Organov
2023-01-17 15:33       ` Phillip Wood

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=Y8A5X0kHE31kSH3z@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=gitster@pobox.com \
    --cc=oliver@schinagl.nl \
    --cc=phillip.wood@dunelm.org.uk \
    /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;
as well as URLs for NNTP newsgroup(s).