Re: [PATCH 08/10] checkout: add --full to fully populate working directory

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

 



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

> --- a/Documentation/git-checkout.txt
> +++ b/Documentation/git-checkout.txt
> @@ -12,7 +12,7 @@ SYNOPSIS
>  'git checkout' [-q] [-f] [-m] [[-b|-B|--orphan] <new_branch>] [<start_point>]
>  'git checkout' [-f|--ours|--theirs|-m|--conflict=<style>] [<tree-ish>] [--] <paths>...
>  'git checkout' --patch [<tree-ish>] [--] [<paths>...]
> -'git checkout' -S
> +'git checkout' [-S|--full]

Brackets mean "optional".

> @@ -184,6 +184,10 @@ edits from your current working tree.
>  	$GIT_DIR/info/sparse-checkout. The working directory is also
>  	updated. An empty file will abort the process.
>  
> +--full:
> +	Reset $GIT_DIR/info/sparse-checkout to include everything and
> +	update working directory accordingly.

Maybe say something about "widen" and "whole project"?

> --- a/builtin/checkout.c
> +++ b/builtin/checkout.c
> @@ -952,8 +957,20 @@ no_reference:
>  	if (opts.writeout_stage)
>  		die("--ours/--theirs is incompatible with switching branches.");
>  
> -	if (update_sparse_checkout)
> -		edit_info_sparse_checkout();
> +	if (update_sparse_checkout) {
> +		if (full_checkout) {
> +			FILE *fp = fopen(git_path("info/sparse-checkout"), "w+");

What should --full --edit-worktree-shape-or-whatever-that-was-called do?

> --- a/t/t1011-read-tree-sparse-checkout.sh
> +++ b/t/t1011-read-tree-sparse-checkout.sh
> @@ -202,4 +202,11 @@ EOF
>  	test ! -f init.t
>  '
>  
> +test_expect_success 'git checkout --full' '
> +	git checkout --full &&
> +	grep "^\*$" .git/info/sparse-checkout &&
> +	test -f sub/added &&
> +	test -f init.t

Probably worth checking that that's the only pattern in the file so
short-circuiting happens.
--
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]