Re: Managing multiple branches in git - Mailing list pgsql-hackers

From Mark Mielke
Subject Re: Managing multiple branches in git
Date
Msg-id 4A258DC7.7070209@mark.mielke.cc
Whole thread Raw
In response to Re: Managing multiple branches in git  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Robert Haas wrote: <blockquote cite="mid:603c8f070906021313g54bcc303m29117566fda7acc@mail.gmail.com" type="cite"><pre
wrap="">OnTue, Jun 2, 2009 at 3:58 PM, Andres Freund <a class="moz-txt-link-rfc2396E"
href="mailto:andres@anarazel.de"><andres@anarazel.de></a>wrote: </pre><blockquote type="cite"><pre
wrap="">#Method1
 
cd /../child1
git clone --reference /../master/ git://git.postgresql.org/whatever .
cd /../child2
git clone --reference /../master/ git://git.postgresql.org/whatever .

This way you can fetch from the git url without problem, but when a object
is available locally it is not downloaded again.   </pre></blockquote><pre wrap="">
Yeah but now you have to push and pull commits between your numerous
local working copies.  Boo, hiss. </pre></blockquote><br /> Why? They are only references. They are effectively local
caches.Why push to them at all?<br /><br /> Push to the central repo. The local copy ("caches") will pick up the
changeseventually. If you really find .git getting larger and this is a problem (never been a problem for me), "git gc"
cankeep it to a minimum.<br /><br /><blockquote cite="mid:603c8f070906021313g54bcc303m29117566fda7acc@mail.gmail.com"
type="cite"><blockquotetype="cite"><pre wrap="">#Method2
 
cd /../child3
git clone --shared /../postgresql/ child3
...
This way you only fetch from your "pulled" tree and never possibly from the
upstream one.   </pre></blockquote><pre wrap="">
This is so unsafe it's not even worth talking about.  See git-clone(1)</pre></blockquote><br /> It's not actually
unsafe.There are just things to consider. Particularly, if history is ever removed from /../postgresql/ then the child3
canbecome corrupt. There is an easy solution here - don't remove history from /../postgresql/.<br /><br /> I use the
aboveto save space in a binary-heavy (each workspace is 150 Mbytes+ without --shared) git repo among three designers.
Itworks fine. We've never had a problem.<br /><br /> That said, I wouldn't recommend it be used unless you do in fact
understandthe problem well.<br /><br /> Cheers,<br /> mark<br /><br /><pre class="moz-signature" cols="72">-- 
 
Mark Mielke <a class="moz-txt-link-rfc2396E" href="mailto:mark@mielke.cc"><mark@mielke.cc></a>
</pre>

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Locks on temp table and PREPARE
Next
From: Alvaro Herrera
Date:
Subject: Re: Managing multiple branches in git