Thread (4 messages) flat view 4 messages, 3 authors, 2016-06-15

Re: [PATCH] checkout --track: make up a sensible branch name if '-b' was omitted

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:45:07

Johannes Schindelin [off-list ref] writes:
On Sat, 9 Aug 2008, Junio C Hamano wrote:
...
At first, I liked the thoughts, but...
quoted
(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.
quoted
(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.

Don't mistake this comment as "I oppose to the patch".  I was hoping
people who care, not necessarily you, might come up with a clean UI and
mechanism to let users affect how this dwimmery would work depending on
how the users want to work, by raising this point as something to ponder
on.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help