Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option for setup a local mirror just like "repo init --mirror"? #658

Open
swordligit opened this issue May 6, 2023 · 7 comments
Open

Comments

@swordligit
Copy link

For android repo tool, there is an option 'repo init --mirror' to setup a local
mirror, but with west, have to git clone --bare all the projects one by one.

So, is it possible to add this option?
Br,
Yingchun

@swordligit swordligit changed the title Add an option for setup a local mirror just "repo init --mirror"? Add an option for setup a local mirror just like "repo init --mirror"? May 6, 2023
@mbolivar-nordic
Copy link
Contributor

This seems like a valid way to set up a cache you could use with west update --name-cache. But since west init only clones the manifest repository, what would the commands that you would like to type be, and what would the desired outcomes be?

@swordligit
Copy link
Author

swordligit commented May 8, 2023

In my local server, I want to clone all the repository with the bare mode,
then all my members can clone whole projects from my local server.
not from the upsteam.

Here is my simple steps now:

west init -m https://github.com/zephyrproject-rtos/zephyr

west list | awk '{print $4}' > projects.list
mkdir -p /path/of/mirror/; cd /path/of/mirror

for p in $(cat projects.list); do git clone --bare $p; done

After that, I can change the upstream url in west.yaml and download the projects
from my mirror.

I thought this is almost the android repo init --mirror; repo sync does.

@marc-hb
Copy link
Collaborator

marc-hb commented May 9, 2023

west list -f '{url}' | while read -r loc; do git clone --bare "$loc"; done

Related:

@swordligit
Copy link
Author

swordligit commented May 11, 2023

Seems there is a real requirement,can this be implemented? Using an extra script is
not so convenient.

@marc-hb
Copy link
Collaborator

marc-hb commented May 11, 2023

Requirement funded by whom?

@marc-hb
Copy link
Collaborator

marc-hb commented May 11, 2023

There two ways to manage valid but unfunded requests in issue trackers.

  1. The "project manager" way: close as wontfix because not funded.
  2. The "developer" way: keep open because valid.

Most open-source projects work in the second way because there is rarely any inter-company project management.

@marc-hb marc-hb reopened this May 11, 2023
@mbolivar-nordic
Copy link
Contributor

Agree, this is a valid enhancement and I would take a patch adding a new west mirror command that accomplished this. This doesn't belong in west init since that command's job is to set up a new workspace with just a manifest repository in it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants