summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorDirk Gouders <dirk@gouders.net>2024-03-27 11:22:15 (GMT)
committerJunio C Hamano <gitster@pobox.com>2024-03-27 16:24:35 (GMT)
commit7250cdb695e7a57521f0f0e8c35e7185ecbc925c (patch)
tree741afb6abbdd75a9d36639af3dd511384d79bc84 /Documentation
parentaf3888890e7eda11c54f0eca96a69b8178f46bff (diff)
downloadgit-7250cdb695e7a57521f0f0e8c35e7185ecbc925c.zip
git-7250cdb695e7a57521f0f0e8c35e7185ecbc925c.tar.gz
git-7250cdb695e7a57521f0f0e8c35e7185ecbc925c.tar.bz2
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>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/MyFirstObjectWalk.txt15
1 files changed, 9 insertions, 6 deletions
diff --git a/Documentation/MyFirstObjectWalk.txt b/Documentation/MyFirstObjectWalk.txt
index a06c712..e969a3a 100644
--- a/Documentation/MyFirstObjectWalk.txt
+++ b/Documentation/MyFirstObjectWalk.txt
@@ -754,10 +754,12 @@ points to the same tree object as its grandparent.)
=== Counting Omitted Objects
We also have the capability to enumerate all objects which were omitted by a
-filter, like with `git log --filter=<spec> --filter-print-omitted`. Asking
-`traverse_commit_list_filtered()` to populate the `omitted` list means that our
-object walk does not perform any better than an unfiltered object walk; all
-reachable objects are walked in order to populate the list.
+filter, like with `git log --filter=<spec> --filter-print-omitted`. To do this,
+change `traverse_commit_list()` to `traverse_commit_list_filtered()`, which is
+able to populate an `omitted` list. Asking for this list of filtered objects
+may cause performance degradations, however, because in this case, despite
+filtering objects, the possibly much larger set of all reachable objects must
+be processed in order to populate that list.
First, add the `struct oidset` and related items we will use to iterate it:
@@ -778,8 +780,9 @@ static void walken_object_walk(
...
----
-Modify the call to `traverse_commit_list_filtered()` to include your `omitted`
-object:
+Replace the call to `traverse_commit_list()` with
+`traverse_commit_list_filtered()` and pass a pointer to the `omitted` oidset
+defined and initialized above:
----
...