Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 763975

Summary: sys-apps/portage-3.0.12: sync-depth defaults to 1 instead of 0, which conflicts with the manual page
Product: Portage Development Reporter: Lin Jian <me>
Component: DocumentationAssignee: Portage team <dev-portage>
Status: RESOLVED INVALID    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Lin Jian 2021-01-05 21:42:16 UTC
The manual page says:
sync-depth
    Specifies sync depth to use for DVCS repositories. If set to 0, the depth is unlimited. Defaults to 0.

However, according to the 83th line of lib/portage/sync/modules/git/git.py[1], the default value is 1 if sync-depth is not set.

[1]: https://gitweb.gentoo.org/proj/portage.git/tree/lib/portage/sync/modules/git/git.py#n83
Comment 1 Zac Medico gentoo-dev 2021-01-06 00:52:23 UTC
(In reply to Jian Lin from comment #0)
> The manual page says:
> sync-depth
>     Specifies sync depth to use for DVCS repositories. If set to 0, the
> depth is unlimited. Defaults to 0.
> 
> However, according to the 83th line of
> lib/portage/sync/modules/git/git.py[1], the default value is 1 if sync-depth
> is not set.
> 
> [1]:
> https://gitweb.gentoo.org/proj/portage.git/tree/lib/portage/sync/modules/git/
> git.py#n83

That particular git_cmd_opts setting is in the "new" method which is only called for the initial clone. It corresponds to the default clone-depth, which is correctly documented as 1 in the documentation.

This code is confusing and for a moment I thought you were right about the default sync depth being 1.
Comment 2 Lin Jian 2021-01-06 05:42:06 UTC
Thanks. I didn't realize the existence of clone-depth. Now I know, and it makes sense.