From: Phillip Wood Date: Mon, 01 Jun 2026 15:20:23 GMT Subject: Re: [PATCH v2 2/2] status: improve rebase todo list parsing Message-ID: <4fafee2c-4151-45f4-a842-17d6b77d951c@gmail.com> In-Reply-To: Hi Junio On 31/05/2026 01:46, Junio C Hamano wrote: > Phillip Wood writes: > >> +static void abbrev_oid_in_line(struct repository *r, >> + struct strbuf *line, char **pp) >> +{ >> ... >> + have_oid = !repo_get_oid(r, p, &oid); >> + *end_of_object_name = saved; >> + if (!have_oid) >> + goto out; /* object name was a label */ > > Can there be a label "deadbeef123" that is unrelated to an object whose > object name happens to abbreviate to "deadbeef123"? In theory yes, but I had assumed it was so unlikely to happen that we could ignore it. If we want to be more careful then we could add a "bool maybe_label" argument for commands that accept a label or a revision and check if "refs/rewritten/$object_name" exists before trying repo_get_oid(). >> + case TODO_MERGE: >> + skip_dash_c(&p); >> + while (true) { >> + p += strspn(p, " \t"); >> + if (!p[0] || (p[0] == '#' && (!p[1] || isspace(p[1])))) >> + break; >> + abbrev_oid_in_line(r, line, &p); >> + } >> + break; > > What does this loop do? A "merge" command may look like "merge > [[-C|-c] ]