On Wed, Feb 9, 2011 at 7:49 PM, Andy Ross <a...@plausible.org> wrote:

> On 02/09/2011 12:02 AM, Tim Moore wrote:
> > "Backing out" is done with git reset --hard last_good_commit. Often the
> name of the last good commit is HEAD^, the last commit. However, after a
> botched merge it is good to verify that with git log or graphically with
> gitk.
>
> I should have said "HEAD^ is the previous commit on the current branch." I
believe this is the case in the absence of exotic options to git merge.

> Actually, unless I've misunderstood your point, this won't work: the commit
> history following a merge is an interleaved mix of two branches.  You can't
> just walk back to "before" the merge.  Doing that gets to to the equivalent
> of
> git merge-base, which is the last version that includes *none* of the
> changes
> in *either* branch.
>
A merge commit has two parent commits (leaving aside octopus commits). If
you are not happy with the results of the merge, usually you want to revert
back to the parent that was on your branch. As you say, the reflog can be
useful for checking this, but usually the parent of the botched merge on
your branch is HEAD^.

I'm not sure what you mean by the history "is an interleaved mix of two
branches." git log shows the commits in reverse chronological order by
default, but the parent-child relationships of the commits in the two
branches is definitely preserved.

Tim

>
> I don't think that's what Curt wants.  See my comment to Anders about git
> reflog.
> (and yes, I've made exactly this mistake in the past, heh)
>
> Andy
>
>
>
> ------------------------------------------------------------------------------
> The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
> Pinpoint memory and threading errors before they happen.
> Find and fix more than 250 security defects in the development cycle.
> Locate bottlenecks in serial and parallel code that limit performance.
> http://p.sf.net/sfu/intel-dev2devfeb
> _______________________________________________
> Flightgear-devel mailing list
> Flightgear-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/flightgear-devel
>
------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to