Re: [PATCH v2 1/5] worktree.c: add find_worktree_by_path()
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- May 30, 2016, 09:56 UTC
- Message-ID
- <CACsJy8D1WsrA9723FR_m8jR3W4RaiUtu7KHK-37-qLcj9+NfhQ@mail.gmail.com>
- In-Reply-To
- <CAPig+cRnt4ELACEitEkiZxbVT9Uk8hzdj0Ts7cwZwh2qPoa1cA@mail.gmail.com>
On Mon, May 23, 2016 at 11:11 AM, Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 13 quoted lines
> On Sun, May 22, 2016 at 6:43 AM, Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote: >> So far we haven't needed to identify an existing worktree from command >> line. Future commands such as lock or move will need it. There are of >> course other options for identifying a worktree, for example by branch >> or even by internal id. They may be added later if proved useful. > > Beyond the above methods for specifying a worktree, [1] adds > $(basename $path) as a possibility if not ambiguous. Excerpt: > > For git-worktree commands such as "lock", "mv", "remove", it > likely will be nice to allow people to specify the linked > worktree not only by path, but also by tag, and possibly even by > $(basename $path) if not ambiguous.
Thanks. This changes things. Turns out my "find_by_path" API cannot be easily extended to support identifying worktrees some other way. I will need to pass the command line argument as-is, so that this "find_worktree" (by any means) has enough info to decide (especially about ambiguation).
-- Duy