git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RFC for 1.7: Do not checkout -b master origin/master on clone
@ 2009-08-11 15:17 Michael J Gruber
  2009-08-11 21:06 ` Santi Béjar
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Michael J Gruber @ 2009-08-11 15:17 UTC (permalink / raw)
  To: Git Mailing List

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)?

- Why does git svn set up a local branch with an svn upstream which is
determined by latest svn commit at the time of the first git svn fetch?

This behaviour not only is hard to justify; in fact it gives users a
completely wrong impression: by pretending that master is special, 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.

So, I suggest that starting with git 1.7:

- git clone does not set up any local branches at all
- git svn fetch does not set up any local branches at all

Ducking under my desk...
Michael

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-08-17 17:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2009-08-12  2:45 ` Junio C Hamano
2009-08-12  9:56   ` Eric Wong
2009-08-17 17:45 ` Matthieu Moy

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).