On Mon, Nov 14, 2022 at 11:53 PM Taylor Blau <me@xxxxxxxxxxxx> wrote: > * ja/worktree-orphan (2022-11-10) 2 commits > - worktree add: add --orphan flag > - worktree add: Include -B in usage docs > > 'git worktree add' learned how to create a worktree based on an > orphaned branch with `--orphan`. > > Waiting for review discussion to settle, but leaning negative. > source: <20221110233137.10414-1-jacobabel@xxxxxxxxxx> I haven't had a chance yet to look at Jacob's v3, but this series does close a gap in worktree usability[*], and v3 addresses a stated concern of mine against earlier iterations, so I think a "negative lean" may not be warranted. [*] In particular, it is currently impossible to create a worktree from a brand new bare repository: % git init --bare foo.git % git -C foo.git worktree add -b main bar Preparing worktree (new branch 'main') fatal: not a valid object name: 'HEAD' % whereas, with this patch series: % git init --bare foo.git % git -C foo.git worktree add --orphan main bar Preparing worktree (new branch 'main') % (The commit message can probably be improved to spell this out since it wasn't obvious to me, simply from reading the commit message, that this problem existed.)