path: root/Documentation/technical/api-argv-array.txt
diff options
authorJeff King <>2012-04-18 21:10:19 (GMT)
committerJunio C Hamano <>2012-04-18 23:17:42 (GMT)
commit234587fc87b156dc20461fc61353beeb904b43bc (patch)
tree698f4806c37f7117e9cc2ef86c5fe35bd8e98c62 /Documentation/technical/api-argv-array.txt
parentd15bbe1379a12e2d9a5f18f7dc96b38afafc6c5d (diff)
gc: use argv-array for sub-commands
git-gc executes many sub-commands. The argument list for some of these is constant, but for others we add more arguments at runtime. The latter is implemented by allocating a constant extra number of NULLs, and either using a custom append function, or just referencing unused slots by number. As of commit 7e52f56, which added two new arguments, it is possible to exceed the constant number of slots for "repack" by running "git gc --aggressive", causing "git gc" to die. This patch converts all of the static argv lists to use argv-array. In addition to fixing the overflow caused by 7e52f56, it has a few advantages: 1. We can drop the custom append function (which, incidentally, had an off-by-one error exacerbating the static limit). 2. We can drop the ugly magic numbers used when adding arguments to "prune". 3. Adding further arguments will be easier; you can just add new "push" calls without worrying about increasing any static limits. Signed-off-by: Jeff King <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'Documentation/technical/api-argv-array.txt')
0 files changed, 0 insertions, 0 deletions