Re: [PATCH/RFC] builtin-checkout: suggest creating local branch when appropriate to do so

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

 



Eugene Sajine <euguess@xxxxxxxxx> writes:

>  As for the solution i would choose the "simplest thing that will work" - so
>  i think that we just have to notify user about his suicide attempt to
>  checkout nonlocal branch and offer him a correct syntax to go with.

We already do that, without going interactive, for warning unintended
detachment:

    $ git checkout origin/next
    Note: moving to 'origin/next' which isn't a local branch
    If you want to create a new branch from this checkout, you may do so
    (now or later) by using -b with the checkout command again. Example:
      git checkout -b <new_branch_name>
    ...

As to Mikael's scenario:

>>> I can imagine this happening:
>>> % git clone git://git.git git
>>> % git checkout next
>>> do you want to checkout origin/next? y
>>> # a few days later
>>> % git fetch
>>> % git checkout next
>>> [freenode] /join #git
>>> [#git] i did git checkout next but my files are still the same?

No amount of sugarcoating the checkout syntax changes the fact that in the
user's repository there _are_ two distinct refs, origin/next and next, and
the "fetch few days later" updates only the former but never the latter.
It can only be fixed by injecting a bit of clue to the user, in a way
Dscho suggested in the thread.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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]