Skip to content

Only clone necessary part of git repository dependency (--depth) #4490

Open
@Rotzbua

Description

@Rotzbua
  • Feature Request.
  • PlatformIO Core.

Configuration

Operating system:
Win 10, Visual Studio Code

PlatformIO Version (platformio --version):
PlatformIO Core, version 6.1.5

Description of problem

If a dependency is a tag on a git repository, the complete git repository is cloned. Depending on the repository the traffic and amount of files can be huge. This causes a long transfer and processing time which decreases the user experience.

Git repositories are used for development built and testing.

Example platformio.ini:

[env:heltec_wifi_kit_32]
platform = espressif32@^5.2.0
platform_packages =
  ; use a upstream tag
  framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32#5b61930bb732d70f8aaa650047b9752365c9698c
framework = arduino
board = heltec_wifi_kit_32

Actual Results

Traffic: 1.60 GiB

Expected Results

Traffic: 187.19 MiB
-> 10 times less

Solution hint

If possible use the --depth=1 argument from git to only clone the necessary files.
Ref: https://git-scm.com/docs/git-clone

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions