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

Re: [PATCH 3/4] repack: add --sparse and pass to pack-objects

From
DFDr N.W. Filardo <nwf20@cam.ac.uk>
Date
Mar 12, 2019, 14:03 UTC
Message-ID
<ad762ef2fbe9f268068b9a406070591b@cam.ac.uk>
In-Reply-To
<f26c68df-8895-2a2d-0175-5fa3581ab45a@gmail.com>
On 2019-03-12 13:47, Derrick Stolee wrote:
Show 6 quoted lines
> On 3/12/2019 9:18 AM, Nathaniel Filardo wrote:
>> The sparse connectivity algorithm saves a whole lot of time when there
>> are UNINTERESTING trees around.
> 
> Interesting! Do you have some performance numbers to include with
> this statement?
Not UNINTERESTING? ;)

Not directly, no, but the performance numbers reported for the next patch in the series hinge on using sparse reachability. It seemed like a good idea to expose this knob through repack even if one isn't going to use the --assume-pack-keep-transitive flag introduced in the next patch.

Show 13 quoted lines
>> @@ -48,6 +49,10 @@ static int repack_config(const char *var, const 
>> char *value, void *cb)
>>  		use_delta_islands = git_config_bool(var, value);
>>  		return 0;
>>  	}
>> +	if (!strcmp(var, "pack.usesparse")) {
>> +		sparse = git_config_bool(var, value);
>> +		return 0;
>> +	}
> 
> This part is not handled inside of `pack-objects`. Since you are not
> sending '--no-sparse' when the variable 'sparse' is zero, the config
> setting will automatically be picked up by the pack-objects builtin.
OK, I will drop this hunk.
> Now, a question of whether you _should_ allow the '--no-sparse' option
> in the 'repack' command, and send it along to the inner command (when
> it is present) is another question.
I'm inclined to say yes, but am open to suggestions. :)
Show 14 quoted lines
>> @@ -366,6 +374,8 @@ int cmd_repack(int argc, const char **argv, const 
>> char *prefix)
>>  	argv_array_push(&cmd.args, "--all");
>>  	argv_array_push(&cmd.args, "--reflog");
>>  	argv_array_push(&cmd.args, "--indexed-objects");
>> +	if (sparse)
>> +		argv_array_push(&cmd.args, "--sparse");
>>  	if (repository_format_partial_clone)
>>  		argv_array_push(&cmd.args, "--exclude-promisor-objects");
>>  	if (write_bitmaps)
>> 
> 
> How about a test with this new option? You can probably just add to
> t5322-pack-objects-sparse.sh.
Can do.

Cheers, --nwf;

Previous: Derrick StoleeNext: Nathaniel Filardo
Message 4 of 8 in “Speed up repacking when lots of pack-kept objects”
  1. 0/4 Speed up repacking when lots of pack-kept objectsNathaniel Filardo, Mar 12, 2019
  2. 3/4 repack: add --sparse and pass to pack-objectsNathaniel Filardo, Mar 12, 2019
  3. Derrick StoleeMar 12, 2019
  4. Dr N.W. FilardoMar 12, 2019
  5. 1/4 count-objects: report statistics about kept packsNathaniel Filardo, Mar 12, 2019
  6. 4/4 repack: optionally assume transitive kept packsNathaniel Filardo, Mar 12, 2019
  7. 2/4 revision walk: optionally use sparse reachabilityNathaniel Filardo, Mar 12, 2019
  8. Derrick StoleeMar 12, 2019

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.