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

Re: [RFH] sequencer: simplify logic around stopped-sha file

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 27, 2020, 00:08 UTC
Message-ID
<xmqqo8lsgjxt.fsf@gitster.c.googlers.com>
In-Reply-To
<nycvar.QRO.7.76.6.2009262320530.50@tvgsbejvaqbjf.bet>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 15 quoted lines
>> Is there something obvious I am not seeing that makes this change a
>> bad idea (other than "somebody may be in the middle of a rebase and
>> all of a sudden, version of Git gets updated to contain this one,
>> which is unable to read abbreviated object name the current version
>> left on disk", which I am deliberately ignoring)?
>
> At least in my understanding, you are not missing anything:
>
> - this file is an implementation detail,
>
> - it is not exposed directly via any user-visible interface,
>
> - any reader will _have_ to be prepared for an unabbreviated object ID (in
>   the highly unlikely case that an object ID would be ambiguous if
>   abbreviated even by one hex character),

Ah, no that was not what I was worried about. If an existing code, after restarting and reading the abbreviated object name back from the file, compares that shortened string against list of shortened strings it has in-core (perhaps it reads todo back from the user in abbreviated form, does comparison with stopped-sha as-is, before it expands the object names from todo to full length), this change would break it.

Show 6 quoted lines
> - and most importantly: just like we expand the commit IDs in the todo
>   list, we actually want to expand them in `stopped-sha` because it _is_
>   possible that a new object is written that makes the previous
>   unambiguously abbreviated object ID now ambiguous (e.g. when the user
>   commits in a separate worktree while the rebase is interrupted, before
>   continuing the rebase).

Exactly. I just wasn't sure if stopped-sha is handled with the same carefulness as the object names in todo, which are expanded after read and shortened before given back to the users.

Thanks.
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 3 of 4 in “[RFH] sequencer: simplify logic around stopped-sha file”
  1. Junio C HamanoSep 25, 2020
  2. Johannes SchindelinSep 26, 2020
  3. Junio C HamanoSep 27, 2020
  4. Johannes SchindelinSep 28, 2020

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.