This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 249060 - Suggest running 'git gc' like cli does
Summary: Suggest running 'git gc' like cli does
Status: NEW
Alias: None
Product: versioncontrol
Classification: Unclassified
Component: Git (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal (vote)
Assignee: Ondrej Vrabec
Depends on:
Reported: 2014-12-02 11:00 UTC by hifi
Modified: 2016-03-30 05:00 UTC (History)
1 user (show)

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description hifi 2014-12-02 11:00:12 UTC
Git gui suggests running gc once in a while to optimize the repository and do that always when I open a NetBeans managed git repository as it hasn't been gc'd even once. As far as I know, JGit supports gc one way or another now and doing it would be very beneficial in some cases.

For example, I just imported a git repository from svn (with git-svn) and the resulting .git totaled to 2.7GB which was way more than I would have expected. Running 'git gc --aggressive' reduced it down to 29MB, which was ways less than I expected. The difference is so huge it really makes sense to run it.

Offering running JGit gc as often as git gui would would be an acceptable solution if it does anything useful regarding performance and disk usage.
Comment 1 hifi 2014-12-03 06:16:54 UTC
Regarding the compression ratio, unsurprisingly it wasn't the real deal.  The huge 2.7GB issue was because of Samba 'allocation roundup size' being 1048576 by default which rounded up all small object files up to 1MB and it stacked up. Running the gc naturally made a huge difference when all small objects where packed into one and the rounding didn't add up anymore.

I tested JGit gc and it can also achieve good compression ratio compared to non-gc'd one so the point is still valid for improved performance. I could think it makes more of a difference when you use git over a network share where seeking an already opened file could be faster by some factor than searching for loose objects.
Comment 2 hifi 2016-03-30 05:00:51 UTC
Performance of Netbeans-only managed git repositories is declining rapidly. The amount of loose objects is massive and when working over network filesystem, the lookup times are long.

Manually running 'git gc' externally to get it packed up and tidy increases the performance back to normal.