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

Re: [PATCH v2 4/5] MyFirstObjectWalk: fix description for counting omitted objects

From
Dirk Gouders <dirk@gouders.net>
Date
Mar 23, 2024, 22:46 UTC
Message-ID
<gh8r28zhw5.fsf@gouders.net>
In-Reply-To
<jikdly5drampltlvxuex67iz77isgt7uqcnf45ocmrozgbhyaq@2g7kucs2ordg>
Kyle Lippincott <spectral@google.com> writes:
Show 36 quoted lines
> On Tue, Mar 19, 2024 at 12:23:14PM +0100, Dirk Gouders wrote:
>> 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.
>> 
>> Signed-off-by: Dirk Gouders <dirk@gouders.net>
>> ---
>>  Documentation/MyFirstObjectWalk.txt | 14 ++++++++------
>>  1 file changed, 8 insertions(+), 6 deletions(-)
>> 
>> diff --git a/Documentation/MyFirstObjectWalk.txt b/Documentation/MyFirstObjectWalk.txt
>> index a06c712e46..981dbf917b 100644
>> --- a/Documentation/MyFirstObjectWalk.txt
>> +++ b/Documentation/MyFirstObjectWalk.txt
>> @@ -754,10 +754,11 @@ 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`. We
>> +can ask `traverse_commit_list_filtered()` to populate the `omitted`
>> +list which 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.
>
> The way the original was phrased makes it sound to me like "Doing <stuff> via
> <mechanismA> is potentially slow.", and I expect a counter-proposal of using
> mechanismB to resolve that. The rewrite partially avoids that, but I think could
> take it further to really drive home that this is a consequence of using this
> new function, and is not a failing we will be proposing a solution for:
Yes, I had similar thoughts.
Show 23 quoted lines
>  We can ask `traverse_commit_list_filtered()` to populate the `omitted` list.
> +Note that this means that our object walk will not perform any better than
>  an unfiltered object walk; all reachable objects are walked in order
>  to populate the list.
>
> Since that first sentence is now shorter, we could also add a bit more nuance to
> it, calling out that we're going to switch which function we're using earlier
> (and technically redundantly, but I think that's fine); something like the
> following:
>
>  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
> +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. Note that this means that our object walk
> +will not perform any better than an unfiltered object walk; all reachable
> +objects are walked in order to populate the list.
>
> Feel free to wordsmith any of my proposed text, and I apologize that these are
> just me typing in something that looks "patch like" in my mail client, not
> properly formatted patches. I think what you have is already an improvement,
> though, so if you think my proposed text is too verbose, I'm fine with what you
> have.

Thank you for your suggestion. To me, this fits much better and I will use it should no further improvements being asked for.

Show 21 quoted lines
>>  
>>  First, add the `struct oidset` and related items we will use to iterate it:
>>  
>> @@ -778,8 +779,9 @@ static void walken_object_walk(
>>  	...
>>  ----
>>  
>> -Modify the call to `traverse_commit_list_filtered()` to include your `omitted`
>> -object:
>> +You need to replace the call to `traverse_commit_list()` to
>
> If my proposal to introduce the point that we're switching which function we use
> in the earlier diff hunk is accepted, there's a small nit here: saying "You need
> to" would feel (very slightly) awkward, since we already mentioned that it was
> necessary to accomplish the goal. If we accept the previous proposal, we may
> want to change this to remove the "You need to", and just state something like
> "Replace the call..."
>
> Regardless, I think saying "replace the call to A _with_ B" (instead of "A _to_
> B") reads slightly better. I don't know if that's just a personal
> preference/dialect though.

When I wrote that "You need to" it felt semi-optimal even to me non-native speaker, but I didn't exactly know what to do with it. So, I'm very glad you are helping me to do all that better.

Show 12 quoted lines
>> +`traverse_commit_list_filtered()` to be able to pass a pointer to the
>
> If we remove the "You need to", then we should probably rephrase this to more
> of an instruction, changing "to be able to" to "and".
>
> Something like this:
>
> -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:
Sounds way better and I'd use it.
Thanks again,
Dirk
Previous: Kyle LippincottNext: Dirk Gouders
Message 8 of 49 in “Fixes for Documentation/MyFirstObjectWalk.txt”
  1. 0/5 Fixes for Documentation/MyFirstObjectWalk.txtDirk Gouders, Mar 19, 2024
  2. 1/5 MyFirstObjectWalk: use additional arg in config_fn_tDirk Gouders, Mar 19, 2024
  3. Kyle LippincottMar 23, 2024
  4. 2/5 MyFirstObjectWalk: fix misspelled "builtins/"Dirk Gouders, Mar 19, 2024
  5. 3/5 MyFirstObjectWalk: fix filtered object walkDirk Gouders, Mar 19, 2024
  6. 4/5 MyFirstObjectWalk: fix description for counting omitted objectsDirk Gouders, Mar 19, 2024
  7. Kyle LippincottMar 23, 2024
  8. Dirk GoudersMar 23, 2024
  9. 5/5 MyFirstObjectWalk: add stderr to pipe processingDirk Gouders, Mar 19, 2024
  10. Kyle LippincottMar 23, 2024
  11. Dirk GoudersMar 23, 2024
  12. Kyle LippincottMar 23, 2024
  13. Dirk GoudersMar 23, 2024
  14. Junio C HamanoMar 24, 2024
  15. 0/5 Fixes for Documentation/MyFirstObjectWalk.txtDirk Gouders, Mar 25, 2024
  16. 2/5 MyFirstObjectWalk: fix misspelled "builtins/"Dirk Gouders, Mar 25, 2024
  17. 3/5 MyFirstObjectWalk: fix filtered object walkDirk Gouders, Mar 25, 2024
  18. 4/5 MyFirstObjectWalk: fix description for counting omitted objectsDirk Gouders, Mar 25, 2024
  19. Junio C HamanoMar 25, 2024
  20. Dirk GoudersMar 25, 2024
  21. Junio C HamanoMar 25, 2024
  22. Kyle LippincottMar 25, 2024
  23. 5/5 MyFirstObjectWalk: add stderr to pipe processingDirk Gouders, Mar 25, 2024
  24. 1/5 MyFirstObjectWalk: use additional arg in config_fn_tDirk Gouders, Mar 25, 2024
  25. Junio C HamanoMar 25, 2024
  26. Dirk GoudersMar 25, 2024
  27. Kyle LippincottMar 25, 2024
  28. Dirk GoudersMar 25, 2024
  29. Junio C HamanoMar 25, 2024
  30. Kyle LippincottMar 25, 2024
  31. Dirk GoudersMar 25, 2024
  32. 0/5 Fixes for Documentation/MyFirstObjectWalk.txtDirk Gouders, Mar 26, 2024
  33. Kyle LippincottMar 27, 2024
  34. Dirk GoudersMar 27, 2024
  35. 0/5 Fixes for Documentation/MyFirstObjectWalk.txtDirk Gouders, Mar 27, 2024
  36. 1/5 MyFirstObjectWalk: use additional arg in config_fn_tDirk Gouders, Mar 27, 2024
  37. 2/5 MyFirstObjectWalk: fix misspelled "builtins/"Dirk Gouders, Mar 27, 2024
  38. 3/5 MyFirstObjectWalk: fix filtered object walkDirk Gouders, Mar 27, 2024
  39. 4/5 MyFirstObjectWalk: fix description for counting omitted objectsDirk Gouders, Mar 27, 2024
  40. 5/5 MyFirstObjectWalk: add stderr to pipe processingDirk Gouders, Mar 27, 2024
  41. 1/5 MyFirstObjectWalk: use additional arg in config_fn_tDirk Gouders, Mar 26, 2024
  42. 2/5 MyFirstObjectWalk: fix misspelled "builtins/"Dirk Gouders, Mar 26, 2024
  43. 3/5 MyFirstObjectWalk: fix filtered object walkDirk Gouders, Mar 26, 2024
  44. 4/5 MyFirstObjectWalk: fix description for counting omitted objectsDirk Gouders, Mar 26, 2024
  45. Junio C HamanoMar 26, 2024
  46. Dirk GoudersMar 26, 2024
  47. Junio C HamanoMar 26, 2024
  48. Dirk GoudersMar 27, 2024
  49. 5/5 MyFirstObjectWalk: add stderr to pipe processingDirk Gouders, Mar 26, 2024

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.