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

Re: [PATCH v2 2/4] bundle API: change "flags" to be "extra_index_pack_args"

From
Derrick Stolee <stolee@gmail.com>
Date
Aug 24, 2021, 21:48 UTC
Message-ID
<a70b7c7a-ecd7-b4f8-c253-65c4bf5de4a4@gmail.com>
In-Reply-To
<877dgaecum.fsf@evledraar.gmail.com>
On 8/24/2021 5:41 PM, Ævar Arnfjörð Bjarmason wrote:
Show 32 quoted lines
> 
> On Tue, Aug 24 2021, Derrick Stolee wrote:
> 
>> On 8/23/2021 7:02 AM, Ævar Arnfjörð Bjarmason wrote:
>>> +		strvec_clear(extra_index_pack_args);
>>
>> Why is it the responsibility of this method to clear these args?
>> I suppose it is convenient. It just seems a bit wrong to me.
> 
> Because of...
> 
>>>  /**
>>>   * Unbundle after reading the header with read_bundle_header().
>>>   *
>>>   * We'll invoke "git index-pack --stdin --fix-thin" for you on the
>>>   * provided `bundle_fd` from read_bundle_header().
>>> + *
>>> + * Provide extra_index_pack_args to pass any extra arguments
>>> + * (e.g. "-v" for verbose/progress), NULL otherwise. The provided
>>> + * extra_index_pack_args (if any) will be strvec_clear()'d for you
>>> + * (like the run-command.h API itself does).
> 
> ... this, i.e. it's how the run-command.[ch] API already works for the
> same sort of thing elsewhere, I figured making them consistent was
> better than having them differ.
> 
> I think that while in general the rule of having each function allocate
> & clear its own memory is a good one, that a notable good exception in
> our codebase is various "one-shot" functions such as the run-command
> API, i.e. APIs where the vast majority of callers just want to set
> things up for a one-off run. Having those common cases not require a
> that_api_release(&ctx) afterwards seems like a good idea in general.
Makes sense to me. Thanks for explaining it.
-Stolee
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 10 of 42 in “bundle: show progress on "unbundle"”
  1. 0/4 bundle: show progress on "unbundle"Ævar Arnfjörð Bjarmason, Jul 27, 2021
  2. 2/4 bundle API: change "flags" to be "extra_index_pack_args"Ævar Arnfjörð Bjarmason, Jul 27, 2021
  3. 1/4 bundle API: start writing API documentationÆvar Arnfjörð Bjarmason, Jul 27, 2021
  4. 3/4 index-pack: add --progress-title optionÆvar Arnfjörð Bjarmason, Jul 27, 2021
  5. 4/4 bundle: show progress on "unbundle"Ævar Arnfjörð Bjarmason, Jul 27, 2021
  6. 0/4 bundle: show progress on "unbundle"Ævar Arnfjörð Bjarmason, Aug 23, 2021
  7. 2/4 bundle API: change "flags" to be "extra_index_pack_args"Ævar Arnfjörð Bjarmason, Aug 23, 2021
  8. Derrick StoleeAug 24, 2021
  9. Ævar Arnfjörð BjarmasonAug 24, 2021
  10. Derrick StoleeAug 24, 2021
  11. 1/4 bundle API: start writing API documentationÆvar Arnfjörð Bjarmason, Aug 23, 2021
  12. Derrick StoleeAug 24, 2021
  13. Ævar Arnfjörð BjarmasonAug 24, 2021
  14. 3/4 index-pack: add --progress-title optionÆvar Arnfjörð Bjarmason, Aug 23, 2021
  15. Derrick StoleeAug 24, 2021
  16. Ævar Arnfjörð BjarmasonAug 24, 2021
  17. 4/4 bundle: show progress on "unbundle"Ævar Arnfjörð Bjarmason, Aug 23, 2021
  18. Derrick StoleeAug 24, 2021
  19. Ævar Arnfjörð BjarmasonAug 24, 2021
  20. 0/5 bundle: show progress on "unbundle"Ævar Arnfjörð Bjarmason, Aug 26, 2021
  21. 1/5 bundle API: start writing API documentationÆvar Arnfjörð Bjarmason, Aug 26, 2021
  22. 3/5 bundle API: change "flags" to be "extra_index_pack_args"Ævar Arnfjörð Bjarmason, Aug 26, 2021
  23. Junio C HamanoAug 28, 2021
  24. 2/5 strvec: add a strvec_pushvec()Ævar Arnfjörð Bjarmason, Aug 26, 2021
  25. Junio C HamanoAug 28, 2021
  26. Junio C HamanoAug 28, 2021
  27. Jeff KingAug 28, 2021
  28. Junio C HamanoAug 29, 2021
  29. Derrick StoleeAug 30, 2021
  30. Ævar Arnfjörð BjarmasonSep 2, 2021
  31. Junio C HamanoSep 3, 2021
  32. Jeff KingSep 3, 2021
  33. 4/5 index-pack: add --progress-title optionÆvar Arnfjörð Bjarmason, Aug 26, 2021
  34. Junio C HamanoAug 28, 2021
  35. 5/5 bundle: show progress on "unbundle"Ævar Arnfjörð Bjarmason, Aug 26, 2021
  36. Junio C HamanoAug 28, 2021
  37. Ævar Arnfjörð BjarmasonSep 2, 2021
  38. 0/4 bundle: show progress on "unbundle"Ævar Arnfjörð Bjarmason, Sep 5, 2021
  39. 1/4 bundle API: start writing API documentationÆvar Arnfjörð Bjarmason, Sep 5, 2021
  40. 2/4 bundle API: change "flags" to be "extra_index_pack_args"Ævar Arnfjörð Bjarmason, Sep 5, 2021
  41. 3/4 index-pack: add --progress-title optionÆvar Arnfjörð Bjarmason, Sep 5, 2021
  42. 4/4 bundle: show progress on "unbundle"Ævar Arnfjörð Bjarmason, Sep 5, 2021

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.