Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Repo size in Stash

Kota Sreenivasa Shravana Kumar April 9, 2014

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

2 answers

1 accepted

0 votes
Answer accepted
Michael Heemskerk
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 9, 2014

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.

Kota Sreenivasa Shravana Kumar April 15, 2014
Tim Crall April 29, 2014

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.

0 votes
Balázs Szakmáry
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 29, 2014

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.

Tim Crall April 29, 2014

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.

Balázs Szakmáry
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 1, 2014

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.)

Michael Heemskerk
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 1, 2014

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.

Tim Crall May 1, 2014

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).

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events