Re: [PATCHv11 20/20] builtin-gc: Teach the new --notes option to garbage-collect notes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thursday 21 January 2010, Junio C Hamano wrote:
> Stephen Boyd <bebarino@xxxxxxxxx> 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.

I've removed this patch from the next iteration of the series...

>  - 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.

...and replaced it with "git notes prune".

>  - 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".

Added in the next iteration of the series.

>  - 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).

There is currently no explicit rebalancing of the tree. The only thing "git 
notes prune" does, is call remove_note() for all notes referencing 
unreachable objects. Instead the tree is always kept in "balance" by 
remove_note() calling note_tree_consolidate() for the part of the tree 
affected by the removed note.


...Johan

-- 
Johan Herland, <johan@xxxxxxxxxxx>
www.herland.net
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]