Re: [PATCH v6 1/2] worktree: add 'for_each_worktree' function
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Aug 31, 2015, 21:37 UTC
- Message-ID
- <CAPig+cTV517TizuBUSd=NbF=-wvPtEpVLTeFVFivYLJ1dyNwLQ@mail.gmail.com>
- In-Reply-To
- <CANoM8SUy_MGbLzaLrkaaNxbXYiisiu8cwnWuy6QDtGvw6HCf9w@mail.gmail.com>
On Mon, Aug 31, 2015 at 3:54 PM, Mike Rappazzo <rappazzo@gmail.com> wrote:
Show 24 quoted lines
> On Mon, Aug 31, 2015 at 3:47 PM, Eric Sunshine <sunshine@sunshineco.com> wrote: >> On Mon, Aug 31, 2015 at 2:57 PM, Mike Rappazzo <rappazzo@gmail.com> wrote: >>> I wasn't sure that a bare repo would be considered a worktree. I >>> don't think that it would be >>> a good idea to include it. In the same vein that I can't checkout a >>> branch in a bare repo, it >>> figure that it shouldn't be in the list. >> >> I forgot to mention in my previous response that I have the opposite >> view, and think that a bare repo should be included in the output of >> "git worktree list". The reason is that the intention of "git worktree >> list" is to give the user a consolidated view of the locations of all >> components of his "workspace". By "workspace", I mean the repository >> (bare or not) and its worktrees. >> >> In the typical case, the .git directory resides within the main >> worktree (the first item output by "git worktree list"), thus is >> easily found, however, if "git worktree list" hides bare repos, then >> the user will have no way to easily locate the repository (without >> resorting to lower-level commands or peeking at configuration files). > > This makes sense, but would we also want to decorate it in the `git > worktree list` > command? Would porcelain list output be able to differentiate it?
I don't have strong feelings about decorating the bare repository, if by "decorate", you mean adding a "[bare]" annotation or something. Verbose mode can certainly do so.
For porcelain mode, we can (and should) be explicit about it.