Re: Multi-branch committing in git, revisited

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Multi-branch committing in git, revisited
Date: 2010-09-22 13:24:00
Message-ID: 201009221324.o8MDO0k11057@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Okay, so now that I've actually done a couple of multi-branch commits...
>
> I'm using the multiple-work-directory arrangement suggested on our wiki
> page. The work flow seems to boil down to:
>
> * Prepare patch in master
> * Stage patch with git add
> * git diff --staged >/tmp/patch-head
> * cd into REL9_0_STABLE workdir
> * patch -p0 </tmp/patch-head
> * Adjust patch if needed
> * Stage patch with git add
> * git diff --staged >/tmp/patch-90
> * cd into REL8_4_STABLE workdir
> * patch -p0 </tmp/patch-90
> * ... lather, rinse, repeat ...
> * cd back to master
> * git commit -F /tmp/commitmsg
> * cd into REL9_0_STABLE workdir
> * git commit -F /tmp/commitmsg
> * cd into REL8_4_STABLE workdir
> * git commit -F /tmp/commitmsg
> * ... lather, rinse, repeat ...
> * git push

Uh, just to be clear, the above is more complex than necessary because
git diff will show all uncommitted modifications. You could just do:

> * Prepare patch in master
> * git diff >/tmp/patch-head
> * cd into REL9_0_STABLE workdir
> * patch -p0 </tmp/patch-head
> * Adjust patch if needed
...

There is no need for 'git add' because once you are done you can use git
commmit -a in each branch to add all modifications and commit them. I
think this exactly matches how we did thing with CVS. A final 'git
push' sends them to the remote repository. This causes commits to all
happen around the same time.

I am not saying that is the way we should to it, but it is clearly
possible.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2010-09-22 13:29:30 Re: Per-column collation, work in progress
Previous Message Robert Haas 2010-09-22 13:20:42 Re: Multi-branch committing in git, revisited