Re: [PATCH] checkout --track: make up a sensible branch name if '-b' was omitted
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Aug 11, 2008, 11:01 UTC
- Message-ID
- <alpine.DEB.1.00.0808111256260.24820@pacific.mpi-cbg.de.mpi-cbg.de>
- In-Reply-To
- <7vsktd51wg.fsf@gitster.siamese.dyndns.org>
Hi,
On Sat, 9 Aug 2008, Junio C Hamano wrote:
Show 22 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes: > > > On Sat, 9 Aug 2008, Junio C Hamano wrote: > > ... > >> (2) If you work with somebody else, you might not want to have the name > >> mapping to be "s|^[^/]*/||" (i.e. drop "origin/"): > >> > >> $ git remote add -f jeff $url_to_his_repository > >> $ git checkout -b [--track] jeff-next jeff/next > >> $ git checkout -b [--track] origin-next origin/next > > > > As I said, I think you must not allow switching around the options -b > > and --track. > > Oh, that was a typo. "git checkout [--track] -b" was what I meant, but > the point was that with your patch "git checkout --track jeff/next" and > "git checkout --track origin/next" would create 'next' branch which will > not be useful for people who work with more than one repository. > > Yes, you can of course explicitly name what you want to create with -b, > but that argument goes directly against the "usability enhancement" > theme of your patch.
Not necessarily:
$ git checkout --track jeff/next Switched to a new branch "next"
[do a lot of work, even on that 'next' branch]
[weeks, months or centuries later, decide to do something on origin/next]
$ git checkout --track origin/next fatal: A branch named 'next' already exists.
[Ah! Slap your head, remembering that 'next' tracks jeff's 'next'] $ git branch -m next jeff-next Branch: next renamed to jeff-next $ git checkout --track -b origin-next origin/next
Concluding, I do not see how the DWIMing of the normal case impacts the non-normal case negatively.
Don't get me wrong. I do not need that patch in git.git desperately. But if it is rejected, I want it to be rejected for reasons I understand.
Ciao, Dscho