Add source option for git submodules

Bug #1640675 reported by Josh Blum
24
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Snapcraft
Confirmed
Wishlist
Unassigned

Bug Description

Currently the git support recursively clones all submodules in a git repository regardless. However, in many cases either none or only some of the submodules are required. Submodules can contain extra repositories not needed for building like precompiled binaries or alternative copies of a dependency already packaged along with the OS. This can add unwanted time, network traffic, and even gigabytes of disk-space -- which could be easily avoided.

This bug requests adding a source-submodules option which specifies a list of explicit submodules to clone. An unspecified source-submodules option will continue to clone all submodules recursively, and an empty list for source-submodules can be used to specify that no submodules should be cloned.

Since the git submodule command can be passed a list of paths, a new source-submodules option should map fairly well to the git command line arguments. And the current recursive arguments could be added conditionally based on the presence of source-submodules: https://github.com/snapcore/snapcraft/blob/master/snapcraft/internal/sources.py#L215

Revision history for this message
Kyle Fazzari (kyrofa) wrote :

Thanks for the bug Josh, it seems reasonable that there should be a way to do this.

Changed in snapcraft:
status: New → Confirmed
importance: Undecided → Wishlist
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.