git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: StGIT and repo-config

From
CMCatalin Marinas <catalin.marinas@gmail.com>
Date
Jan 26, 2007, 22:51 UTC
Message-ID
<b0943d9e0701261451y58062564yddad0a7471e0eff6@mail.gmail.com>
In-Reply-To
<20070126175302.GG4083@nan92-1-81-57-214-146.fbx.proxad.net>
On 26/01/07, Yann Dirson <ydirson@altern.org> wrote:
Show 9 quoted lines
> On Fri, Jan 26, 2007 at 12:58:38AM +0100, Johannes Schindelin wrote:
> > On Thu, 25 Jan 2007, Catalin Marinas wrote:
> > > The dictionary should also be pre-populated with the default values
> > > (only in memory, not going to the config file on disk).
>
> Pre-filling with default value has a drawback: it will create lots of
> useless entries, especially for per-branch settings.  I'd rather let
> the accessors return the default value when needed.  We can still
> group all defaults in a single dictionnary.

What I meant is that it should pre-fill only with the default entries needed by StGIT (probably around 10, see stgit.config.config_setup()). The rest should be filled in when reading the config files.

Show 8 quoted lines
> > The most important point (to me) which came out of the discussion: It is
> > not at all easy, or straight-forward, to handle multi-vars, i.e. multiple
> > values for the same key.
>
> Right, at least for filling a dictionnary.  We would need to declare
> multi-valued parameters as such, which basically means we must only
> try to read those config items we know about, which has all sorts of
> consequences for config.py :)

But are multi-vars in the same file currently used? There is a clear situation when a key is written in both the global and the per-repository config files. From the StGIT point of view, it should only care about the most specific one, i.e. the one in the per-repo config and this would be the last one listed by git-repo-config (and therefore overriding any preceding dictionary entry).

> It would seem reasonable to start without a cache dictionnary, at
> least for now.  After all, there are not so many config items to know
> about in a single stgit run, so IIMHO we're only going to notice a
> difference for the time needed to run the testsuite.

I'd like to avoid calling git-repo-config for every config option, even if this wouldn't be noticeable (initially, but the tool would evolve). If we don't care about multi-vars, as I said above, a dictionary cache would make sense.

-- 
Catalin
Previous: Yann DirsonNext: Johannes Schindelin
Message 5 of 8 in “StGIT and repo-config”
  1. Yann DirsonJan 25, 2007
  2. Catalin MarinasJan 25, 2007
  3. Johannes SchindelinJan 25, 2007
  4. Yann DirsonJan 26, 2007
  5. Catalin MarinasJan 26, 2007
  6. Johannes SchindelinJan 26, 2007
  7. Yann DirsonJan 27, 2007
  8. Catalin MarinasJan 28, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.