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

Re: [PATCH 3/3] {fetch,upload}-pack: allow --depth=0 for infinite depth

From
Jakub Narebski <jnareb@gmail.com>
Date
Aug 20, 2010, 22:11 UTC
Message-ID
<201008210011.40236.jnareb@gmail.com>
In-Reply-To
<1282269067-5527-3-git-send-email-pclouds@gmail.com>
On Fri, 20 Aug 2010, Nguyễn Thái Ngọc Duy wrote:
Show 11 quoted lines
> diff --git a/Documentation/fetch-options.txt b/Documentation/fetch-options.txt
> index 9333c42..a22d839 100644
> --- a/Documentation/fetch-options.txt
> +++ b/Documentation/fetch-options.txt
> @@ -10,7 +10,8 @@
>  --depth=<depth>::
>  	Deepen the history of a 'shallow' repository created by
>  	`git clone` with `--depth=<depth>` option (see linkgit:git-clone[1])
> -	by the specified number of commits.
> +	by the specified number of commits. Specify "inf" for
> +	infinite depth.
It should probably be 'Specify 0 or "inf" for infinite (unlimited) depth',
which means making repository non-shallow.
  
Show 11 quoted lines
>  ifndef::git-pull[]
>  --dry-run::
> diff --git a/Documentation/git-fetch-pack.txt b/Documentation/git-fetch-pack.txt
> index 4a8487c..75e4669 100644
> --- a/Documentation/git-fetch-pack.txt
> +++ b/Documentation/git-fetch-pack.txt
> @@ -70,6 +70,7 @@ OPTIONS
>  
>  --depth=<n>::
>  	Limit fetching to ancestor-chains not longer than n.
> +	Specify 0 for infinite depth.
Again '0 or "inf"'.
  
Show 12 quoted lines
>  --no-progress::
>  	Do not show the progress.
> diff --git a/Documentation/technical/shallow.txt b/Documentation/technical/shallow.txt
> index 559263a..405170f 100644
> --- a/Documentation/technical/shallow.txt
> +++ b/Documentation/technical/shallow.txt
> @@ -47,3 +47,5 @@ It also writes an appropriate $GIT_DIR/shallow.
>  You can deepen a shallow repository with "git-fetch --depth 20
>  repo branch", which will fetch branch from repo, but stop at depth
>  20, updating $GIT_DIR/shallow.
> +
> +"--depth 0" (or "--depth inf" for git-fetch) means infinite depth.
???
Show 17 quoted lines
> diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh
> index 18376d6..47fd87c 100755
> --- a/t/t5500-fetch-pack.sh
> +++ b/t/t5500-fetch-pack.sh
> @@ -248,4 +248,12 @@ test_expect_success 'clone shallow object count' '
>  	grep "^count: 52" count.shallow
>  '
>  
> +test_expect_success 'infinite deepening (full repo)' '
> +	(
> +		cd shallow &&
> +		git fetch --depth=inf &&
> +		! test -f .git/shallow
> +	)
> +'
> +
>  test_done
It's very good that you included test of making repository non-shallow.
-- 
Jakub Narebski
Poland
Previous: Nguyễn Thái Ngọc DuyNext: Nguyen Thai Ngoc Duy
Message 4 of 8 in “clone: do not accept --depth on local clones”
  1. 1/3 clone: do not accept --depth on local clonesNguyễn Thái Ngọc Duy, Aug 20, 2010
  2. 2/3 fetch-pack: use args.shallow to detect shallow clone instead of args.depthNguyễn Thái Ngọc Duy, Aug 20, 2010
  3. 3/3 {fetch,upload}-pack: allow --depth=0 for infinite depthNguyễn Thái Ngọc Duy, Aug 20, 2010
  4. Jakub NarebskiAug 20, 2010
  5. Nguyen Thai Ngoc DuyAug 22, 2010
  6. Junio C HamanoAug 21, 2010
  7. Junio C HamanoAug 21, 2010
  8. Nguyen Thai Ngoc DuyAug 22, 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.