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

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

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Nov 15, 2010, 21:23 UTC
Message-ID
<20101115212311.GI16385@burratino>
In-Reply-To
<1289817410-32470-9-git-send-email-pclouds@gmail.com>
Nguyễn Thái Ngọc Duy wrote:
Show 8 quoted lines
> --- 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".
Show 7 quoted lines
> @@ -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"?
Show 11 quoted lines
> --- 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?
Show 11 quoted lines
> --- 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.

Previous: Nguyễn Thái Ngọc DuyNext: Nguyen Thai Ngoc Duy
Message 28 of 34 in “Sparse checkout fixes and improvements”
  1. 00/10 Sparse checkout fixes and improvementsNguyễn Thái Ngọc Duy, Nov 15, 2010
  2. 01/10 add: do not rely on dtype being NULL behaviorNguyễn Thái Ngọc Duy, Nov 15, 2010
  3. Jonathan NiederNov 15, 2010
  4. Nguyen Thai Ngoc DuyNov 16, 2010
  5. Jonathan NiederNov 16, 2010
  6. Junio C HamanoNov 16, 2010
  7. Nguyen Thai Ngoc DuyNov 17, 2010
  8. 02/10 unpack-trees: move all skip-worktree check back to unpack_trees()Nguyễn Thái Ngọc Duy, Nov 15, 2010
  9. Thiago FarinaNov 15, 2010
  10. Nguyen Thai Ngoc DuyNov 16, 2010
  11. Jonathan NiederNov 15, 2010
  12. Nguyen Thai Ngoc DuyNov 16, 2010
  13. 03/10 unpack-trees: add function to update ce_flags based on sparse patternsNguyễn Thái Ngọc Duy, Nov 15, 2010
  14. Jonathan NiederNov 15, 2010
  15. Jonathan NiederNov 15, 2010
  16. 04/10 unpack-trees: fix sparse checkout's "unable to match directories" faultNguyễn Thái Ngọc Duy, Nov 15, 2010
  17. Jonathan NiederNov 15, 2010
  18. Nguyen Thai Ngoc DuyNov 16, 2010
  19. 05/10 unpack-trees: optimize full checkout caseNguyễn Thái Ngọc Duy, Nov 15, 2010
  20. Jonathan NiederNov 15, 2010
  21. 06/10 templates: add info/sparse-checkoutNguyễn Thái Ngọc Duy, Nov 15, 2010
  22. 07/10 checkout: add -S to update sparse checkoutNguyễn Thái Ngọc Duy, Nov 15, 2010
  23. Jonathan NiederNov 15, 2010
  24. Miles BaderNov 15, 2010
  25. Nguyen Thai Ngoc DuyNov 17, 2010
  26. Nguyen Thai Ngoc DuyNov 16, 2010
  27. 08/10 checkout: add --full to fully populate working directoryNguyễn Thái Ngọc Duy, Nov 15, 2010
  28. Jonathan NiederNov 15, 2010
  29. Nguyen Thai Ngoc DuyNov 16, 2010
  30. 09/10 git-checkout.txt: mention of sparse checkoutNguyễn Thái Ngọc Duy, Nov 15, 2010
  31. 10/10 clean: support cleaning sparse checkout with -SNguyễn Thái Ngọc Duy, Nov 15, 2010
  32. Jonathan NiederNov 15, 2010
  33. Nguyen Thai Ngoc DuyNov 16, 2010
  34. Jonathan NiederNov 16, 2010

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.