Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 763975 - sys-apps/portage-3.0.12: sync-depth defaults to 1 instead of 0, which conflicts with the manual page
Summary: sys-apps/portage-3.0.12: sync-depth defaults to 1 instead of 0, which conflic...
Status: RESOLVED INVALID
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Documentation (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-05 21:42 UTC by Lin Jian
Modified: 2021-01-06 05:42 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.