Re: [PATCH] worktree add: introduce basic DWYM for --orphan

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 23/01/16 10:52AM, Phillip Wood wrote:
> 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.





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux