git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: git@vger.kernel.org
Cc: "Shawn O. Pearce" <spearce@spearce.org>,
	Mark Brown <broonie@sirena.org.uk>
Subject: [RFC/PATCH 0/3] git-gui: Don’t trigger garbage collection warning so easily
Date: Thu, 18 Feb 2010 08:34:32 -0600	[thread overview]
Message-ID: <20100218143431.GA30486@progeny.tock> (raw)

Using git gui from a repository tracking (for example) linux-next,
there are almost always enough loose objects to trigger the garbage
collection warning.  The default threshold for this warning is much
more sensitive than the "as many objects as were in v0.99" rule that
the command-line tools use, and the result might be considered even
more invasive because the user has to hit yes before it starts
packing, and it packs more thoroughly than the default gc --auto
settings would.

Moreover, in repositories with many loose objects not referenced only
by the reflog (like linux-next), the gc does not do any good.  Taken
together, these things mean that every time a person runs git gui,
they get a message asking them to forfeit a long period of time to
accomplish nothing.

This problem was reported by Mark Brown at <http://bugs.debian.org/497687>.
My first thought was to add a “don’t ask me again” check box to the
dialog suggesting repacking, but my Tk fu is not up to it. :(

The next best thing would be to make ‘git gui’ use gc --auto itself.
I wonder:

 - Could git gui use git gc?  I understand from commit bc7452f that
   the output of git gc might not be stable enough for git gui to rely
   on, but why not add a --porcelain option whose output is?

 - Should git gui run git gc --auto without asking for permission?
   This is what the command line tools already do; with a GUI one
   could further provide a button to cancel the gc without closing
   the GUI.

This series does the simplest thing I could figure out how to
implement: it builds in the heuristic for counting loose objects from
builtin-gc.c into git-gui (so it will respect the gc.auto
configuration and by default will trigger much less often) and if that
heuristic is satisfied, runs gc --auto.

Advice?  Am I on the right track here?  Any advice for specifying an
interface for a --porcelain option to do this the right way?

Jonathan Nieder (3):
  git-gui: factor out too_many_loose_objects routine from hint_gc
  git-gui: Do not hold the user hostage with a full gc at startup
  git-gui: Do not suggest a gc if gc --auto would not do it

 lib/database.tcl |   40 +++++++++++++++++++++++++++++++++++-----
 1 files changed, 35 insertions(+), 5 deletions(-)

             reply	other threads:[~2010-02-18 14:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-18 14:34 Jonathan Nieder [this message]
2010-02-18 14:35 ` [PATCH 1/3] git-gui: factor out too_many_loose_objects routine from hint_gc Jonathan Nieder
2010-02-18 14:39 ` [PATCH/RFC 2/3] git-gui: Do not hold the user hostage with a full gc at startup Jonathan Nieder
2010-02-18 14:41 ` [PATCH/RFC 3/3] git-gui: Do not suggest a gc if gc --auto would not do it Jonathan Nieder
2010-02-18 15:49   ` Jonathan Nieder
2010-02-18 20:40 ` [RFC/PATCH 0/3] git-gui: Don’t trigger garbage collection warning so easily Johannes Sixt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100218143431.GA30486@progeny.tock \
    --to=jrnieder@gmail.com \
    --cc=broonie@sirena.org.uk \
    --cc=git@vger.kernel.org \
    --cc=spearce@spearce.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).