MyFirstObjectWalk: fix description for counting omitted objects

Before the changes to count omitted objects, the function traverse_commit_list() was used and its call cannot be changed to pass a pointer to an oidset to record omitted objects. Fix the text to clarify that we now use another traversal function to be able to pass the pointer to the introduced oidset. Helped-by: Kyle Lippincott <spectral@google.com> Signed-off-by: Dirk Gouders <dirk@gouders.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Dirk Gouders committed Mar 27, 2024 at 12:22 UTC 7250cdb695e7a57521f0f0e8c35e7185ecbc925c
1 file changed +9 -6
Documentation/MyFirstObjectWalk.txt
+9 -6
@@ -754,10 +754,12 @@ points to the same tree object as its grandparent.)
754 === Counting Omitted Objects
755
756 We also have the capability to enumerate all objects which were omitted by a
757 -filter, like with `git log --filter=<spec> --filter-print-omitted`. Asking
758 -`traverse_commit_list_filtered()` to populate the `omitted` list means that our
759 -object walk does not perform any better than an unfiltered object walk; all
760 -reachable objects are walked in order to populate the list.
757 +filter, like with `git log --filter=<spec> --filter-print-omitted`. To do this,
758 +change `traverse_commit_list()` to `traverse_commit_list_filtered()`, which is
759 +able to populate an `omitted` list. Asking for this list of filtered objects
760 +may cause performance degradations, however, because in this case, despite
761 +filtering objects, the possibly much larger set of all reachable objects must
762 +be processed in order to populate that list.
763
764 First, add the `struct oidset` and related items we will use to iterate it:
765
@@ -778,8 +780,9 @@ static void walken_object_walk(
780 ...
781 ----
782
781 -Modify the call to `traverse_commit_list_filtered()` to include your `omitted`
782 -object:
783 +Replace the call to `traverse_commit_list()` with
784 +`traverse_commit_list_filtered()` and pass a pointer to the `omitted` oidset
785 +defined and initialized above:
786
787 ----
788 ...