Skip to content

[master] Makefile: use shallow clone - #473

Merged
silvin-lubecki merged 2 commits into
docker:masterfrom
thaJeztah:shallow_clone
Aug 6, 2020
Merged

[master] Makefile: use shallow clone#473
silvin-lubecki merged 2 commits into
docker:masterfrom
thaJeztah:shallow_clone

Conversation

@thaJeztah

Copy link
Copy Markdown
Member

follow up to #457

Before this change:

make clean
time make checkout
git clone -q "https://github.com/docker/cli.git" src/github.com/docker/cli
git clone -q "https://github.com/docker/docker.git" src/github.com/docker/docker
69.16 real 15.69 user 9.69 sys

After this change:

make clean
time make checkout
...
From https://github.com/docker/docker
* branch HEAD -> FETCH_HEAD
git -C src/github.com/docker/docker checkout -q FETCH_HEAD
14.73 real 1.35 user 2.37 sys

@thaJeztah

Copy link
Copy Markdown
MemberAuthor

opened as a separate draft, because we had some issues with a similar change in the containerd packaging repository, so this might need some more work

@AkihiroSuda

Copy link
Copy Markdown
Contributor

Does github support shallow-cloning non-HEAD commit?

@AkihiroSuda

Copy link
Copy Markdown
Contributor

Before this change:
make clean
time make checkout
git clone -q "https://github.com/docker/cli.git" src/github.com/docker/cli
git clone -q "https://github.com/docker/docker.git" src/github.com/docker/docker
69.16 real 15.69 user 9.69 sys
After this change:
make clean
time make checkout
...
From https://github.com/docker/docker
* branch HEAD -> FETCH_HEAD
git -C src/github.com/docker/docker checkout -q FETCH_HEAD
14.73 real 1.35 user 2.37 sys
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
fetching a tag ref does not download the tag itself.
This patch makes sure that the tag (or branch) is downloaded otherwise
fallsback to fetching the commit hash as it did before.
Co-Authored-By: Tibor Vass <tibor@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah
thaJeztah marked this pull request as ready for review August 1, 2020 16:15
@thaJeztah

Copy link
Copy Markdown
MemberAuthor

Yes, correct, it wasn't supported in the past, but now is.

@silvin-lubeckisilvin-lubecki left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@silvin-lubecki
silvin-lubecki merged commit eb9999a into docker:masterAug 6, 2020
@thaJeztah
thaJeztah deleted the shallow_clone branch August 6, 2020 16:32
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@thaJeztah@AkihiroSuda@silvin-lubecki