#363 RFE: Support --depth with clone
Closed: Fixed 5 years ago by onosek. Opened 5 years ago 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

5 years ago

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)

5 years ago

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://<user>@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 <LIMIT>, you want <LIMIT> number of commits globally through branches?

But git clone is not behaving like that i suppose. When I execute command listed above, and increase <LIMIT> 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 <limit>, you want <limit> number of commits globally through branches?

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

Commit f2c8237 relates to this ticket

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

4 years ago

Login to comment on this ticket.

Metadata
Related Pull Requests
  • #434 Merged 5 years ago
  • #429 Merged 5 years ago