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

Re: Worktree creation race

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 1, 2019, 18:06 UTC
Message-ID
<xmqqh8dnz8mr.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<CAPig+cSdpq0Bfq3zSK8kJd6da3dKixK7qYQ24=ZwbuQtsaLNZw@mail.gmail.com>
Eric Sunshine <sunshine@sunshineco.com> writes:
> Another possibility would be to skip the stat() and instead do the
> mkdir() in a loop, incrementing the sequence number each time through
> the loop. That should eliminate the race entirely (I think).

Yeah, I think that is the only sensible option to rely on the atomicity of mkdir() call.

Previous: Eric Sunshine
Message 7 of 7 in “Worktree creation race”
  1. Marketa CalabkovaJan 15, 2019
  2. Marketa CalabkovaJan 28, 2019
  3. Eric SunshineFeb 1, 2019
  4. Duy NguyenFeb 1, 2019
  5. Duy NguyenFeb 1, 2019
  6. Eric SunshineFeb 1, 2019
  7. Junio C HamanoFeb 1, 2019

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.