From: Junio C Hamano Date: Thu, 21 Jan 2010 20:01:14 GMT Subject: Re: [PATCHv11 20/20] builtin-gc: Teach the new --notes option to garbage-collect notes Message-ID: <7vtyufp6r9.fsf@alter.siamese.dyndns.org> In-Reply-To: <780e0a6b1001211127u6304546ej4e5bffbceca12e0b@mail.gmail.com> Stephen Boyd writes: > On Sun, Jan 17, 2010 at 1:04 PM, Johan Herland wrote: >> The new --notes option triggers a call to gc_notes(), which removes note >> objects that reference non-existing objects. >> > > Shouldn't notes be unconditionally garbage collected? Or maybe there's > a reason why notes should be treated differently that isn't written > here. A few thoughts, inspired by this patch, but on other things around "notes": - This is more about pruning notes regarding objects that are no longer availabe from _the tip_ of the notes tree. It doesn't run (and I am not suggesting to make it it to run) filter-branch to eradicate all such stale notes from the notes commit ancestry, so in that sense this is not really a garbage collection. - We would want to have "notes prune" subcommand that lets us do the pruning without all the other "gc" operation. "git gc" would of course call the same underlying code "notes prune" would use if we want to be able to trigger "notes prune" from it. - Because there is no public interface to list objects that are annotated with the most recent notes tree, the only thing this pruning affects is the look-up overhead of "log --show-notes". As such, it might be better to later add tree rebalancing in "notes prune" and at that point, it will become even less about garbage collection and more about performance ("notes optimize?"). - Do we want to have a public interface to list objects that are annotated with notes? "git notes" probably deserves a bit more subcommands other than "(edit|show)" to help users, e.g. "list" and "remove". - If this were "notes optimize" (this is just me thinking aloud), perhaps we would want to do this at some key places (e.g. when you automatically rebalance the tree).