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

Re: [PATCH] doc/reftable: document how to handle windows

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 26, 2021, 17:40 UTC
Message-ID
<xmqqtur338bg.fsf@gitster.c.googlers.com>
In-Reply-To
<CAFQ2z_PCh2RfWALhAUXm01Xq0o+ibuEGJ2p9sCtvTASQ0FLUag@mail.gmail.com>
Han-Wen Nienhuys <hanwen@google.com> writes:
Show 19 quoted lines
>> Is this because we have been assuming that in step 5. we can
>> "overwrite" (i.e. take over the name, implicitly unlinking the
>> existing one) the existing 0000001-00000001.ref with the newly
>> prepared one, which is not doable on Windows?
>
> No, the protocol for adding a table to the end of the stack is
> impervious to problems on Windows, as everything happens under lock,
> so there is no possibility of collisions.
>
>> We must prepare for two "randoms" colliding and retrying the
>> renaming step anyway, so would it make more sense to instead
>> use a non-random suffix (i.e. try "-0.ref" first, and when it
>> fails, readdir for 0000001-00000001-*.ref to find the latest
>> suffix and increment it)?
>
> This is a lot of complexity, and both transactions and compactions can
> always fail because they fail to get the lock, or because the data to
> be written is out of date. So callers need to be prepared for a retry
> anyway.

Sorry, are we saying the same thing and reaching different conclusions?

My question was, under the assumption that the callers need to be prepared for a retry anyway,

 (1) would it be possible to use "seq" (or "take max from existing
     and add one") as the random number generator for the ${random}
     part of your document, and
 (2) if the answer to the previous question is yes, would it result
     in a system that is easier for Git developers, who observe what
     happens inside the .git directory, to understand the behaviour
     of the system, as they can immediately see that 1-1-47 is newer
     than 1-1-22 instead of 1-1-$random1 and 1-1-$random2 that
     cannot be compared?
Previous: Han-Wen NienhuysNext: Han-Wen Nienhuys
Message 4 of 7 in “doc/reftable: document how to handle windows”
  1. doc/reftable: document how to handle windowsHan-Wen Nienhuys via GitGitGadget, Jan 25, 2021
  2. Junio C HamanoJan 26, 2021
  3. Han-Wen NienhuysJan 26, 2021
  4. Junio C HamanoJan 26, 2021
  5. Han-Wen NienhuysJan 26, 2021
  6. Junio C HamanoJan 26, 2021
  7. doc/reftable: document how to handle windowsHan-Wen Nienhuys via GitGitGadget, Feb 23, 2021

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.