Re: Possible bug in git-rebase man page
- From
- Phillip 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