git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: More gitweb queries..

From
TGThomas Glanzmann <sithglan@stud.uni-erlangen.de>
Date
May 30, 2005, 01:30 UTC
Message-ID
<20050530013056.GH12290@cip.informatik.uni-erlangen.de>
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
Previous: Thomas GlanzmannNext: Junio C Hamano
Message 24 of 42 in “More gitweb queries..”
  1. Linus TorvaldsMay 27, 2005
  2. Thomas GlanzmannMay 27, 2005
  3. Junio C HamanoMay 27, 2005
  4. Thomas GlanzmannMay 27, 2005
  5. Junio C HamanoMay 27, 2005
  6. Linus TorvaldsMay 27, 2005
  7. Junio C HamanoMay 27, 2005
  8. Thomas GlanzmannMay 27, 2005
  9. Linus TorvaldsMay 27, 2005
  10. Junio C HamanoMay 27, 2005
  11. Thomas GlanzmannMay 27, 2005
  12. Junio C HamanoMay 27, 2005
  13. Linus TorvaldsMay 27, 2005
  14. Thomas GlanzmannMay 27, 2005
  15. Junio C HamanoMay 28, 2005
  16. Thomas GlanzmannMay 29, 2005
  17. Thomas GlanzmannMay 29, 2005
  18. Thomas GlanzmannMay 29, 2005
  19. Thomas GlanzmannMay 29, 2005
  20. Thomas GlanzmannMay 29, 2005
  21. Junio C HamanoMay 30, 2005
  22. Junio C HamanoMay 30, 2005
  23. Thomas GlanzmannMay 30, 2005
  24. Thomas GlanzmannMay 30, 2005
  25. Junio C HamanoMay 30, 2005
  26. Thomas GlanzmannMay 30, 2005
  27. Thomas GlanzmannMay 30, 2005
  28. Junio C HamanoMay 30, 2005
  29. Thomas GlanzmannMay 30, 2005
  30. Junio C HamanoMay 30, 2005
  31. Thomas GlanzmannMay 27, 2005
  32. Junio C HamanoMay 27, 2005
  33. Linus TorvaldsMay 27, 2005
  34. Benjamin HerrenschmidtMay 27, 2005
  35. Kay SieversMay 27, 2005
  36. Daniel SerpellMay 28, 2005
  37. David LangMay 28, 2005
  38. Kay SieversMay 28, 2005
  39. Kay SieversMay 28, 2005
  40. Benjamin HerrenschmidtMay 28, 2005
  41. Paul MackerrasMay 30, 2005
  42. Jeff EplerMay 31, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.