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

From Aidan Van Dyk
Subject Re: Managing multiple branches in git
Date
Msg-id 20090602162347.GF23972@yugib.highrise.ca
Whole thread Raw
In response to Re: Managing multiple branches in git  ("David E. Wheeler" <david@kineticode.com>)
Responses Re: Managing multiple branches in git  ("David E. Wheeler" <david@kineticode.com>)
List pgsql-hackers
* David E. Wheeler <david@kineticode.com> [090602 11:56]:
> On Jun 2, 2009, at 8:43 AM, Tom Lane wrote:
>
>> Each of these is configured (using --prefix) to install into a  
>> separate
>> installation tree.  So I can switch my attention to one branch or
>> another by cd'ing to the right place and adjusting a few environment
>> variables such as PATH and PGDATA.
>
> Yeah, with git, rather than cd'ing to another directory, you'd just do  
> `git checkout rel8_3` and work from the same directory.

But that looses his "configured" and "compiled" state...

But git isn't forcing him to change his workflow at all...

He *can* keep completely separate "git repositories" for each release
and work just as before.  This will carry with it a full "separate"
history in each repository, and I think that extra couple hundred MB is
what he's hoping to avoid.

But git has concepts of "object alternates" and "reference
repositories".  To mimic your workflow, I would probably do something
like:
## Make my reference repository, cloned from "offical" where everyone pushesmountie@pumpkin:~/projects/postgresql$ git
clone--bare --mirror git://repo.or.cz/PostgreSQL.git PostgreSQL.git
 
## Make my local master development repositorymountie@pumpkin:~/projects/postgresql$ git clone --reference
PostgreSQL.gitgit://repo.or.cz/PostgreSQL.git masterInitialized empty Git repository in
/home/mountie/projects/postgresql/master/.git/
## Make my local REL8_3_STABLE development repositorymountie@pumpkin:~/projects/postgresql$ git clone --reference
PostgreSQL.gitgit://repo.or.cz/PostgreSQL.git REL8_3_STABLEInitialized empty Git repository in
/home/mountie/projects/postgresql/REL8_3_STABLE/.git/mountie@pumpkin:~/projects/postgresql$cd
REL8_3_STABLE/mountie@pumpkin:~/projects/postgresql/REL8_3_STABLE$git checkout --track -b REL8_3_STABLE
origin/REL8_3_STABLEBranchREL8_3_STABLE set up to track remote branch refs/remotes/origin/REL8_3_STABLE.Switched to a
newbranch 'REL8_3_STABLE'
 


Now, the master/REL8_3_STABLE directories are both complete git
repositories, independant of eachother, except that they both reference
the "objects" in the PostgreSQL.git repository.  They don't contain the
historical objects in their own object store.  And I would couple that
with a cronjob:
*/15 * * *    git --git-dir=$HOME/projects/postgresql/PostgreSQL.git fetch --quiet

which will keep my "reference" project up2date (a la rsync-the-CVSROOT,
or cvsup-a-mirror anybody currently has when working with CVS)...

Then Tom can keep working pretty much as he currently does.

a.

-- 
Aidan Van Dyk                                             Create like a god,
aidan@highrise.ca                                       command like a king,
http://www.highrise.ca/                                   work like a slave.

pgsql-hackers by date:

Previous
From: Dave Page
Date:
Subject: Re: Managing multiple branches in git
Next
From: Marko Kreen
Date:
Subject: Re: Managing multiple branches in git