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

Re: [PATCH v3 2/5] strvec: add a strvec_pushvec()

From
Derrick Stolee <stolee@gmail.com>
Date
Aug 30, 2021, 17:30 UTC
Message-ID
<85e539bc-7af5-595e-bcf4-bf577eb3bdfd@gmail.com>
In-Reply-To
<xmqqzgsz7qnq.fsf@gitster.g>
On 8/29/2021 7:54 PM, Junio C Hamano wrote:
Show 9 quoted lines
> Jeff King <peff@peff.net> writes:
> 
>> I think we'd want the patch below. It can be applied independently
>> (though if we do take the index-iterating version of Ævar's patch, I
>> think it should switch to size_t).
> 
> Yeah, I do not see a strong need for _pushvec(), especially the
> variant that does not preallocate, when we have _pushv().  But the
> type fix below does make sense.
Thanks for chiming in. I was not aware of _pushv() when I asked
about the _pushvec() variant. Sorry, Ævar, for sending you down
an unnecessary direction.
 
Show 16 quoted lines
>> -- >8 --
>> Subject: [PATCH] strvec: use size_t to store nr and alloc
>>
>> We converted argv_array (which later became strvec) to use size_t in
>> 819f0e76b1 (argv-array: use size_t for count and alloc, 2020-07-28) in
>> order to avoid the possibility of integer overflow. But later, commit
>> d70a9eb611 (strvec: rename struct fields, 2020-07-28) accidentally
>> converted these back to ints!
>>
>> Those two commits were part of the same patch series. I'm pretty sure
>> what happened is that they were originally written in the opposite order
>> and then cleaned up and re-ordered during an interactive rebase. And
>> when resolving the inevitable conflict, I mistakenly took the "rename"
>> patch completely, accidentally dropping the type change.
>>
>> We can correct it now; better late than never.
...
Show 7 quoted lines
>>  struct strvec {
>>  	const char **v;
>> -	int nr;
>> -	int alloc;
>> +	size_t nr;
>> +	size_t alloc;
>>  };
This is also a good change to take.

Thanks, -Stolee

Previous: Junio C HamanoNext: Ævar Arnfjörð Bjarmason
Message 29 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.