Re: Possible bug in git-rebase man page

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx/

Best Wishes

Phillip

-Stefan




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux