From: "Santi Béjar" <santi@agolina.net>
To: Michael J Gruber <git@drmicha.warpmail.net>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: RFC for 1.7: Do not checkout -b master origin/master on clone
Date: Tue, 11 Aug 2009 23:06:02 +0200 [thread overview]
Message-ID: <adf1fd3d0908111406w1ccae22fp3f26ecb89c67fa5e@mail.gmail.com> (raw)
In-Reply-To: <4A818B90.9050206@drmicha.warpmail.net>
2009/8/11 Michael J Gruber <git@drmicha.warpmail.net>:
> One common source of confusion for newcomers is the fact that master is
> given such a special treatment in git. While it is certainly okay and
> helpful to set up a default branch in a new repository (git init) it is
> not at all clear why it should be treated specially in any other
> situation, such as:
>
> - Why is master the only local branch which git clone sets up (git
> checkout -b master origin/master)?
Because master is the default branch in the remote repository?
[...]
> This behaviour not only is hard to justify; in fact it gives users a
> completely wrong impression: by pretending that master is special,
It is not hard to justify (the git clone behavior). master is not
special, it is just the default branch, but you can change it changing
the HEAD symlink.
> but
> also by hiding core concepts (distinguishing local/remote branches,
> detached heads) from the user at a point where that very hiding leads to
> confusion.
>
> Under the hood, it is of course HEAD which is given special treatment
> (and which in the majority of repos points to master), and git clone
> sets up a local branch according to HEAD (and does some other guess work
> when cloning bare repos), which means that git clone shows the same
> "random" behaviour which git svn clone does: Which local branch is set
> up by default depends on the current value of HEAD/most recent commit at
> the time of the cloning operation.
It's not random. And please don't mix the "git clone" and "git svn" case.
> So, I suggest that starting with git 1.7:
>
> - git clone does not set up any local branches at all
I think you should first think if this is going to really help
newcomers. I think this would be worst.
Instead of "why only 'master'?" the question will be "why I don't get
any files in the workdir?"
"git clone checks out the default branch, and this is 'master' by
default" is not that hard.
HTH,
Santi
next prev parent reply other threads:[~2009-08-11 21:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-11 15:17 RFC for 1.7: Do not checkout -b master origin/master on clone Michael J Gruber
2009-08-11 21:06 ` Santi Béjar [this message]
2009-08-12 2:45 ` Junio C Hamano
2009-08-12 9:56 ` Eric Wong
2009-08-17 17:45 ` Matthieu Moy
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=adf1fd3d0908111406w1ccae22fp3f26ecb89c67fa5e@mail.gmail.com \
--to=santi@agolina.net \
--cc=git@drmicha.warpmail.net \
--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).