From: mhagger@alum.mit.edu
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Jeff King <peff@peff.net>,
Drew Northup <drew.northup@maine.edu>,
Jakub Narebski <jnareb@gmail.com>,
Heiko Voigt <hvoigt@hvoigt.net>,
Johan Herland <johan@herland.net>,
Julian Phillips <julian@quantumfyre.co.uk>,
Michael Haggerty <mhagger@alum.mit.edu>
Subject: [PATCH v2 00/12] Use refs API more consistently
Date: Fri, 28 Oct 2011 13:27:52 +0200 [thread overview]
Message-ID: <1319801284-15625-1-git-send-email-mhagger@alum.mit.edu> (raw)
From: Michael Haggerty <mhagger@alum.mit.edu>
This is a re-roll of the patch series on top of v3 of "Tidying up
references code", which in turn applies to gitster/master.
This series conflicts with the "Checking full vs. partial refnames"
series but not in a fundamental way. Unless there is an important
reason to merge the latter to master before this patch series, I
suggest that I reroll "Checking full vs. partial refnames" on top of
these ref-api changes after they hit master.
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 become 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.
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 | 255 ++++++++++++++++++++++++++++++++++++++++------------------------
1 files changed, 160 insertions(+), 95 deletions(-)
--
1.7.7
next reply other threads:[~2011-10-28 11:28 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-28 11:27 mhagger [this message]
2011-10-28 11:27 ` [PATCH v2 01/12] Rename another local variable name -> refname mhagger
2011-10-28 11:27 ` [PATCH v2 02/12] repack_without_ref(): remove temporary mhagger
2011-10-28 11:27 ` [PATCH v2 03/12] parse_ref_line(): add a check that the refname is properly formatted mhagger
2011-10-28 11:27 ` [PATCH v2 04/12] create_ref_entry(): extract function from add_ref() mhagger
2011-10-28 11:27 ` [PATCH v2 05/12] add_ref(): take a (struct ref_entry *) parameter mhagger
2011-10-28 11:27 ` [PATCH v2 06/12] do_for_each_ref(): correctly terminate while processesing extra_refs mhagger
2011-10-28 11:27 ` [PATCH v2 07/12] do_for_each_ref_in_array(): new function mhagger
2011-10-28 11:28 ` [PATCH v2 08/12] do_for_each_ref_in_arrays(): " mhagger
2011-10-28 11:28 ` [PATCH v2 09/12] repack_without_ref(): reimplement using do_for_each_ref_in_array() mhagger
2011-10-28 11:28 ` [PATCH v2 10/12] names_conflict(): new function, extracted from is_refname_available() mhagger
2011-10-28 11:28 ` [PATCH v2 11/12] names_conflict(): simplify implementation mhagger
2011-10-28 11:28 ` [PATCH v2 12/12] is_refname_available(): reimplement using do_for_each_ref_in_array() mhagger
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=1319801284-15625-1-git-send-email-mhagger@alum.mit.edu \
--to=mhagger@alum.mit.edu \
--cc=drew.northup@maine.edu \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=hvoigt@hvoigt.net \
--cc=jnareb@gmail.com \
--cc=johan@herland.net \
--cc=julian@quantumfyre.co.uk \
--cc=peff@peff.net \
/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).