git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Elijah Newren <newren@gmail.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: phillip.wood@dunelm.org.uk,
	Phillip Wood via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org, Olliver Schinagl <oliver@schinagl.nl>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>
Subject: Re: [PATCH] rebase -i: allow a comment after a "break" command
Date: Thu, 12 Jan 2023 10:04:10 -0800	[thread overview]
Message-ID: <CABPp-BHz6JXAyRXoNkDjsme4U6g=9f5i_LyMOJ1A4qysirf7Jw@mail.gmail.com> (raw)
In-Reply-To: <230112.86r0vzzp74.gmgdl@evledraar.gmail.com>

On Thu, Jan 12, 2023 at 9:20 AM Ævar Arnfjörð Bjarmason
<avarab@gmail.com> wrote:
>
> On Thu, Jan 12 2023, Phillip Wood wrote:
>
> > On 12/01/2023 12:25, Ævar Arnfjörð Bjarmason wrote:
> >> On Thu, Jan 12 2023, Phillip Wood via GitGitGadget wrote:
> >>
[...]
> >> But in this commit you extend it to "break", but we're going out of or
> >> way to e.g. extend this to "noop".
> >
> > I'm struggling to see why "noop" would need a comment - it only exists
> > to avoid an empty todo list and is not meant for general use (it's not
> > in the help added by append_todo_help() for this reason)
>
> I'm struggling to see why "break" needs a comment, why not just add it
> to the preceding line or something? But it seems some users like it :)
>
> So at that point, it seems easier to both explain & implement something
> that just consistently supports comment syntax, rather than overly
> special-casing it.

Personally, I think we should allow all lines in the todo script to
have trailing comments.

> > For "pick", "edit", "reword", "fixup" & "squash" we don't need a
> > comment mechanism as we ignore everything after the commit name. For
> > "reset" we ignore everything after the label. For "label" we could add
> > support for comments but I'm not sure it is that useful and we'd need
> > to be careful not to interpret a bad label name as a label + comment.
>
> I think there's been a couple of request to have changing the "argument"
> actually reword the $subject (I'm pretty such for "reword" that got as
> far as a patch, but I may be misrecalling).

Yes, there have been, but it's a bad idea (and it's not just me saying
that; Junio has also declared it as such).  I think it's mostly based
on confusion from us having ignored non-commented stuff on a line, and
we could avoid that confusion by just commenting out the commit
subject to make it clear we will ignore it and any changes to it.

> >> So I'd expect that just like the first for-loop in "parse_insn_line()"
> >> we'd check if strchr(bol, '#') returns non-NULL, and if so set eol to
> >> that result.
> >
> > That would break labels and commit names that contain a '#'
> >
> > If we think we're never going to want "break" to take an argument then
> > maybe we should just make it ignore the rest of the line like "reset
> > <label>".
>
> It's unfortunate that we do that, I think it's almost always better to
> just error out rather that silently ignore data, except for some
> explicit exceptions (such as comment syntax).

I agree.

  reply	other threads:[~2023-01-12 18:31 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 [this message]
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
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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CABPp-BHz6JXAyRXoNkDjsme4U6g=9f5i_LyMOJ1A4qysirf7Jw@mail.gmail.com' \
    --to=newren@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).