Re: New orphan worktree?

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

 



>> not a good example to support the use of the "--orphan" option.
> I agree with that part, slathering infrastructure and abstractions on
> oneliners (okay, twoliners) is suspect in my book. worktree add,
> symoblic ref (really, no need to get lowlevel there, checkout --orphan
> does it) done. Tag an empty commit and the sequence gets closer
> to a legit oneliner
>
>     git worktree add foo empty; git -C foo checkout --orphan newbranch

FWIW, I'd be quite happy to have an ad-hoc revision which represents
"the (currently non-existing) ancestor shared by all branches".
Assuming we'd call it "ORPHAN" (other names that come to mind would be
"ROOT", "GOD", "∅", "BIGBANG", ...), then

    git checkout --orphan newbranch

would become

    git checkout -b newbranch ORPHAN

and then I'd also be able to say

    got worktree add -b newbranch foo ORPHAN

I've had occasional use for such a pseudo-revision in other
circumstances as well and I think I'd find it easier to remember how to
use this then the `--orphan` option.


        Stefan





[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