Skip to content

Add a shallow-clone option for git packages  #3556

Open
@OgieBen

Description

@OgieBen

At my company we are currently combining unity with flutter through https://pub.dev/packages/flutter_unity_widget and we host the unity widget dependency on a git repo. It gets big really quickly and we have to keep deleting tags.

I would like to submit a PR that allows a user to notify Pub to make a shallow clone of a Git repository instead of a mirror clone of the remote repository.

For example a user could use the following command:

dart pub add http --git-url=https://github.com/my/http.git --git-ref=tmpfixes --git-shallow-clone=true

or inside the pubspec.yaml file

dependencies:
 vm_service:
   git:
     url: https://dart.googlesource.com/sdk
     ref: refs/changes/80/156980/3
     path: pkg/vm_service
     shallow-clone: true

There is also the possibility of specifying the depth of the shallow clone like so, instead of passing a boolean flag:

dart pub add http --git-url=https://github.com/my/http.git --git-ref=tmpfixes --git-shallow-clone=1

or inside the pubspec.yaml file

dependencies:
 vm_service:
   git:
     url: https://dart.googlesource.com/sdk
     ref: refs/changes/80/156980/3
     path: pkg/vm_service
     shallow-clone: 1

There is a similar issue here: #2686.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions