Re: [PATCH v5 15/17] sparse-checkout: update working directory in-process

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

 



On Mon, Oct 21, 2019 at 01:56:24PM +0000, Derrick Stolee via GitGitGadget wrote:
> From: Derrick Stolee <dstolee@xxxxxxxxxxxxx>
> 
> The sparse-checkout builtin used 'git read-tree -mu HEAD' to update the
> skip-worktree bits in the index and to update the working directory.
> This extra process is overly complex, and prone to failure. It also
> requires that we write our changes to the sparse-checkout file before
> trying to update the index.
> 
> Remove this extra process call by creating a direct call to
> unpack_trees() in the same way 'git read-tree -mu HEAD' does. In
> addition, provide an in-memory list of patterns so we can avoid
> reading from the sparse-checkout file.

OK, the way I understand the above two paragraphs is that after this
patch it won't be necessary to write the updated patterns to the
'sparse-checkout' file before calling unpack_trees(), and to me it
implies that it won't be necessary to write the "include everything"
pattern to that file during disabling sparse checkout.

> @@ -378,7 +436,8 @@ static int sparse_checkout_disable(int argc, const char **argv)
>  	fprintf(fp, "/*\n");
>  	fclose(fp);

However, as the patch context here shows we still write that "include
everything" pattern to the 'sparse-checkout' file during disabling.

FWIW, deleting those lines updating the 'sparse-checkout' file make
the 'sparse-checkout disable' test fail.

Did I misunderstand what the commit message is trying to say?

> -	if (update_working_directory())
> +	core_apply_sparse_checkout = 1;
> +	if (update_working_directory(NULL))
>  		die(_("error while refreshing working directory"));
>  
>  	unlink(sparse_filename);



[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