vendir icon indicating copy to clipboard operation
vendir copied to clipboard

For faster sync, add option to only download a single branch

Open gaurav-nelson opened this issue 3 years ago • 4 comments

Describe the problem/challenge you have Currently, vendir takes long time to clone a repository. If I am after files from a specific branch it takes long time and it downloads unnecessary stuff I don't care about.

Describe the solution you'd like

Add an option to

  • specify cloning depth
  • only clone single branch
apiVersion: vendir.k14s.io/v1alpha1
kind: Config
directories:
- path: docs/modules
  contents:
  - path: ROOT/partials
    git:
      url: https://github.com/openshift/openshift-docs
      ref: rhacs-docs
      single-branch: true
      depth: 1
    includePaths:
    - modules/*
    newRootPath: modules/

Vote on this request

This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.

👍 "I would like to see this addressed as soon as possible" 👎 "There are other more important things to focus on right now"

We are also happy to receive and review Pull Requests if you want to help working on this issue.

gaurav-nelson avatar Aug 31 '21 02:08 gaurav-nelson

seems like a good suggestion. @gaurav-nelson would you be interested in contributing this change?

cppforlife avatar Sep 07 '21 15:09 cppforlife

Thanks @cppforlife I'm happy to contribute. However, I never tried to code in go before. If you can point me to the file where the cloning happens I can try it out, but it would be faster for someone who already understands how it all works.

Otherwise I can help test the changes and see if it works as intended and create docs for using this feature.

gaurav-nelson avatar Sep 08 '21 01:09 gaurav-nelson

cloning happens via this package: https://github.com/vmware-tanzu/carvel-vendir/tree/develop/pkg/vendir/fetch/git and configuration for git is here: https://github.com/vmware-tanzu/carvel-vendir/blob/develop/pkg/vendir/config/directory.go#L56. if you are available give it a go!

cppforlife avatar Sep 16 '21 15:09 cppforlife

This issue is being marked as stale due to a long period of inactivity and will be closed in 5 days if there is no response.

github-actions[bot] avatar Oct 27 '21 00:10 github-actions[bot]