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

Re: [PATCH 3/3] Make clear_commit_marks() clean harder

From
Junio C Hamano <junkio@cox.net>
Date
Jul 4, 2006, 08:20 UTC
Message-ID
<7vlkr9kchv.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.63.0607040951390.29667@wbgn013.biozentrum.uni-wuerzburg.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 5 quoted lines
>> If we didn't mark them, then clearing them would be a no-op, so nobody 
>> really cares.
>
> My point being: if we try to clear commits we could not have possibly 
> marked, because they were not yet parsed, this is wrong.

While you say above is correct, object.parsed bit does not give you enough information to decide if we could not have possibly marked or not, because it is perfectly valid to mark a commit that we have not parsed.

As Linus said in this thread already (I am rephrasing):
 - When you have a commit object, which is parsed, you can tell
   who its parents are; more importantly, at that point you have
   access to the commit objects for the parents already, but they
   may not have been parsed.
 - If you can make a decision whether the parents of a commit
   should be marked or not solely by looking at the commit, you
   are allowed to do so before parsing these parents.  The
   commit you look at to make that decision has to be parsed for
   you to know who the parents are, though.

Marking unparsed objects is a valid operation because even unparsed objects have flags field that is retained when they are later lazily parsed.

Right now, in the inner loop of the main loop of merge_base() code, we parse each parent and insert it into the &list, but instead we could parse commit (if not parsed yet) just before taking its parents list in the outer loop. That way we would parse the parents lazily and will have commits marked but still not parsed.

Previous: Johannes SchindelinNext: Rene Scharfe
Message 39 of 49 in “A note on merging conflicts..”
  1. Linus TorvaldsJul 1, 2006
  2. Junio C HamanoJul 1, 2006
  3. Linus TorvaldsJul 1, 2006
  4. Linus TorvaldsJul 1, 2006
  5. Rene ScharfeJul 1, 2006
  6. Johannes SchindelinJul 1, 2006
  7. Linus TorvaldsJul 1, 2006
  8. Rene ScharfeJul 1, 2006
  9. J. Bruce FieldsJul 1, 2006
  10. Linus TorvaldsJul 1, 2006
  11. Daniel BarkalowJul 1, 2006
  12. Linus TorvaldsJul 1, 2006
  13. Daniel BarkalowJul 1, 2006
  14. Daniel BarkalowJul 1, 2006
  15. Rene ScharfeJul 2, 2006
  16. Daniel BarkalowJul 2, 2006
  17. Linus TorvaldsJul 2, 2006
  18. Jakub NarebskiJul 1, 2006
  19. Linus TorvaldsJul 1, 2006
  20. Junio C HamanoJul 1, 2006
  21. Rene ScharfeJul 1, 2006
  22. Junio C HamanoJul 1, 2006
  23. Johannes SchindelinJul 1, 2006
  24. Linus TorvaldsJul 1, 2006
  25. Junio C HamanoJul 1, 2006
  26. Junio C HamanoJul 1, 2006
  27. 1/3 Add get_merge_bases_clean()Rene Scharfe, Jul 1, 2006
  28. Johannes SchindelinJul 1, 2006
  29. 2/3 Add '...' operator for revisionsRene Scharfe, Jul 1, 2006
  30. 3/3 Make clear_commit_marks() clean harderRene Scharfe, Jul 1, 2006
  31. Junio C HamanoJul 3, 2006
  32. Johannes SchindelinJul 3, 2006
  33. Linus TorvaldsJul 3, 2006
  34. Johannes SchindelinJul 3, 2006
  35. Junio C HamanoJul 3, 2006
  36. Johannes SchindelinJul 3, 2006
  37. Linus TorvaldsJul 3, 2006
  38. Johannes SchindelinJul 4, 2006
  39. Junio C HamanoJul 4, 2006
  40. 4/3 Fold get_merge_bases_clean() into get_merge_bases()Rene Scharfe, Jul 2, 2006
  41. Johannes SchindelinJul 2, 2006
  42. Linus TorvaldsJul 2, 2006
  43. Rene ScharfeJul 2, 2006
  44. Junio C HamanoJul 2, 2006
  45. Rene ScharfeJul 2, 2006
  46. Rene ScharfeJul 2, 2006
  47. Linus TorvaldsJul 2, 2006
  48. Linus TorvaldsJul 2, 2006
  49. Junio C HamanoJul 7, 2006

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.