Debian Bug report logs - #483804
Wish for git-gc cron job

version graph

Package: etckeeper; Maintainer for etckeeper is Joey Hess <joeyh@debian.org>; Source for etckeeper is src:etckeeper.

Reported by: "Trent W. Buck" <trentbuck@gmail.com>

Date: Sat, 31 May 2008 12:54:01 UTC

Severity: wishlist

Found in version etckeeper/0.15

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Joey Hess <joeyh@debian.org>:
Bug#483804; Package etckeeper. Full text and rfc822 format available.

Acknowledgement sent to "Trent W. Buck" <trentbuck@gmail.com>:
New Bug report received and forwarded. Copy sent to Joey Hess <joeyh@debian.org>. Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: "Trent W. Buck" <trentbuck@gmail.com>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: Wish for git-gc cron job
Date: Sat, 31 May 2008 18:43:10 +1000
Package: etckeeper
Version: 0.15
Severity: wishlist

After running etckeeper for a few months, I noticed that /etc/.git
constituted four fifths of my /etc tree.  Running git-gc significantly
improved this ratio.  I wish etckeeper did this automatically via a
cron.monthly or cron.weekly script.

twb@Clio[etc]$ sudo du -sh . .git
45M     .
40M     .git
twb@Clio[etc]$ sudo git gc
Counting objects: 5722, done.
Compressing objects: 100% (4928/4928), done.
Writing objects: 100% (5722/5722), done.
Total 5722 (delta 2681), reused 0 (delta 0)
twb@Clio[etc]$ sudo du -sh . .git
13M     .
7.4M    .git

Pieter de Bie on Freenode's #git also suggested this.
I have no idea if it's a good idea to automate.

twb@Clio[etc]$ sudo git repack -adf --window=200
Counting objects: 5722, done.
Compressing objects: 100% (4928/4928), done.
Writing objects: 100% (5722/5722), done.
Total 5722 (delta 2795), reused 0 (delta 0)
twb@Clio[etc]$ sudo du -sh . .git
13M     .
6.9M    .git

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.25-2-686 (SMP w/1 CPU core)
Locale: LANG=en_AU.utf8, LC_CTYPE=en_AU.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages etckeeper depends on:
ii  debconf [debconf-2.0]        1.5.22      Debian configuration management sy
ii  git-core                     1:1.5.5.1-1 fast, scalable, distributed revisi
ii  mercurial                    1.0-4       Scalable distributed version contr

etckeeper recommends no packages.

-- debconf information:
* etckeeper/unclean: true
  etckeeper/commit_failed:




Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#483804; Package etckeeper. Full text and rfc822 format available.

Acknowledgement sent to Joey Hess <joeyh@debian.org>:
Extra info received and forwarded to list. Full text and rfc822 format available.

Message #10 received at 483804@bugs.debian.org (full text, mbox):

From: Joey Hess <joeyh@debian.org>
To: "Trent W. Buck" <trentbuck@gmail.com>, 483804@bugs.debian.org
Subject: Re: Bug#483804: Wish for git-gc cron job
Date: Sat, 31 May 2008 13:31:22 -0400
[Message part 1 (text/plain, inline)]
Trent W. Buck wrote:
> After running etckeeper for a few months, I noticed that /etc/.git
> constituted four fifths of my /etc tree.  Running git-gc significantly
> improved this ratio.  I wish etckeeper did this automatically via a
> cron.monthly or cron.weekly script.

Modern versions of git should automatically run git-gc once the number
of loose objects reaches a certian point, controlled by gc.auto. So a
cron job should only be necessary if you want to avoid git-gc being run
during a commit. (Which is sometimes annoying as it can be slow.. but
probably not for the small stuff in /etc.)

Perhaps etckeeper should set gc.auto to a smaller number than the
default, when initially setting up a repo, so that the repo is garbage
collected more often. The default value of 6700 is unlikely to be
reached quickly in /etc -- /etc just is not committed to enough, with
enough files changed, for 6700 lose copies of files to accumulate.

I'm thinking that 1/8th of the default might be a good choice. Or closer
to a good choice.

The other option, BTW, is to have etckeeper run git gc every time. I
recommend this for machines with less than a GB of disk, and there's an
example in the README of how to set this up.

> Pieter de Bie on Freenode's #git also suggested this.
> I have no idea if it's a good idea to automate.
> 
> twb@Clio[etc]$ sudo git repack -adf --window=200
> Counting objects: 5722, done.
> Compressing objects: 100% (4928/4928), done.
> Writing objects: 100% (5722/5722), done.
> Total 5722 (delta 2795), reused 0 (delta 0)
> twb@Clio[etc]$ sudo du -sh . .git
> 13M     .
> 6.9M    .git

It will save more space, but repacks everything each time, so is more
something to run when you need to squeeze every last bit of space you
can, not something to run automatically.

-- 
see shy jo
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Joey Hess <joeyh@debian.org>:
Bug#483804; Package etckeeper. Full text and rfc822 format available.

Acknowledgement sent to "Trent W. Buck" <trentbuck@gmail.com>:
Extra info received and forwarded to list. Copy sent to Joey Hess <joeyh@debian.org>. Full text and rfc822 format available.

Message #15 received at 483804@bugs.debian.org (full text, mbox):

From: "Trent W. Buck" <trentbuck@gmail.com>
To: Joey Hess <joeyh@debian.org>
Cc: 483804@bugs.debian.org
Subject: Re: Bug#483804: Wish for git-gc cron job
Date: Sun, 1 Jun 2008 15:01:58 +1000
On Sat, May 31, 2008 at 01:31:22PM -0400, Joey Hess wrote:
> Trent W. Buck wrote:
>> After running etckeeper for a few months, I noticed that /etc/.git
>> constituted four-fifths of my /etc tree.  Running git-gc
>> significantly improved this ratio.  I wish etckeeper did this
>> automatically via a cron.monthly or cron.weekly script.
>
> Modern versions of git should automatically run git-gc once the
> number of loose objects reaches a certian point, controlled by
> gc.auto. [...]  Perhaps etckeeper should set gc.auto to a smaller
> number [...] so that the repo is garbage collected more often.
>
> I'm thinking that 1/8th of the default might be a good choice. Or closer
> to a good choice.

I defer to your judgement on this topic, since you clearly understand
git far better than I do.

>> twb@Clio[etc]$ sudo git repack -adf --window=200
>
> It will save more space, but repacks everything each time, so is more
> something to run when you need to squeeze every last bit of space you
> can, not something to run automatically.

OK.




Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Thu Apr 17 07:20:55 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.