[prev in list] [next in list] [prev in thread] [next in thread]
List: git
Subject: Re: [PATCH] checkout --track: make up a sensible branch name if '-b' was omitted
From: Pieter de Bie <pieter () frim ! nl>
Date: 2008-08-09 21:44:49
Message-ID: A6E466C6-C3B5-40EB-940C-516CF4D02ADF () frim ! nl
[Download RAW message or body]
On Aug 9, 2008, at 11:11 PM, Junio C Hamano wrote:
>>> (1) You may not necessarily are used to --track, but may still
>>> want this
>>> done. It might not be a bad idea to associate this "local
>>> dwimming"
>>> to creation of a new branch. In other words, all of these:
>>>
>>> $ git checkout -b origin/next
>>
>> This cannot be dwimmed, as it literally means "start a new branch
>> called
>> 'origin/next' from HEAD".
>
> Right. Forget this part.
This is too bad. I often see people make mistakes like
git checkout -b origin/master
or
git checkout -b origin/master origin/master
which should be
git checkout -b origin/master master
I think both forms should at least be an error if the remote branch
"origin/master" already exists, as then suddenly they aren't reachable
anymore by using "origin/master".
Changing the behaviour to mean "git checkout -b origin/master master"
will change the meaning, but who uses -b with an existing remote
branch anyway? I think the current behaviour leads to more confusion
in every case and should at least error out ("Error: creating a local
repository with the same name as the remote is not allowed") or do
what it's meant to do, which is create a local repository with the
trailing part.
Just my .02,
- Pieter
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic