Re: Managing multiple branches in git

From: Mark Mielke <mark(at)mark(dot)mielke(dot)cc>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "David E(dot) Wheeler" <david(at)kineticode(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Managing multiple branches in git
Date: 2009-06-02 20:38:31
Message-ID: 4A258DC7.7070209@mark.mielke.cc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas wrote:
> On Tue, Jun 2, 2009 at 3:58 PM, Andres Freund <andres(at)anarazel(dot)de> wrote:
>
>> #Method 1
>> 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.
>>
>
> Yeah but now you have to push and pull commits between your numerous
> local working copies. Boo, hiss.
>

Why? They are only references. They are effectively local caches. Why
push to them at all?

Push to the central repo. The local copy ("caches") will pick up the
changes eventually. If you really find .git getting larger and this is a
problem (never been a problem for me), "git gc" can keep it to a minimum.

>> #Method2
>> cd /../child3
>> git clone --shared /../postgresql/ child3
>> ...
>> This way you only fetch from your "pulled" tree and never possibly from the
>> upstream one.
>>
>
> This is so unsafe it's not even worth talking about. See git-clone(1)

It's not actually unsafe. There are just things to consider.
Particularly, if history is ever removed from /../postgresql/ then the
child3 can become corrupt. There is an easy solution here - don't remove
history from /../postgresql/.

I use the above to save space in a binary-heavy (each workspace is 150
Mbytes+ without --shared) git repo among three designers. It works fine.
We've never had a problem.

That said, I wouldn't recommend it be used unless you do in fact
understand the problem well.

Cheers,
mark

--
Mark Mielke <mark(at)mielke(dot)cc>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Sushant Sinha 2009-06-02 20:40:51 Re: dot to be considered as a word delimiter?
Previous Message Tom Lane 2009-06-02 20:36:50 Re: Locks on temp table and PREPARE