From: John Lumby <johnlumby@hotmail.com>
To: George Spelvin <linux@horizon.com>
Cc: git@vger.kernel.org, timmazid@hotmail.com
Subject: Re: git -- how to revert build to as-originally-cloned?
Date: Fri, 20 May 2011 15:18:37 -0400 [thread overview]
Message-ID: <4DD6BE8D.4080708@hotmail.com> (raw)
In-Reply-To: <20110520162502.7854.qmail@science.horizon.com>
On 05/20/11 12:25, George Spelvin wrote:
> Er, no. One "git merge" command produces (at most) one commit.
> It may be that the head of the branch you merged in was already
> a merge commit, but tha
>
> You may find "gitk" useful for for visualizing all of this.
I have tried gitk. Can you or someone tell me what the colours of the
nodes in the top left signifies?
Specifically, a commit of mine (done since all the merging I've been
asking about) shows as yellow,
whereas all the ones prior to that show as blue. (I have not altered
or changed the colour scheme so
it's whatever the default is)
>
> A merge *is* exactly one commit. A "merge commit" is just a commit with
> more than one ancestor. Now, that merge can *point to* lots of other
> commits, but it doesn't exactly "consist of" them.
>
>
>
> Now, what might have happened to you was a "fast forward" merge.
Yes! actually in the output of the merge command (that I showed in my
original posting) it said
Updating 72a8f97..1b1cb1f
Fast-forward
> If you have a history like this:
>
> o--o--o--a--b--c--d
>
> And you ask git to merge a and d together, the result will be simply d.
> Git, by default, avoids creating useless merges in such a case. So if
> you merge in someone else's work, and you haven't done anything locally
> since their branch split off from your HEAD, the result will not include
> a merge commit at all. (A NEW merge commit; they branch might include
> merge commits.)
>
> Since the top merges in your example are by Dave Miller (and not by you),
> it looks like that's what happened in this case.
Yes indeed, thanks for explaining.
So what would be the correct way, before doing my fast-forward merge,
to have made some kind of mark pointing at "a", which I could then have
used
to undo the fast-forward, without having to calculate the number of
commits in between?
(supposing my branch was not anchored at "a" but at some much earlier
point)?
Cheers, John Lumby
next prev parent reply other threads:[~2011-05-20 19:18 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-20 16:25 git -- how to revert build to as-originally-cloned? George Spelvin
2011-05-20 19:18 ` John Lumby [this message]
2011-05-20 19:34 ` Paul Ebermann
2011-05-20 20:22 ` George Spelvin
2011-05-20 20:26 ` George Spelvin
-- strict thread matches above, loose matches on Subject: below --
2011-05-18 22:53 John Lumby
2011-05-18 23:26 ` Tim Mazid
2011-05-19 15:27 ` John Lumby
2011-05-20 2:16 ` Tim Mazid
2011-05-20 14:15 ` John Lumby
2011-05-20 14:42 ` Philippe Vaucher
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4DD6BE8D.4080708@hotmail.com \
--to=johnlumby@hotmail.com \
--cc=git@vger.kernel.org \
--cc=linux@horizon.com \
--cc=timmazid@hotmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).