All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: git  --  how to revert build to as-originally-cloned?
@ 2011-05-20 16:25 George Spelvin
  2011-05-20 19:18 ` John Lumby
  0 siblings, 1 reply; 11+ messages in thread
From: George Spelvin @ 2011-05-20 16:25 UTC (permalink / raw)
  To: git, johnlumby, timmazid; +Cc: linux

Ah - I should have said that I selected only merges in my git log 
command  -
git log --merges
(With no qualifier, git log returns about 3.8 million lines /  150 MBytes,
hard to work with)

> And,  based on what the command now returns,  it seems that the first two
> that I listed before (which are no longer present) were as a result of my
> (single) merge command,  i.e. my merge resulted in merging :
>     .  two merges that were done by someone else in the master that I 
> cloned into my /b filesystem,
>      .  maybe some other non-merge commits that I did not query before 
> and now don't know

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.


> You've lost me here.  If a merge can consist of many commits,
> including other merges (see above), then how can one commit be a merge?
> Note that in my original git log --merges output that I posted in my
> earlier post, i.e. the one before I reset, there was *no* record of *my*
> merge command itself, only of the sub-merges that my merge dragged along.
> I think this is the crucial (to me) point - git did not record what I did,
> only the effects of what I did.  Not saying this is wrong or right,
> but significant.

Okay, here's the basic confusion.  Commits have pointers to other commits,
and are organized into a linked list.  (Actually, a directed acyclic graph,
since a commit can have more than one ancestor pointer.)
Thus, a commit identifies *both* a single snapshot *and* a complete
development history.  We tend to talk about a "commit" when describing
the former, and "branch" when talking about the latter, but they're
actually the same object.

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.

The other thing is that the ancestors of a merge are symmetrical.
They are numbered for reference, but the practical results of "merge
A with B" and "merge B with A" are identical.  Every commit points
to the full development history that produced it.


Now, what might have happened to you was a "fast forward" merge.
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.

^ permalink raw reply	[flat|nested] 11+ messages in thread
* git  --  how to revert build to as-originally-cloned?
@ 2011-05-18 22:53 John Lumby
  2011-05-18 23:26 ` Tim Mazid
  2011-05-20 14:42 ` Philippe Vaucher
  0 siblings, 2 replies; 11+ messages in thread
From: John Lumby @ 2011-05-18 22:53 UTC (permalink / raw)
  To: git

I am stuck trying to revert a private kernel build back to the state in 
which I originally cloned it,
(after probably doing the wrong thing  -  as below).     Hoping someone 
can advise.

Here's what I did   (helpful criticism welcome)

On machine MA in filesystem /a  on 13 May

git clone 
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6.git

(This build built ok and ran ok  and is what I want back)

A few days later on machine MB on filesystem /b  -  same git clone 
command but of course a slightly changed build.

Yesterday  -  I wanted to synch build a/ from b/  :
    git branch jel_r8169  /*  made a new branch --  ok */
    nfs-mounted /b on MA
    git fetch file:///a/.../net-next-2.6/.git   /*  worked  ok  *
    git merge FETCH_HEAD                        /*  worked ok and output 
list of files : */
               output started with
Updating 72a8f97..1b1cb1f
Fast-forward
               then list of files
               output ended with
   56 files changed, 3352 insertions(+), 886 deletions(-)
  create mode 100644 include/net/ping.h
  create mode 100644 net/ipv4/ping.c

I then built this build and built ok but build is broken  -
unresolved syms in some modules  -  I want to undo my merge.

I have tried all the commands I can find that claim to do this
and none of them have done it, e.g. :
   git reset --hard HEAD  /*  did nothing */
   git reset --hard ORIG_HEAD  /*  did nothing */

Not only that,  but none of the various show ,  log  ,  status commands
appear to be aware of the merge at all.    There appears to be no record 
of it -
but the actual files themselves are the updated ones.  (diff with /b 
compares equal)

How can I undo it?

Cheers    John Lumby

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2011-05-20 20:26 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-20 16:25 git -- how to revert build to as-originally-cloned? George Spelvin
2011-05-20 19:18 ` John Lumby
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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.