In our Stash production, we have a Repository System Info Plugin which shows the following information.
- Repository location on disk
- The size of the repository
- The installed SCM hooks
However, the size of the repository shown in Stash and the size of the cloned repository appears to be different even after deleting the .git folder.
Why is it so ? Am I doing anything wrong ?
My understanding is that cloned repo size should be same as what is shown in the Stash through Repository System Info Plug-in.
Please advise. Thanks
The repo size that's reported by the Repository System Info Plug-in is the size of bare repository on the server (comparable to the .git directory of a regular git repository). Bare repositories don't contain a working tree and will therefore be smaller than a 'normal' git repository.
Your clone will be a normal git repository and should therefore be bigger than the size reported by the plugin.
Can your comments on the following ? Thanks
https://answers.atlassian.com/questions/283934/stash-as-dedicated-user
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That makes sense, but we are seeing the size as reported by the Stash repository settings differ wildly even from the .git folder of a cloned repo. We are trying to find a way to calculate how much space the repo is actually going to take up when cloned so our scripts can ensure the box has enough disk space before cloning.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The .git folder of a non-bare clone contains some additional stuff to the bare repo. (some objects are uncompressed, local branches can be present, etc.).
The ratio between the bare repo size and the non-bare clones can further vary quite much depending on e.g. the amount of binary (badly compressible) files, amount of history, etc.
I think your best option is to clone (at least some of) your repositories to somebody's computer to estimate this ratio and use [bare size]*[ratio+some margin] as the threshold in your scripts.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I will do as you suggest. I'm curious, though. Even the size of a repo cloned using
git clone --bare
seems to differ in size from the size reported by Stash by a factor of about 2.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That is interesting. Which one is bigger? (I have no idea why, other that some objects might be unpacked in one and packed in the other.)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I would expect the repository in Stash to be bigger. It will have more unpacked objects. Also, some objects may still be referenced by Stash's pull request refs, which don't get fetched by default when you clone a repository (they're outside the default ref spec). Therefore, you'll retrieve less objects and would get a smaller repository when you create a _bare_ clone.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The bare clone is consistently bigger. I've collected data on 9 different repos, and the size of the bare cloned repo varies from 1.0 (meaning, obviously, it was about the same for that repo) to 1.9 x the size reported by Stash. My mean result was 1.3 with a stdev of 0.3. This data was gathered immediately after performing the --bare clone. Not really an issue for me since what I really needed to be able to do was to estimate how much space the non-bare clone will take up, so I'm following Balazs's suggestion and just multiplying by a scaling factor (I'm using 15, because the highest ratio I found was 12.3).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.