git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phillip Wood <phillip.wood123@gmail.com>
To: Stefan Haller <lists@haller-berlin.de>,
	phillip.wood@dunelm.org.uk, git@vger.kernel.org
Cc: johannes.schindelin@gmx.de
Subject: Re: Possible bug in git-rebase man page
Date: Thu, 6 Apr 2023 13:07:15 +0100	[thread overview]
Message-ID: <7e99ff9b-99b7-1ea9-4131-43f507780284@gmail.com> (raw)
In-Reply-To: <f3e522f6-294d-4c08-b261-34d8e5b03b46@haller-berlin.de>

Hi Stefan

On 06/04/2023 11:48, Stefan Haller wrote:
> On 06.04.23 11:49, Phillip Wood wrote:
>> Hi Stefan
>>
>> On 05/04/2023 18:36, Stefan Haller wrote:
>>> The git-rebase documentation has an example for a git-rebase-todo file
>>> when --rebase-merges is used; one of the lines in that file is
>>>
>>>     reset refactor-button # Use the Button class for all buttons
>>>
>>>   From reading the code that parses the file, this doesn't seem to be a
>>> valid line; as far as I can see, comments are not supported for reset or
>>> label. The label is the entire rest of the line after the command.
>>
>> You're right that comments are not supported for labels, but for the
>> reset command do_reset() ignores everything after the label so it does
>> effectively support comments.
> 
> I don't follow; do_reset() simply uses whatever is stored in
> item->arg_len, and this is set to go until the end of the line for
> "label" and "reset" in parse_insn_line().

But it splits in line in do_reset()

		/* Determine the length of the label */
		for (i = 0; i < len; i++)
			if (isspace(name[i]))
				break;
		len = i;

		commit = lookup_label(r, name, len, &ref_name);

>> I've got some patches to support comments on other commands which
>> I'll hopefully submit before too long.
> 
> Hm, for label and reset this will make it harder for third-parties
> parsing todo files. What's a real-world benefit of supporting comments
> for these?

It started as a request for comments on the "break" command but the 
discussion convinced me that we'll keep getting asked why doesn't "xxx" 
command support comments if we just add them to some commands. See 
https://lore.kernel.org/git/pull.1460.git.1673519809510.gitgitgadget@gmail.com/

Best Wishes

Phillip

> -Stefan


  reply	other threads:[~2023-04-06 12:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-05 17:36 Possible bug in git-rebase man page Stefan Haller
2023-04-06  9:49 ` Phillip Wood
2023-04-06 10:48   ` Stefan Haller
2023-04-06 12:07     ` Phillip Wood [this message]
2023-04-07  6:12       ` Stefan Haller
2023-04-11  9:50         ` 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=7e99ff9b-99b7-1ea9-4131-43f507780284@gmail.com \
    --to=phillip.wood123@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=johannes.schindelin@gmx.de \
    --cc=lists@haller-berlin.de \
    --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).