git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Possible bug in git-rebase man page

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
Apr 6, 2023, 12:07 UTC
Message-ID
<7e99ff9b-99b7-1ea9-4131-43f507780284@gmail.com>
In-Reply-To
<f3e522f6-294d-4c08-b261-34d8e5b03b46@haller-berlin.de>
Hi Stefan
On 06/04/2023 11:48, Stefan Haller wrote:
Show 20 quoted lines
> 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);
Show 6 quoted lines
>> 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
Previous: Stefan HallerNext: Stefan Haller
Message 4 of 6 in “Possible bug in git-rebase man page”
  1. Stefan HallerApr 5, 2023
  2. Phillip WoodApr 6, 2023
  3. Stefan HallerApr 6, 2023
  4. Phillip WoodApr 6, 2023
  5. Stefan HallerApr 7, 2023
  6. Phillip WoodApr 11, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.