From: Marc Branchaud <marcnarc@xiplink.com>
To: Michael J Gruber <michaeljgruber+gmane@fastmail.fm>
Cc: Michael J Gruber <git@drmicha.warpmail.net>,
Peter Harris <git@peter.is-a-geek.org>,
git@vger.kernel.org
Subject: Re: Working with remotes; cloning remote references
Date: Mon, 20 Oct 2008 12:50:00 -0400 [thread overview]
Message-ID: <48FCB6B8.6090708@xiplink.com> (raw)
In-Reply-To: <48FC8624.9090807@fastmail.fm>
Thanks for the explicit instructions, but I think I'm still missing
something. Here's exactly what I'm trying, just to make sure I'm not
doing something odd.
First I set up the remote in the main repo:
main/$ git remote add -f ThingOne git://thing/ThingOne.git
main/$ git merge -s ours --no-commit ThingOne/master
main/$ git read-tree --prefix=thing-one/ -u ThingOne/master
main/$ git commit -m "Adding ThingOne"
Then I make a clone, fetch main's refs to ThingOne, and try to pull in
changes from ThingOne by using those refs:
$ git clone /path/to/main clone
$ cd clone
clone/$ git config remote.origin.fetch \
'+refs/remotes/ThingOne/*:refs/remotes/ThingOne/*'
clone/$ git fetch
From /path/to/main/
* [new branch] ThingOne/master -> ThingOne/master
clone/$ git pull -s subtree git://thing/ThingOne.git ThingOne/master
fatal: Couldn't find remote ref ThingOne/master
The config & fetch commands indeed add a
.git/refs/remotes/ThingOne/master file to the clone, but I'm missing the
magic words for how to use that ref.
Also:
Michael J Gruber wrote:
>
>> And actually, git's remote functionality feels a bit crippled if clones
>> can't make some use of the origin's remotes. Is there a reason for
>> keeping remote definitions out of a clone?
>
> Say A and B are working on a project C. Then, typically, A is interested
> in B's work on C, i.e. some of B's local branches, but not on B's remote
> tracking branches: A tracks a "central" C already, just like B does,
> and remote tracking branches don't carry any "value adding" by the
> cloner, they're just a local unmodified copy of the remote.
I can appreciate that, but the approach leads to two consequences that I
suggest should be avoidable:
1. A and B both have to set up the references to C themselves. A can't
just piggyback on whatever B has already set up. (This is the impetus
for my original message.)
2. Suppose B is just a repository that's being shared between A and D --
i.e. there's no B entity doing any work directly in B. In this case if
A (or D) wants to change B's reference to C (say, to track a new branch
in C), they can't: B has to be changed directly, and nothing can be done
in a clone to accomplish this.
I admit I'm picking at nits here -- obviously someone is able to access
the B repo and do whatever needs doing. I just feel that there are some
situations where you want the origin's remotes in your clone, and some
where you don't, and git should let you decide.
Marc
next prev parent reply other threads:[~2008-10-20 16:51 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-16 18:17 Working with remotes; cloning remote references Marc Branchaud
2008-10-16 19:20 ` Peter Harris
2008-10-16 20:29 ` Marc Branchaud
2008-10-16 20:45 ` Peter Harris
2008-10-16 22:09 ` Marc Branchaud
2008-10-17 7:33 ` Michael J Gruber
2008-10-17 14:44 ` Marc Branchaud
2008-10-17 15:08 ` Michael J Gruber
2008-10-17 19:50 ` Marc Branchaud
2008-10-20 13:22 ` Michael J Gruber
2008-10-20 16:50 ` Marc Branchaud [this message]
2008-10-21 9:49 ` Michael J Gruber
2008-10-21 15:17 ` Marc Branchaud
2008-10-22 14:59 ` Michael J Gruber
2008-10-22 16:13 ` Terminology question: "tracking" branches Björn Steinbrink
2008-10-23 8:07 ` Michael J Gruber
2008-10-27 15:43 ` Marc Branchaud
2008-10-27 16:17 ` Björn Steinbrink
2008-10-27 18:44 ` Johannes Schindelin
2008-10-27 16:28 ` Björn Steinbrink
2008-10-28 8:01 ` Björn Steinbrink
2008-10-27 19:54 ` Working with remotes; cloning remote references Marc Branchaud
2008-10-28 8:12 ` Michael J Gruber
2008-10-28 16:27 ` Marc Branchaud
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=48FCB6B8.6090708@xiplink.com \
--to=marcnarc@xiplink.com \
--cc=git@drmicha.warpmail.net \
--cc=git@peter.is-a-geek.org \
--cc=git@vger.kernel.org \
--cc=michaeljgruber+gmane@fastmail.fm \
/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).