From: Thomas Glanzmann <sithglan@stud.uni-erlangen.de>
To: Junio C Hamano <junkio@cox.net>
Cc: Linus Torvalds <torvalds@osdl.org>,
Git Mailing List <git@vger.kernel.org>
Subject: Re: More gitweb queries..
Date: Mon, 30 May 2005 03:30:56 +0200 [thread overview]
Message-ID: <20050530013056.GH12290@cip.informatik.uni-erlangen.de> (raw)
In-Reply-To: <7vsm05bkps.fsf@assigned-by-dhcp.cox.net>
Hello,
okay let me try again.
I have a function merge which gets a sorted array of heads. Heads can be
unlimited at the time because some of the heads can be included into
other heads (they're a subset) and so they don't show up in the commit
object. I call this array MERGE_HEADS.
Note: If I pull into an empty tree (no HEAD) there is only one head in
this array which corresponds to the remote_head. Otherwise the first
element is *always* the local HEAD.
After that I am starting looping over MERGE_HEADS. The first thing I
have to do is getting the first element out of this array and safe it
for later reference I call this 'head'. Also I have to push this head in
a another array called COMMIT_HEADS which will be used to create the final
commit object later on. The latter will be done for every loop pass. next;
Note: If I left the the loop because there are no more MERGE_HEADS to
work on and my COMMIT_HEADS array consists only of *one* member I don't
create a COMMIT object, but save it as new HEAD because we're in a fast
forward condition (this could be pulling into an empty tree; having many
fast forward object (remote is ahead or included into the current
'head'). On the contrary if I have *more* than one object I call
commit-tree with the COMMIT_HEADS as arguments and save the new head
return from this call.
Now I start processing the second HEAD from MERGE_HEADS. I use
merge_base to find out the MERGE_BASE. If this MERGE_BASE ==
head than we have a (remote is fast forward condition) so our
CURRENT_HEAD becomes head and I delete the week of the last element of
COMMIT_HEADS (but leaving the CURRENT_HEAD in COMMIT_HEADS). next;
If MERGE_BASE == CURRENT_HEAD than CURRENT_HEAD is already included in
our history so no need to anything, but get it out of COMMIT_HEADS.
next; If it isn't a fast forward or already included case, we do
automatic/threeway/manual merge and save the resulting tree for the
maybe to come next automatic/threeway/manual merge. And of course also
leaving the CURRENT_HEAD in COMMIT_HEADS. FIXME: Do we need to update
our 'head' to the REMOTE_HEAD? next;
Oh and of course the sanity check: I can't commit-tree more than 16
parents at a time. (16 is of course the define mentioned by Linus
before).
That's it.
Thomas
next prev parent reply other threads:[~2005-05-30 1:28 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-27 19:24 More gitweb queries Linus Torvalds
2005-05-27 19:29 ` Thomas Glanzmann
2005-05-27 19:52 ` Junio C Hamano
2005-05-27 19:55 ` Thomas Glanzmann
2005-05-27 20:13 ` Junio C Hamano
2005-05-27 20:32 ` Thomas Glanzmann
2005-05-27 20:40 ` Junio C Hamano
2005-05-27 22:00 ` Linus Torvalds
2005-05-27 22:04 ` Thomas Glanzmann
2005-05-28 2:26 ` Junio C Hamano
2005-05-29 23:02 ` Thomas Glanzmann
2005-05-29 23:10 ` Thomas Glanzmann
2005-05-29 23:16 ` Thomas Glanzmann
2005-05-29 23:46 ` Thomas Glanzmann
2005-05-29 23:56 ` Thomas Glanzmann
2005-05-30 0:50 ` Junio C Hamano
2005-05-30 0:57 ` Junio C Hamano
2005-05-30 1:33 ` Thomas Glanzmann
2005-05-30 1:30 ` Thomas Glanzmann [this message]
2005-05-30 7:57 ` Junio C Hamano
2005-05-30 8:36 ` Thomas Glanzmann
2005-05-30 9:21 ` Thomas Glanzmann
2005-05-30 10:20 ` Junio C Hamano
2005-05-30 12:11 ` Thomas Glanzmann
2005-05-30 17:54 ` Junio C Hamano
2005-05-27 20:17 ` Linus Torvalds
2005-05-27 19:54 ` Junio C Hamano
2005-05-27 19:58 ` Thomas Glanzmann
2005-05-27 20:03 ` Linus Torvalds
2005-05-27 20:24 ` Junio C Hamano
2005-05-27 19:31 ` Thomas Glanzmann
2005-05-27 19:32 ` Junio C Hamano
2005-05-27 19:48 ` Linus Torvalds
2005-05-27 23:12 ` Benjamin Herrenschmidt
2005-05-27 23:59 ` Kay Sievers
2005-05-28 1:03 ` Daniel Serpell
2005-05-28 2:51 ` David Lang
2005-05-28 10:56 ` Kay Sievers
2005-05-28 8:42 ` Kay Sievers
2005-05-28 22:43 ` Benjamin Herrenschmidt
2005-05-30 23:03 ` Paul Mackerras
2005-05-31 2:27 ` Jeff Epler
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=20050530013056.GH12290@cip.informatik.uni-erlangen.de \
--to=sithglan@stud.uni-erlangen.de \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
--cc=torvalds@osdl.org \
/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).