Re: [PATCH] worktree add: introduce basic DWYM for --orphan
- From
Jacob Abel <jacobabel@nullpo.dev>
- Date
- Jan 18, 2023, 20:43 UTC
- Message-ID
- <20230118204323.gn6rs3gydybsqt4g@phi>
- In-Reply-To
- <cddc6987-3b58-4688-65f8-3da0fbd1cc51@dunelm.org.uk>
On 23/01/16 10:52AM, Phillip Wood wrote:
Show 44 quoted lines
> Hi Jacob > > On 14/01/2023 22:50, Jacob Abel wrote: > > Introduces a DWYM shorthand of --orphan for when the worktree directory > > and the to-be-created branch share the same name. > > > > Current Behavior: > > % git worktree list > > /path/to/git/repo a38d39a4c5 [main] > > % git worktree add --orphan new_branch ../new_branch/ > > Preparing worktree (new branch 'new_branch') > > % git worktree add --orphan ../new_branch2/ > > usage: git worktree add [<options>] <path> [<commit-ish>] > > or: git worktree list [<options>] > > [...] > > % > > > > New Behavior: > > > > % git worktree list > > /path/to/git/repo a38d39a4c5 [main] > > % git worktree add --orphan new_branch ../new_branch/ > > Preparing worktree (new branch 'new_branch') > > % git worktree list > > /path/to/git/repo a38d39a4c5 [main] > > /path/to/git/new_branch a38d39a4c5 [new_branch] > > % git worktree add --orphan ../new_branch2/ > > Preparing worktree (new branch 'new_branch2') > > % git worktree list > > /path/to/git/repo a38d39a4c5 [main] > > /path/to/git/new_branch a38d39a4c5 [new_branch] > > /path/to/git/new_branch2 a38d39a4c5 [new_branch2] > > % > > Thanks for working on this. As I said in my previous mail I think it > would be easier to use OPT_BOOL() for --orphan from the start. By using > OPT_STRING() you'll run into problems with "git worktree add --orphan > --lock <directory>" > > Best Wishes > > Phillip > > > [...]
Ah, good point. I missed that.
Also given the way the conversation is going, I'll drop this patch and integrate the changes into the patches of the main series since I'll be re-rolling.