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

Re: [PATCH] worktree add: add --lock option

From
Jacob Keller <jacob.keller@gmail.com>
Date
Apr 14, 2017, 16:27 UTC
Message-ID
<CA+P7+xrdM-DGbs4PcN-E+yh=A5Fr40ZGr2RaoihkooUnorfHxA@mail.gmail.com>
In-Reply-To
<xmqqy3v3orc3.fsf@gitster.mtv.corp.google.com>
On Thu, Apr 13, 2017 at 3:50 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 25 quoted lines
> Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:
>
>> As explained in the document. This option has an advantage over the
>> command sequence "git worktree add && git worktree lock": there will be
>> no gap that somebody can accidentally "prune" the new worktree (or soon,
>> explicitly "worktree remove" it).
>>
>> "worktree add" does keep a lock on while it's preparing the worktree.
>> If --lock is specified, this lock remains after the worktree is created.
>>
>> Suggested-by: David Taylor <David.Taylor@dell.com>
>> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
>> ---
>>  A patch that adds --lock may look like this.
>
> This looks more like "I do believe the idea by David is a useful
> addition and here is how I did it to the best of my ability---let's
> make sure we polish it for eventual inclusion" than a mere "it may
> look like so---do whatever you want with it" patch.
>
> To me "git worktree add --lock" somehow sounds less correct than
> "git worktree add --locked", but I'd appreciate if natives can
> correct me.
>
> Thanks.

I think either "--lock" or "--locked" works for me. "--locked' suggests "this is the state I want the tree in" while "--lock" suggests "this is the action I want taken on the tree".

Thanks, Jake

Previous: taylor, davidNext: Junio C Hamano
Message 7 of 10 in “git work trees”
  1. taylor, davidApr 11, 2017
  2. Duy NguyenApr 12, 2017
  3. worktree add: add --lock optionNguyễn Thái Ngọc Duy, Apr 12, 2017
  4. Junio C HamanoApr 13, 2017
  5. Duy NguyenApr 14, 2017
  6. taylor, davidApr 24, 2017
  7. Jacob KellerApr 14, 2017
  8. Junio C HamanoApr 15, 2017
  9. Junio C HamanoApr 15, 2017
  10. Duy NguyenApr 15, 2017

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.