From: Johan Herland <johan@herland.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Stephen Boyd <bebarino@gmail.com>
Subject: Re: [PATCHv11 20/20] builtin-gc: Teach the new --notes option to garbage-collect notes
Date: Wed, 27 Jan 2010 13:02:17 +0100 [thread overview]
Message-ID: <201001271302.17368.johan@herland.net> (raw)
In-Reply-To: <7vtyufp6r9.fsf@alter.siamese.dyndns.org>
On Thursday 21 January 2010, Junio C Hamano wrote:
> Stephen Boyd <bebarino@gmail.com> 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@herland.net>
www.herland.net
prev parent reply other threads:[~2010-01-27 12:02 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-17 21:04 [PATCHv11 00/20] git notes Johan Herland
2010-01-17 21:04 ` [PATCHv11 01/20] Minor non-functional fixes to notes.c Johan Herland
2010-01-17 21:04 ` [PATCHv11 02/20] Notes API: get_commit_notes() -> format_note() + remove the commit restriction Johan Herland
2010-01-17 21:04 ` [PATCHv11 03/20] Add tests for checking correct handling of $GIT_NOTES_REF and core.notesRef Johan Herland
2010-01-17 21:04 ` [PATCHv11 04/20] Notes API: init_notes(): Initialize the notes tree from the given notes ref Johan Herland
2010-01-17 21:04 ` [PATCHv11 05/20] Notes API: add_note(): Add note objects to the internal notes tree structure Johan Herland
2010-01-17 21:04 ` [PATCHv11 06/20] Notes API: remove_note(): Remove note objects from the " Johan Herland
2010-01-17 21:04 ` [PATCHv11 07/20] Notes API: get_note(): Return the note annotating the given object Johan Herland
2010-01-17 21:04 ` [PATCHv11 08/20] Notes API: for_each_note(): Traverse the entire notes tree with a callback Johan Herland
2010-01-17 21:04 ` [PATCHv11 09/20] Notes API: write_notes_tree(): Store the notes tree in the database Johan Herland
2010-01-17 21:04 ` [PATCHv11 10/20] Notes API: Allow multiple concurrent notes trees with new struct notes_tree Johan Herland
2010-01-17 21:04 ` [PATCHv11 11/20] Refactor notes concatenation into a flexible interface for combining notes Johan Herland
2010-01-17 21:04 ` [PATCHv11 12/20] Builtin-ify git-notes Johan Herland
2010-01-21 18:28 ` Stephen Boyd
2010-01-26 2:09 ` Johan Herland
2010-01-17 21:04 ` [PATCHv11 13/20] t3301: Verify successful annotation of non-commits Johan Herland
2010-01-17 21:04 ` [PATCHv11 14/20] t3305: Verify that adding many notes with git-notes triggers increased fanout Johan Herland
2010-01-17 21:04 ` [PATCHv11 15/20] Teach notes code to properly preserve non-notes in the notes tree Johan Herland
2010-01-17 21:04 ` [PATCHv11 16/20] Teach builtin-notes to remove empty notes Johan Herland
2010-01-17 21:04 ` [PATCHv11 17/20] builtin-notes: Teach -d option for deleting existing notes Johan Herland
2010-01-17 21:04 ` [PATCHv11 18/20] t3305: Verify that removing notes triggers automatic fanout consolidation Johan Herland
2010-01-17 21:04 ` [PATCHv11 19/20] Notes API: gc_notes(): Prune notes that belong to non-existing objects Johan Herland
2010-01-17 21:04 ` [PATCHv11 20/20] builtin-gc: Teach the new --notes option to garbage-collect notes Johan Herland
2010-01-21 19:27 ` Stephen Boyd
2010-01-21 20:01 ` Junio C Hamano
2010-01-27 12:02 ` Johan Herland [this message]
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=201001271302.17368.johan@herland.net \
--to=johan@herland.net \
--cc=bebarino@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/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).