[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lmi] Incidental differences on first commit and push of 2019
From: |
Greg Chicares |
Subject: |
Re: [lmi] Incidental differences on first commit and push of 2019 |
Date: |
Wed, 9 Jan 2019 21:10:05 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 |
On 2019-01-09 17:39, Vadim Zeitlin wrote:
[...]
> Hello (and happy new year!),
Happy new year to you too!
> And, just for comparison, I ran git-fsck in my local mirror and had ~100
> of dangling blobs and commits, which made me realize that I didn't run
> git-gc in it since a long time (or maybe even ever) and I did it to gain
> some disk space:
>
> [lmi(master)]% du -sh .git
> 125M .git
> [lmi(master)]% g gc --prune=now
> Enumerating objects: 65581, done.
> Counting objects: 100% (65581/65581), done.
> Delta compression using up to 8 threads
> Compressing objects: 100% (25866/25866), done.
> Writing objects: 100% (65581/65581), done.
> Total 65581 (delta 45405), reused 58752 (delta 39622)
> [lmi(master)]% du -sh .git
> 23M .git
>
> You could do the same thing if you'd like, this should be totally safe
I've done so, just because this seems like a good time for routine
maintenance. Summarizing:
yours mine scenario
125M 33M initial condition*
23M 20M after explicit 'git gc'
--- 17M after explicit 'git gc --aggressive'
* My initial figure comes just a day or two after the previously
reported "Auto packing the repository" event.
Notably, 'git gc' doesn't result in exactly the same size for us both.
The '--aggressive' command took less than a minute (I didn't think to
measure exactly how long it took). I can't recall ever using '--aggressive'
before, but maybe I should do it at the beginning of each year:
https://git-scm.com/docs/git-gc
| --aggressive ... The effects of this optimization are persistent, so this
| option only needs to be used occasionally; every few hundred changesets or so.
Full terminal capture:
/opt/lmi/src/lmi[0]$du -sh .git
33M .git
/opt/lmi/src/lmi[0]$git gc --prune=now
Enumerating objects: 58990, done.
Counting objects: 100% (58990/58990), done.
Delta compression using up to 32 threads
Compressing objects: 100% (17074/17074), done.
Writing objects: 100% (58990/58990), done.
Total 58990 (delta 42605), reused 58175 (delta 41825)
/opt/lmi/src/lmi[0]$du -sh .git
20M .git
/opt/lmi/src/lmi[0]$git gc --aggressive
Enumerating objects: 58990, done.
Counting objects: 100% (58990/58990), done.
Delta compression using up to 32 threads
Compressing objects: 100% (58899/58899), done.
Writing objects: 100% (58990/58990), done.
Total 58990 (delta 43062), reused 15748 (delta 0)
/opt/lmi/src/lmi[0]$du -sh .git
17M .git