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

Repository are not properly mirrored #2

Open
pgrenaud opened this issue Mar 29, 2023 · 0 comments
Open

Repository are not properly mirrored #2

pgrenaud opened this issue Mar 29, 2023 · 0 comments

Comments

@pgrenaud
Copy link

If we look at the source, the repo are cloned using only the --bare option, and updated using fetch --all --prune and using customs refs.

https://github.com/eXolnet/redmine_git_mirror/blob/master/lib/redmine_git_mirror/git.rb#L45
https://github.com/eXolnet/redmine_git_mirror/blob/master/lib/redmine_git_mirror/git.rb#L64
https://github.com/eXolnet/redmine_git_mirror/blob/master/lib/redmine_git_mirror/git.rb#L52-L57
https://github.com/eXolnet/redmine_git_mirror/blob/master/lib/redmine_git_mirror/git.rb#L79-L101

Looking at the git man pages, git clone have an option --mirror specifically made for this. And the same section mention using git remote update to sync the mirror (which can be run with --prune).

https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---mirror

Looking at this answer, git remote update seems more appropriate over git fetch to sync a mirror.

https://stackoverflow.com/a/17712553

Therefore, we should probably switch to git clone --mirror and git remote update --prune and drop the customs refs. That way, we should safely assume that the repository are a complete mirror of the source repository.

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

1 participant