Re: [PATCH] check_everything_connected: assume alternate ref tips are valid

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

 



Jeff King <peff@xxxxxxxx> writes:

> When we receive a remote ref update to sha1 "X", we want to check that
> we have all of the objects needed by "X". We can assume that our
> repository is not currently corrupted, and therefore if we have a ref
> pointing at "Y", we have all of its objects. So we can stop our
> traversal from "X" as soon as we hit "Y".
>
> If we make the same non-corruption assumption about any repositories we
> use to store alternates, then we can also use their ref tips to shorten
> the traversal.
> ...
> diff --git a/connected.c b/connected.c
> index 1ab481fed6..cd9b324afa 100644
> --- a/connected.c
> +++ b/connected.c
> @@ -80,6 +80,7 @@ int check_connected(oid_iterate_fn fn, void *cb_data,
>  		argv_array_push(&rev_list.args, "--all");
>  	}
>  	argv_array_push(&rev_list.args, "--quiet");
> +	argv_array_push(&rev_list.args, "--alternate-refs");
>  	if (opt->progress)
>  		argv_array_pushf(&rev_list.args, "--progress=%s",
>  				 _("Checking connectivity"));

Quite honestly, I am very surprised that we did not do this.  The
idea of alternate object store, as well as reducing transfer cost by
advertising their tips as '.have' phony refs, is almost as old as
the pack protocol itself.



[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]

  Powered by Linux