#363 RFE: Support --depth with clone
Closed: Fixed by onosek. Opened by churchyard.

Please add a --depth argument for clone that would be passed to git clone. Thanks


What would be the use case?

Metadata Update from @cqi:
- Issue set to the milestone: NEXT
- Issue tagged with: RFE

Not cloning tens/hundreds megabytes when I don't need the history?

Metadata Update from @cqi:
- Issue set to the milestone: 1.57 (was: NEXT)

Commit 94b381f9 fixes this issue

I don't understand why --no-single-branch is implicitly added and there is no opt-out. I've read the commit message, but i don't get it. Could you please explain the problem it solves?

Without this additional argument, git will not clone all branches.
try
"git clone --depth 3 ssh://@pkgs.devel.redhat.com/rpms/rhpkg --origin origin rhpkgy"
and after
"git branch -a"
you will see just a few branches.

That's the point if I don't want history, isn't it?

Do I understand? In case of argument --depth , you want number of commits globally through branches?

But git clone is not behaving like that i suppose. When I execute command listed above, and increase to let's say 100, it still doesn't show either more branches nor more commit messages.

Depth implicitly selects single-branch. I want that. I just want to clone the tip of master. Yet I assume this only really makes sense if all of --depth, --branch, --no-single-branch and --single-branch are passed to git. See also https://pagure.io/rpkg/issue/432 for a better (universal) solution to this problem.

Do I understand? In case of argument --depth , you want number of commits globally through branches?

To answer the question: No. I want to limit the commits on master.

@churchyard, would it be OK for you?
https://pagure.io/rpkg/pull-request/433

Yes. Thank You.

Commit f2c8237b relates to this ticket

Metadata Update from @onosek:
- Issue set to the milestone: 1.58 (was: 1.57)

Metadata
Related Pull Requests