git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/12] Use refs API more consistently
@ 2011-10-19 21:44 mhagger
  2011-10-19 21:44 ` [PATCH 01/12] Rename another local variable name -> refname mhagger
                   ` (11 more replies)
  0 siblings, 12 replies; 18+ messages in thread
From: mhagger @ 2011-10-19 21:44 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>

This patch series primarily has to do with using the refs API more
consistently within refs.c itself.  We want to minimize the surface
area for accessing the ref_cache data structure so that when it is
changed into a tree (we're on the verge of that change now, I
promise!) we don't have to change callers more than necessary.  There
is also a bit of an eat-your-own-dogfood thing going on here; if
for_each_ref() and its friends are good enough for "outsiders", they
should be good enough for most internal use.

The first two patches are trivial preparation cleanups.

The third verifies that refnames read from packed-ref files are
properly formatted.  When the REFNAME_FULL changes becomes available,
this check can be tightened up.

The do_for_each_ref_in_{array,arrays}() functions provide an
iterator-like interface to iterating over a single ref_array and
iterating over two ref_arrays in parallel.  These are useful
abstractions in and of themselves (the former is used to reimplement
repack_without_ref() and is_refname_available() in patches 9 and 12
respectively).  And they will be even more useful when references are
stored hierarchically.

This series applies on top of mh/ref-api-2.  It conflicts with the
"Checking full vs. partial refnames" series that I just submitted but
not in any fundamental way.  I'll be happy to reconcile them for you
in a later round when it is clear if and when each series is accepted.

Michael Haggerty (12):
  Rename another local variable name -> refname
  repack_without_ref(): remove temporary
  parse_ref_line(): add a check that the refname is properly formatted
  create_ref_entry(): extract function from add_ref()
  add_ref(): take a (struct ref_entry *) parameter
  do_for_each_ref(): correctly terminate while processesing extra_refs
  do_for_each_ref_in_array(): new function
  do_for_each_ref_in_arrays(): new function
  repack_without_ref(): reimplement using do_for_each_ref_in_array()
  names_conflict(): new function, extracted from is_refname_available()
  names_conflict(): simplify implementation
  is_refname_available(): reimplement using do_for_each_ref_in_array()

 refs.c |  259 ++++++++++++++++++++++++++++++++++++++++------------------------
 1 files changed, 162 insertions(+), 97 deletions(-)

-- 
1.7.7

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

end of thread, other threads:[~2011-10-24 11:59 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-19 21:44 [PATCH 00/12] Use refs API more consistently mhagger
2011-10-19 21:44 ` [PATCH 01/12] Rename another local variable name -> refname mhagger
2011-10-19 21:44 ` [PATCH 02/12] repack_without_ref(): remove temporary mhagger
2011-10-19 21:44 ` [PATCH 03/12] parse_ref_line(): add a check that the refname is properly formatted mhagger
2011-10-19 21:44 ` [PATCH 04/12] create_ref_entry(): extract function from add_ref() mhagger
2011-10-19 21:44 ` [PATCH 05/12] add_ref(): take a (struct ref_entry *) parameter mhagger
2011-10-19 21:44 ` [PATCH 06/12] do_for_each_ref(): correctly terminate while processesing extra_refs mhagger
2011-10-19 21:44 ` [PATCH 07/12] do_for_each_ref_in_array(): new function mhagger
2011-10-19 21:44 ` [PATCH 08/12] do_for_each_ref_in_arrays(): " mhagger
2011-10-19 22:39   ` Junio C Hamano
2011-10-20  7:29     ` Michael Haggerty
2011-10-19 21:44 ` [PATCH 09/12] repack_without_ref(): reimplement using do_for_each_ref_in_array() mhagger
2011-10-19 21:44 ` [PATCH 10/12] names_conflict(): new function, extracted from is_refname_available() mhagger
2011-10-19 21:44 ` [PATCH 11/12] names_conflict(): simplify implementation mhagger
2011-10-19 21:44 ` [PATCH 12/12] is_refname_available(): reimplement using do_for_each_ref_in_array() mhagger
2011-10-20  1:40   ` Junio C Hamano
2011-10-20  7:46     ` Michael Haggerty
2011-10-24 11:58       ` 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).