Re: What's cooking in git.git (Nov 2022, #03; Mon, 14)
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Nov 15, 2022, 20:58 UTC
- Message-ID
- <CAPig+cSKaW0ejeVgS7XEphMibdmExxO_T+xjMo6My5SAfwou_Q@mail.gmail.com>
- In-Reply-To
- <Y3Mag8qG2D3qjlmg@nand.local>
On Mon, Nov 14, 2022 at 11:53 PM Taylor Blau <me@ttaylorr.com> wrote:
Show 9 quoted lines
> * 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@nullpo.dev>
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.)