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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio C Hamano <gitster@xxxxxxxxx> writes:

> Johannes Schindelin <Johannes.Schindelin@xxxxxx> writes:
>
>> What does the user most likely want with this command?
>>
>> 	$ git checkout --track origin/next
>>
>> Exactly.  A branch called 'next', that tracks origin's branch 'next'.
>
> I like this.
>
> An explicit --track request from the command line (as opposed to happening
> to have "branch.autosetupmerge" configuration) is a very good cue that
> what the user wants to do is not to take a peek on a detached HEAD but a
> more permanent playpen created.

A couple more thoughts.

(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
    $ git checkout -b --track origin/next
    $ git checkout --track origin/next

    may merit the same dwimming.

(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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux