git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: git@vger.kernel.org, gitster@pobox.com
Subject: Re: [PATCH] checkout --track: make up a sensible branch name if '-b' was omitted
Date: Sat, 09 Aug 2008 12:46:36 -0700	[thread overview]
Message-ID: <7vvdya55ur.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <7vtzdu6nb7.fsf@gitster.siamese.dyndns.org> (Junio C. Hamano's message of "Sat, 09 Aug 2008 11:44:12 -0700")

Junio C Hamano <gitster@pobox.com> writes:

> Johannes Schindelin <Johannes.Schindelin@gmx.de> 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

  reply	other threads:[~2008-08-09 19:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-09 14:00 [PATCH] checkout --track: make up a sensible branch name if '-b' was omitted Johannes Schindelin
2008-08-09 18:44 ` Junio C Hamano
2008-08-09 19:46   ` Junio C Hamano [this message]
2008-08-09 21:08     ` Johannes Schindelin
2008-08-09 21:11       ` Junio C Hamano
2008-08-09 21:44         ` Pieter de Bie
2008-08-10 23:02           ` Johannes Schindelin
2008-08-11 11:01         ` Johannes Schindelin
2008-08-11 18:54           ` Junio C Hamano
2008-08-09 21:56       ` Tarmigan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vvdya55ur.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).