Re: [PATCH/RFC] builtin-checkout: suggest creating local branch when appropriate to do so
- From
Johannes Sixt <j.sixt@viscovery.net>
- Date
- Oct 13, 2009, 09:32 UTC
- Message-ID
- <4AD44911.6070902@viscovery.net>
- In-Reply-To
- <7vljjf226t.fsf@alter.siamese.dyndns.org>
Junio C Hamano schrieb:
> #1. These used to detach, but will create a local branch > > $ git checkout origin/next ;# as if with -t > $ git checkout xyzzy/frotz ;# as if with -t (origin is not special)
If I did 'git checkout origin/next' last week, I will already have a branch next. What should happen if I do it again today?
I think that it should DWIM: If last week's next fast-fowards to this week's origin/next (*and* next is the branch that tracks origin/next), then the fast foward should happen. Otherwise 'git checkout origin/next' should fail.
This way, if I built on last week's next, I will be notified; but if I only want to browse history, then I won't be impeded by the existence of next.
-- Hannes