From: Jeff King <peff@peff.net>
To: karthik nayak <karthik.188@gmail.com>
Cc: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>,
Git List <git@vger.kernel.org>,
Michael Haggerty <mhagger@alum.mit.edu>
Subject: Re: [GSOC] Git Configuration API improvements
Date: Fri, 14 Mar 2014 00:31:41 -0400 [thread overview]
Message-ID: <20140314043141.GC31906@sigill.intra.peff.net> (raw)
In-Reply-To: <CAOLa=ZQwrtvoBWEra-p9wwFmYBZqcz75a9R0qm7bv2g7UCJn4A@mail.gmail.com>
On Tue, Mar 11, 2014 at 09:49:33PM +0530, karthik nayak wrote:
> On Tue, Mar 11, 2014 at 8:21 PM, Matthieu Moy
> <Matthieu.Moy@grenoble-inp.fr> wrote:
> > karthik nayak <karthik.188@gmail.com> writes:
> >
> >> Currently we have multiple invocation of git_config() in an
> >> individual invocation of git() which is not efficient. Also, it is
> >> hard to implement new features,
> >
> > I think efficiency is not a real concern here. Config files are small
> > and easy to parse, so parsing them multiple times isn't really
> > noticeable from the performance point of view.
> >
> > OTOH, the extensibility is a real concern, and that should be the main
> > motivation for the project.
>
> Thanks. I understand what you mean. extensibility is the main motivation of the
> project, i think that by implementing the cache system we can fix the
> small problems
> (reappearing of headers while setting and unsetting configs) and also
> implement new features
> like to unset a config easily.
I think the most interesting part of the config idea is turning the
fetching of config variables "inside out".
That is, right now we turn control over to the config code, which
invokes our callbacks. So we see all variables in sequence, and pick out
the ones that are interesting. We implement precedence with a "last one
wins" technique where we keep overwriting a variable with subsequent
config options.
This can lead to difficult ordering situations, such as when a config
option _might_ be respected based on another factor (e.g., the presence
of a command line option, as in the status.branch option).
It also means that it's impossible to tell after the fact whether a
value was set explicitly on the command line, by config, or if we are
using a system default. Most of the time this doesn't matter, but there
are a few cases where we care, and we end up having to manually manage
a separate flag in each case.
By the phrase "inside out" above, I mean that we could read all config,
and then fetch individual values as we need them. We do need to care
about efficiency here, but only insofar as we don't cause any
regressions (that is, the current system is fine speed-wise, we just
need to make sure that we do not create new problems by calling a slow
lookup in a tight loop or anything like that).
-Peff
next prev parent reply other threads:[~2014-03-14 4:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-11 13:12 [GSOC] Git Configuration API improvements karthik nayak
2014-03-11 14:51 ` Matthieu Moy
2014-03-11 16:19 ` karthik nayak
2014-03-14 4:31 ` Jeff King [this message]
2014-03-15 16:30 ` karthik nayak
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=20140314043141.GC31906@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=Matthieu.Moy@grenoble-inp.fr \
--cc=git@vger.kernel.org \
--cc=karthik.188@gmail.com \
--cc=mhagger@alum.mit.edu \
/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).