All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bill Lear <rael@zopyra.com>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org
Subject: Re: Question on git fetch to bare repo
Date: Mon, 12 Feb 2007 14:47:02 -0600	[thread overview]
Message-ID: <17872.53830.887188.137662@lisa.zopyra.com> (raw)
In-Reply-To: <20070209023941.GE10574@coredump.intra.peff.net>

On Thursday, February 8, 2007 at 21:39:41 (-0500) Jeff King writes:
>...
>You're more on the right track here, but not quite. If you want to save
>things in branches, you either need to use a 'remotes' shorthand (which
>defines pull lines with refspecs) or you need to specify the refspec on
>the command line (like master:master). However, you _don't_ want to
>fetch directly into your master branch. fetch is for copying refs and
>objects, not for merging (and you've presumably made some commits on
>master that the upstream doesn't have).
>
>It seems like you're trying to merge in your "public" repository, which
>is a mistake. I think you would be much better served to think of your
>public repository as a place where you publish changes (_only_ from your
>private repository), and do all of your external fetching and merging in
>your private repository. Everyone has a public repo, so you always
>"pull" from other people's public repos, and "push" into your public
>repo. Thus you don't need --shared at all.

Ok, I've gotten some time to read through this.  Kinda sad that
something published 4 days ago seems like the distant past ...

The problem I have with doing all of my fetching and merging in my
private repo is this: I have an update hook in my public repo that I
use to communicate my changes to my peers.  The problem is when I pull
from a peer's repo into my private repo, make some of my changes, and
then publish (push) my changes to the public repo, HIS changes are
pushed as well, and the update script naturally picks up on these and
broadcasts them.  My peer group ends up getting the same update
message about his commits that they have already received.  Multiply
this among 6 peers and it becomes a real headache.

On the other hand, if I fetch his changes into my public (bare) repo
first, and then pull from there into my private, make changes in my
private and then commit and publish to my public, the update script
will send out my changes --- and only MY changes --- to my peers.

So, what I have (just now) tried to do (using the latest 1.5 code),
is clone my public repo to create my private repo:

% git clone /repos/git/project

and my .git/config file is now:

% cat .git/config
[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
[remote "origin"]
        url = /repos/git/project
        fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
        remote = origin
        merge = refs/heads/master

and no .git/remotes/origin exists.

I notice that this did not "clone" all the branches in my public repo:

% git branch
* master

whereas in my public repo:

% cd /repos/git/project
% git --bare branch
  topic
* master

So, regardless if I can correct that (very confused as to why the
clone did not grab the branch), it seems that I did not make my intent
clear...

I'm still not sure if I'm obeying the "don't develop on anything
on the RHS of ':' dictum".

I'm going to puzzle over the rest of your advice to see if I can
grok it and fold it into the new (1.5) way of life.


Bill

  parent reply	other threads:[~2007-02-12 20:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-08 22:28 Question on git fetch to bare repo Bill Lear
2007-02-08 22:34 ` Jakub Narebski
2007-02-09  0:22   ` Johannes Schindelin
2007-02-09  0:24     ` Johannes Schindelin
2007-02-09  2:39 ` Jeff King
2007-02-09  4:19   ` Bill Lear
2007-02-12 20:47   ` Bill Lear [this message]
2007-02-13  4:54     ` Jeff King
2007-02-13  5:28     ` Junio C Hamano
2007-02-13  5:31       ` Jeff King

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=17872.53830.887188.137662@lisa.zopyra.com \
    --to=rael@zopyra.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.