Re: master^ is not a local branch -- huh?!?
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 29, 2010, 21:58 UTC
- Message-ID
- <7viqakh8ty.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <alpine.LFD.2.00.1001291641200.1681@xanadu.home>
Nicolas Pitre <nico@fluxnic.net> writes:
Show 8 quoted lines
> What purpose does this "feature" serve? Making sure people remain > stupid and get even more confused when the special dwimery doesn't work > because they don't know the difference between a local branch and a > remote tracking branch? > > And now people will be left wondering why after a fetch they don't get > the latest stuff when they do "git checkout topic" again. Is this any > better?
Sverre's explanation does not match reality.
We used to just say "topic is not a rev nor path" and failed when the user said "git checkout topic". And the magic kicks in when there is only one "remotes/*/topic".
Because this cannot be any request other than to check out a local branch "topic", and because there is no place more sensible than the "topic" taken from the "origin" (as that is the sole place that has "topic"), it dwims as a shorthand for "checkout -b topic origin/topic" and tells you that it did so.
So people _has_ to still know that local branches are the only thing they can check out (iow, "checkout topic" is not a request to check out a remote tracking branch).