From: Junio C Hamano <gitster@pobox.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Christian Thaeter <ct@pipapo.org>,
git@vger.kernel.org, gitster@pobox.com
Subject: Re: [PATCH 2/5] First step, making setup (somewhat) reentrant
Date: Mon, 07 Jan 2008 01:22:43 -0800 [thread overview]
Message-ID: <7v4pdq0z30.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <alpine.LSU.1.00.0801070845270.10101@racer.site> (Johannes Schindelin's message of "Mon, 7 Jan 2008 08:50:40 +0000 (GMT)")
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> Which brings me to a more fundamental question: what do you need reentrant
> setup_directory() for? If it is just to allow multiple calls to that
> function for the _same_ repository, I say clean up your code.
IIRC, he is writing a set-of-repositories browser.
But I think the right approach of cleaning up is to design a
layer of containers like we did for "the_index" libification
[*1*]. We would probably want:
* a container that abstracts accesses to a single repository
that includes:
- set of refs;
- object database and object hash (because different
repositories can have different notion of who is parent of
whom);
* a container that abstracts accesses to a state of the index
(we already have this -- the_index).
* a container that abstracts a manipulation state in a single
repository, that points at the first one but somehow knows
what in-core objects are rewritten during its operation
(e.g. history simplification rewrites parents list in in-core
commit objects).
and a relatively low impact approach to transition to such a
scheme would be to use "the_index" libification as the model.
I.e. make the real API to take an explicit container as one of
their parameter, but define the default container to work on for
each level, and express the existing API in terms of the updated
API that works on the default container.
[Reference]
228e94f93570b580da388069900c56b813c91953 (Move index-related
variables into a structure.)
4aab5b46f44a7ba860e07a52be506b7b57b2bd5f (Make read-cache.c
"the_index" free.)
next prev parent reply other threads:[~2008-01-07 9:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-07 5:47 [PATCH 1/5] Add streq() to compat-util Christian Thaeter
2008-01-07 5:47 ` [PATCH 2/5] First step, making setup (somewhat) reentrant Christian Thaeter
2008-01-07 5:47 ` [PATCH 3/5] provide a reset_packed_git() function Christian Thaeter
2008-01-07 5:47 ` [PATCH 4/5] Export some more functions to enable resetting the git state Christian Thaeter
2008-01-07 5:47 ` [PATCH 5/5] Make setup_git_directory reentrant Christian Thaeter
2008-01-07 8:50 ` [PATCH 2/5] First step, making setup (somewhat) reentrant Johannes Schindelin
2008-01-07 9:22 ` Junio C Hamano [this message]
2008-01-07 11:28 ` Johannes Schindelin
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=7v4pdq0z30.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=ct@pipapo.org \
--cc=git@vger.kernel.org \
/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).