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

Re: [RFC PATCH] builtin/worktree: enhance worktree removal

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Nov 22, 2017, 18:05 UTC
Message-ID
<CAPig+cQF6V8HNdMX5AZbmz3_w2WhSfA4SFfNhQqxXBqPXTZL+w@mail.gmail.com>
In-Reply-To
<fee60b19-bc8e-bbd8-9f5d-347b2f941b2e@gmail.com>

On Wed, Nov 22, 2017 at 12:09 PM, Kaartic Sivaraam <kaartic.sivaraam@gmail.com> wrote:

Show 18 quoted lines
> On Wednesday 22 November 2017 03:07 AM, Eric Sunshine wrote:
>> [1]: Excerpt from:
>> https://public-inbox.org/git/CAPig+cTTrv2C7JLu1dr4+N8xo+7YQ+deiwLDA835wBGD6fhS1g@mail.gmail.com/
>>
>> Other information which would be nice to display for each worktree
>> [by the 'list' command] (possibly controlled by a --verbose flag):
>>
>>     * the checked out branch or detached head
>>     * whether it is locked
>>          - the lock reason (if available)
>>          - and whether the worktree is currently accessible
>>      * whether it can be pruned
>>          - and the prune reason if so
>
> It would nice to see this information. It would be very useful but 'list'
> doesn't seem to be the right sub-sub-command to give such information. Maybe
> there should be a new sub-sub-command named 'info' or something to give such
> information?

I'm perfectly fine with having 'git worktree list' provide this extra information; that was the intention from the start. The "quick" summary of all worktrees provided by 'git worktree list' is exactly the sort of place where you're most likely to notice something unexpected, such as the missing worktree directory. And, this extra information doesn't have to be noisy:

--- 8< --- % git worktree list giggle 89ea799ffc [master] ../bobble f172cb543d [feature1] locked ../fumple 6453c84b7d (detached HEAD) prunable --- 8< ---

And, the verbose case:
--- 8< ---
% git worktree list -v
giggle     89ea799ffc [master]
../bobble  f172cb543d [feature1]
    locked: worktree on removable media
../fumple  6453c84b7d (detached HEAD)
    prunable: directory does not exist
--- 8< ---

An "info" command you speak of might also have value, but that's orthogonal to this extra information that 'git worktree list' could provide.

Previous: Kaartic Sivaraam
Message 17 of 17 in “builtin/worktree: enhance worktree removal”
  1. builtin/worktree: enhance worktree removalKaartic Sivaraam, Nov 21, 2017
  2. Eric SunshineNov 21, 2017
  3. Junio C HamanoNov 22, 2017
  4. Eric SunshineNov 22, 2017
  5. Eric SunshineNov 22, 2017
  6. Junio C HamanoNov 22, 2017
  7. Eric SunshineNov 22, 2017
  8. Kaartic SivaraamNov 22, 2017
  9. builtin/worktree: enhance worktree removalKaartic Sivaraam, Nov 27, 2017
  10. Junio C HamanoNov 28, 2017
  11. Eric SunshineNov 28, 2017
  12. Junio C HamanoNov 28, 2017
  13. Eric SunshineNov 28, 2017
  14. Kaartic SivaraamNov 28, 2017
  15. Kaartic SivaraamNov 22, 2017
  16. Kaartic SivaraamNov 22, 2017
  17. Eric SunshineNov 22, 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.