git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: "Andreas Schwab" <schwab@linux-m68k.org>,
	"Richard Hartmann" <richih.mailinglist@gmail.com>,
	"Git List" <git@vger.kernel.org>,
	"Nguyễn Thái Ngọc" <pclouds@gmail.com>
Subject: Re: Cloning into an existing, non-empty directory?
Date: Mon, 25 Apr 2011 14:37:16 -0400	[thread overview]
Message-ID: <20110425183715.GA24069@sigill.intra.peff.net> (raw)
In-Reply-To: <20110425085913.GB28885@elie>

On Mon, Apr 25, 2011 at 03:59:13AM -0500, Jonathan Nieder wrote:

> who wonders where his origin/HEAD symref came from and if
> "git remote set-head --auto origin" was ever automatic

It is created by "clone", but not by "git remote add". The "auto" in
remote's "set-head" means "right now, look up the HEAD on the remote and
set our $remote/HEAD based on it". Not anything about being set up or
tracked automatically.

Perhaps "git remote add" should automatically do "set-head --auto", just
as if you had cloned. I think the main reason against it is that doing
so requires hitting the network, which "remote add" (without "-f") does
not otherwise need to do.

Certainly if we are doing "-f", it would not be a big deal. In other
cases, we could perhaps fill in the value on the first "fetch", but we
may need infrastructure to know when we are on the first fetch (and it
is not simply the case that the user deleted $remote/HEAD themselves).

-Peff

  reply	other threads:[~2011-04-25 18:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-21 21:27 Cloning into an existing, non-empty directory? Richard Hartmann
2011-04-21 22:03 ` Jonathan Nieder
2011-04-22 11:21   ` Richard Hartmann
2011-04-23 10:15     ` Jonathan Nieder
2011-04-23 10:28       ` Nguyen Thai Ngoc Duy
2011-04-23 10:37         ` Jonathan Nieder
2011-04-23 22:11       ` Richard Hartmann
2011-04-25  8:00         ` Jonathan Nieder
2011-04-25  8:40           ` Andreas Schwab
2011-04-25  8:59             ` Jonathan Nieder
2011-04-25 18:37               ` Jeff King [this message]
2011-04-25 14:08           ` Richard Hartmann

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=20110425183715.GA24069@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=jrnieder@gmail.com \
    --cc=pclouds@gmail.com \
    --cc=richih.mailinglist@gmail.com \
    --cc=schwab@linux-m68k.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).