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

Re: [PATCH 1/2] worktree: fix worktree add race.

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Feb 17, 2019, 07:05 UTC
Message-ID
<CAPig+cQCw-7WALdzdFD--Jt5d+iZbY8DBBQdC_P8wZ9CVTYZKA@mail.gmail.com>
In-Reply-To
<xmqq8syg6foq.fsf@gitster-ct.c.googlers.com>
On Fri, Feb 15, 2019 at 1:59 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 8 quoted lines
> Michal Suchanek <msuchanek@suse.de> writes:
> > Git runs a stat loop to find a worktree name that's available and then does
> > mkdir on the found name. Turn it to mkdir loop to avoid another invocation of
> > worktree add finding the same free name and creating the directory first.
>
> Yeah, relying on the atomicity of mkdir(2) is much saner approach
> than "check -- ah we can use the name -- try to create" that is race
> prone.

Yep. When you re-roll, please mention [1] in the cover letter or in the commentary section of this patch (after the "---" line below your sign-off) to provide context to reviewers. Also, when re-rolling, please Cc: people involved in that earlier discussion (whom I've added to the Cc: of this reply). Thanks.

[1]: http://public-inbox.org/git/CAPig+cSdpq0Bfq3zSK8kJd6da3dKixK7qYQ24=ZwbuQtsaLNZw@mail.gmail.com/
Previous: Michal Suchánek
Message 7 of 7 in “worktree: fix worktree add race.”
  1. 1/2 worktree: fix worktree add race.Michal Suchanek, Feb 15, 2019
  2. 2/2 setup: don't fail if commondir is deleted.Michal Suchanek, Feb 15, 2019
  3. Eric SunshineFeb 17, 2019
  4. Michal SuchánekFeb 18, 2019
  5. Junio C HamanoFeb 15, 2019
  6. Michal SuchánekFeb 16, 2019
  7. Eric SunshineFeb 17, 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.