Skip to content

Commit 7250cdb

Browse files
dgoudersgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Dirk Gouders <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent af38888 commit 7250cdb

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

Documentation/MyFirstObjectWalk.txt

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -754,10 +754,12 @@ points to the same tree object as its grandparent.)
754754
=== Counting Omitted Objects
755755

756756
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.
761763

762764
First, add the `struct oidset` and related items we will use to iterate it:
763765

@@ -778,8 +780,9 @@ static void walken_object_walk(
778780
...
779781
----
780782

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:
783786

784787
----
785788
...

0 commit comments

Comments
 (0)