git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/7] Provide API to invalidate refs cache
@ 2011-10-17  2:38 mhagger
  2011-10-17  2:38 ` [PATCH v4 1/7] invalidate_ref_cache(): rename function from invalidate_cached_refs() mhagger
                   ` (8 more replies)
  0 siblings, 9 replies; 11+ messages in thread
From: mhagger @ 2011-10-17  2:38 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: git, Jeff King, Drew Northup, Jakub Narebski, Heiko Voigt,
	Johan Herland, Julian Phillips, Michael Haggerty

From: Michael Haggerty <mhagger@alum.mit.edu>

These patches are re-rolled onto the current master and incorporate
Junio's suggestion to rename "struct cached_refs" to "ref_cache".

This patch series provides an API for external code to invalidate the
ref cache that is used internally to refs.c.  It also allows code
*within* refs.c to invalidate only the packed or only the loose refs
for a module/submodule.

IMPORTANT:

I won't myself have time to figure out who, outside of refs.c, has to
*call* invalidate_ref_cache().  The candidates that I know off the top
of my head are git-clone, git-submodule [1], and git-pack-refs.  It
would be great if experts in those areas would insert calls to
invalidate_ref_cache() where needed.

Even better would be if the meddlesome code were changed to use the
refs API.  I'd be happy to help expanding the refs API if needed to
accommodate your needs.

This is why the API for invalidating only packed or loose refs is
private.  After code outside refs.c is changed to use the refs API, it
will get the optimal behavior for free (and at that time
invalidate_ref_cache() can be removed again).

[1] http://marc.info/?l=git&m=131827641227965&w=2
    In this mailing list thread, Heiko Voigt stated that git-submodule
    does not modify any references, so it should not have to use the
    API.

Michael Haggerty (7):
  invalidate_ref_cache(): rename function from invalidate_cached_refs()
  invalidate_ref_cache(): take the submodule as parameter
  invalidate_ref_cache(): expose this function in the refs API
  clear_ref_cache(): rename parameter
  clear_ref_cache(): extract two new functions
  write_ref_sha1(): only invalidate the loose ref cache
  clear_ref_cache(): inline function

 refs.c |   59 +++++++++++++++++++++++++++++++----------------------------
 refs.h |    8 ++++++++
 2 files changed, 39 insertions(+), 28 deletions(-)

-- 
1.7.7.rc2

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2011-10-17 19:43 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-17  2:38 [PATCH v4 0/7] Provide API to invalidate refs cache mhagger
2011-10-17  2:38 ` [PATCH v4 1/7] invalidate_ref_cache(): rename function from invalidate_cached_refs() mhagger
2011-10-17  2:38 ` [PATCH v4 2/7] invalidate_ref_cache(): take the submodule as parameter mhagger
2011-10-17  2:38 ` [PATCH v4 3/7] invalidate_ref_cache(): expose this function in the refs API mhagger
2011-10-17  2:38 ` [PATCH v4 4/7] clear_ref_cache(): rename parameter mhagger
2011-10-17  2:38 ` [PATCH v4 5/7] clear_ref_cache(): extract two new functions mhagger
2011-10-17  2:38 ` [PATCH v4 6/7] write_ref_sha1(): only invalidate the loose ref cache mhagger
2011-10-17  2:38 ` [PATCH v4 7/7] clear_ref_cache(): inline function mhagger
2011-10-17  5:40 ` [PATCH v4 0/7] Provide API to invalidate refs cache Junio C Hamano
2011-10-17 18:47 ` Heiko Voigt
2011-10-17 19:43   ` Michael Haggerty

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