Re: [PATCH] Documentation: add a planning document for the next CLI revamp
- From
Sam Vilain <sam@vilain.net>
- Date
- Oct 30, 2008, 17:31 UTC
- Message-ID
- <1225387882.19891.9.camel@maia.lan>
- In-Reply-To
- <alpine.LFD.2.00.0810301105350.13034@xanadu.home>
On Thu, 2008-10-30 at 12:53 -0400, Nicolas Pitre wrote:
Show 9 quoted lines
> > Seconded. > > > > Having git-checkout $foo being a shorthand for git checkout -b $foo > > origin/$foo when origin/$foo exists and $foo doesn't is definitely handy. > > No. This is only the first step towards insanity. > > In many cases origin/$foo == origin/master so this can't work in that > case which is, after all, the common case.
I don't understand that argument at all, can you explain further?
Show 7 quoted lines
> Therefore I think this is > wrong to add magic operations which are not useful for the common case > and actively _hide_ how git actually works. Not only will you have to > explain how git works anyway for that common origin/master case, but > you'll also have to explain why sometimes the magic works and sometimes > not. Please keep such convenience shortcuts for your own scripts and/or > aliases.
It's not about magic, it's about sensible defaults. Currently this use case is an error, and the resultant command is very long to type, and involves typing the branch name twice. I end up writing things like:
git checkout -b {,origin/}wr34251-do-somethingFor the user who doesn't know to use the ksh-style {} blocks this is voodoo. The longer form is cumbersome.
For the case where the thing you type is a resolvable reference, it would just check it out, as now.
Sam.