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

Use git submodules for tilesets, mods and languages #28707

Closed
int-ua opened this issue Mar 14, 2019 · 11 comments
Closed

Use git submodules for tilesets, mods and languages #28707

int-ua opened this issue Mar 14, 2019 · 11 comments
Labels
Organization General development organization issues <Suggestion / Discussion> Talk it out before implementing

Comments

@int-ua
Copy link
Contributor

int-ua commented Mar 14, 2019

Problem
Without using --depth option current repository clone already takes almost 2GiB of space. And most of this space is in the .git folder.
Screenshot_20190314_172831

Solution
AFAIU its' growth speed can be reduced significantly if tilesets and mods (and optionally l10n files for languages) will be moved into separate repositories by using git submodule. This way when cloning and building yourself you will only download what you actually need. Cons may include additional steps during automated builds.

Edit: and of course setting this all up is additional work. Posting this suggestion just in case dev team haven't considered this solution or didn't have a chance to reconsider lately.

@Night-Pryanik Night-Pryanik added <Suggestion / Discussion> Talk it out before implementing Organization General development organization issues labels Mar 14, 2019
@FONZACUS
Copy link
Contributor

somewhat relevant, id also like to suggest the downloads be smaller as well. like to only ship with english and the current default tileset. if possible along with excluding mods and fonts too.

im not trying to be offensive in the slightest, but i feel sorry for the narc.ro owners, i dont know how much they spend on bandwidth.

@Leland
Copy link
Contributor

Leland commented Mar 14, 2019

This way when cloning and building yourself you will only download what you actually need

FWIW you can just take a shallow clone when you do this

@ZhilkinSerg
Copy link
Contributor

ZhilkinSerg commented Mar 14, 2019

i dont know how much they spend on bandwidth.

http://dev.narc.ro/awstats/awstats.pl?month=03&year=2019&output=downloads&config=dev.narc.ro

image

@int-ua
Copy link
Contributor Author

int-ua commented Mar 14, 2019

FWIW you can just take a shallow clone when you do this

I'm already doing it for building upstream, of course. But I had problems pushing upstream changes into my development fork from local shallow clone. Do you have a Is there any way to sync local shallow clone of my development fork with upstream?

@mlangsdorf
Copy link
Contributor

git fetch --deepen $NUM will deepen your repo's commit history by $NUM commits.

@int-ua
Copy link
Contributor Author

int-ua commented Mar 15, 2019

git fetch --deepen $NUM will deepen your repo's commit history by $NUM commits.

Tried that . But maybe it wasn't deep enough. Will try again later, thanks.

@mlangsdorf
Copy link
Contributor

You can repeatedly call fetch with deepen and it will deepen it by another $NUM commits each time.

@kevingranade
Copy link
Member

I've considered it before, I'm not a fan of using git submodule, but simply moving tiles elsewhere is a possibility.
Also a possibility is splitting the tilesets to a seperate archive for releases. I'm not interested in splitting out the language files.

However, AFAIK this isn't a major problem at this time since we can simply shallow copy as people have outlined.

@int-ua int-ua closed this as completed Mar 15, 2019
@int-ua
Copy link
Contributor Author

int-ua commented Jul 29, 2020

Trying to update my fork that is 1336 commits behind:

$ git pull --depth 1400 upstream master
remote: Enumerating objects: 507086, done.
remote: Counting objects: 100% (507086/507086), done.
remote: Compressing objects: 100% (96477/96477), done.
Отримання об’єктів:  62% (313268/503799), 1.31 GiB | 4.69 MiB/s

Looks like --depth here didn't work :/ Am I doing something wrong?

Update:

$ git rev-list --count --first-parent refs/remotes/upstream/master
20980
$ git rev-list --count --first-parent refs/heads/master
20980

This is --depth 1 clone of my fork after syncing with upstream with these commands:
screenshot of .git folder taking 4.1 GiB

$ git reflog expire --expire=now --all && git repack -ad && git prune
$ du -sh .git
2,2G    .git

Looks like the problem was that I first executed git pull without depth and stopped it, but git saved the unwanted depth already.

@int-ua
Copy link
Contributor Author

int-ua commented Sep 15, 2020

This came up again briefly in #43986 and just for anyone looking here in the future: CI needs this change for git submodules support

--- a/.github/workflows/matrix.yml
+++ b/.github/workflows/matrix.yml
@@ -36,9 +36,10 @@ jobs:
         SANITIZE: ${{ matrix.sanitize }}
     steps:
     - name: checkout repository
-      uses: actions/checkout@v1
+      uses: actions/checkout@v2
       with:
         fetch-depth: 10
+        submodules: true
     - name: install dependencies
       run: |
           sudo apt-get update

@int-ua
Copy link
Contributor Author

int-ua commented Dec 12, 2020

No pressure, just a relevant link: https://gist.github.com/korya/9047870
Blocker: both filter-branch and filter-repo lose track of folder once it was moved at a commit.
Solved: newren/git-filter-repo#182

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Organization General development organization issues <Suggestion / Discussion> Talk it out before implementing
Projects
None yet
Development

No branches or pull requests

7 participants