Re: [PATCH 05/10] unpack-trees: optimize full checkout case

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Nguyán ThÃi Ngác Duy wrote:

> Signed-off-by: Nguyán ThÃi Ngác Duy <pclouds@xxxxxxxxx>

So, what does it do?  What workflow was not optimized (yes, I know full
checkout means pattern "*", but the reader might not), why ought it to
be optimized, and what are the side-effects, if any?

> --- a/unpack-trees.c
> +++ b/unpack-trees.c
> @@ -996,6 +996,16 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
>  			o->el = &el;
>  	}
>  
> +	if (!o->skip_sparse_checkout &&
> +	    o->el->nr == 1 &&
> +	    !strcmp(o->el->excludes[0]->pattern, "*")) {
> +		for (i = 0; i < o->src_index->cache_nr; i++)
> +			if (ce_skip_worktree(o->src_index->cache[i]))
> +				break;
> +		if (i == o->src_index->cache_nr)
> +			o->skip_sparse_checkout = 1;

Millinit:

	if (!o->skip_sparse_checkout &&
			checkout_is_whole_tree(o) &&
			index_uses_flag(o->src_index, CE_SKIP_WORKTREE))
		o->skip_sparse_checkout = 1;

Functions for the two conditions (especially the second) would make
this clearer, I think.

Sensible.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]