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

Re: [PATCH 0/3] worktree: add -d shorthand for --detach & improve documentation

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 6, 2020, 21:58 UTC
Message-ID
<xmqqlfhm36v2.fsf@gitster.c.googlers.com>
In-Reply-To
<20200904070703.47898-1-sunshine@sunshineco.com>
Eric Sunshine <sunshine@sunshineco.com> writes:
Show 5 quoted lines
> This series grew directly out of suggestions proposed in [1]. Its
> purpose is twofold. First, it brings git-worktree in line with the other
> "checkout a branch" commands git-switch and git-checkout by teaching it
> -d as shorthand for --detach (which those other commands already
> understand).

Hmph, "checkout" would not affect list of worktrees, but "worktree" could be used to delete an worktree, so I (or any other naive user like me) may mistake "-d" to mean "delete a worktree".

But it is not "teach 'worktree' that -d is shorthand for --detach"; it is "teach 'worktree add' that -d is for --detach". And in that context, when adding a new worktree, there is no room for such a confusion to come into the picture.

So I think it is just the way the series is marketted that triggered a potential negative reaction from me.

>   worktree: add -d short option for --detach
Previous: Eric SunshineNext: Eric Sunshine
Message 5 of 9 in “worktree: add -d shorthand for --detach & improve documentation”
  1. 0/3 worktree: add -d shorthand for --detach & improve documentationEric Sunshine, Sep 4, 2020
  2. 2/3 worktree: add -d short option for --detachEric Sunshine, Sep 4, 2020
  3. 1/3 git-checkout.txt: document -d short option for --detachEric Sunshine, Sep 4, 2020
  4. 3/3 git-worktree.txt: discuss branch-based vs. throwaway worktreesEric Sunshine, Sep 4, 2020
  5. Junio C HamanoSep 6, 2020
  6. 0/3 worktree: teach `add` -d for --detach & improve documentationEric Sunshine, Sep 7, 2020
  7. 2/3 worktree: teach `add` to recognize -d as shorthand for --detachEric Sunshine, Sep 7, 2020
  8. 1/3 git-checkout.txt: document -d short option for --detachEric Sunshine, Sep 7, 2020
  9. 3/3 git-worktree.txt: discuss branch-based vs. throwaway worktreesEric Sunshine, Sep 7, 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.