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: "David E(dot) Wheeler" <david(at)kineticode(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Multi-branch committing in git, revisited
Date: 2010-09-22 03:30:13
Message-ID: 201009220330.o8M3UDD12338@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> "David E. Wheeler" <david(at)kineticode(dot)com> writes:
> > On Sep 21, 2010, at 8:01 PM, Bruce Momjian wrote:
> >>> Then they'd all be patched and staged.
> >>
> >> If I understand correctly, that 'git reset' will mark all branch changes
> >> as staged but not committed, and then you can commit all branches at
> >> once and push it. Is that right?
>
> > Right.
>
> You sure about the "staged" part? If I'm reading the git-reset man
> page correctly, this command will revert your commit position and index,
> leaving only the modified work files behind. So it looks to me like
> you need another round of git add, or at least git commit -a.

The command was:

git reset --soft HEAD^

The --soft says:

--soft
Does not touch the index file nor the working tree
at all, but requires them to be in a good order.
This leaves all your changed files "Changes to be
committed", as git status would put it.

and the HEAD^ is the same as HEAD^1, which is on commit backward from
HEAD. I assume ""Changes to be committed" means "staged".

> Offhand I think I like Andrew's recommendation of a shortlived branch
> better. In essence your idea is using the tip of "master" itself as a
> shortlived branch, which is maybe a bit too cute. If you get distracted

True.

--
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 Bruce Momjian 2010-09-22 03:31:56 Re: Multi-branch committing in git, revisited
Previous Message Tom Lane 2010-09-22 03:19:31 Re: Multi-branch committing in git, revisited