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

Re: [PATCH] Prevent git-config from storing section keys that are too long

From
Ben Walton <bwalton@artsci.utoronto.ca>
Date
Sep 7, 2012, 02:34 UTC
Message-ID
<1346984829-sup-4477@pinkfloyd.chass.utoronto.ca>
In-Reply-To
<7vpq5yzkf3.fsf@alter.siamese.dyndns.org>
Excerpts from Junio C Hamano's message of Thu Sep 06 21:33:20 -0400 2012:
Hi Junio,
Show 14 quoted lines
> > identifiers generated from keys like:
> >
> > url./some/really/long/path.insteadOf
> >
> > could overrun the current limit.  It's not a common case, of course,
> > or this issue would have been found sooner.  Would doubling the
> > current limit be out of the question?
> 
> Is there a reason to have _any_ limitation?  It is not like we store
> configuration data by allocating one file per item (in which case we
> may be limited by the filesystem limit for direntry size), so if it
> is not too much trouble, I think the right thing to do is to lift
> the limitation altogether, possibly using strbuf instead of a
> statically sized array of characters.

I thought it made sense to impose some sort of bound here but removing the limit wouldn't encourage the use of ridiculously long names so lifting it entirely shouldn't hurt.

Any chosen limit would always be somewhat arbitrary. I had considered extending it to (PATHMAX + x) where x would also be arbitrary as that would allow any valid url./path/max.insteadOf type setting but that didn't seem like a good approach.

Removing the limit is a much better choice...
Show 6 quoted lines
> Of course, once you write a very long entry using a newer version of
> Git, the resulting configuration file may end up unusable by older
> version of Git, so a patch to implement such a change may need to be
> based on older maintenance release (say maint-1.7.9) and then merged
> upwards, but otherwise I do not offhand see a compatibility downside
> of such a change.

I'm ok with this approach and will put an altered patch together shortly. I think it's fairly unlikely, but not impossible, that anyone creating a config file with long key names would be in a situation where someone else couldn't read that same config file. I'll still base the change on maint-1.7.9 as suggested though.

Thanks -Ben -- Ben Walton Systems Programmer - CHASS University of Toronto C:416.407.5610 | W:416.978.4302

Previous: Junio C HamanoNext: Ben Walton
Message 3 of 9 in “Prevent git-config from storing section keys that are too long”
  1. Prevent git-config from storing section keys that are too longBen Walton, Sep 7, 2012
  2. Junio C HamanoSep 7, 2012
  3. Ben WaltonSep 7, 2012
  4. Remove the hard coded length limit on variable names in config filesBen Walton, Sep 29, 2012
  5. Michael HaggertySep 30, 2012
  6. Ben WaltonSep 30, 2012
  7. Remove the hard coded length limit on variable names in config filesBen Walton, Sep 30, 2012
  8. Junio C HamanoOct 1, 2012
  9. Michael HaggertyOct 1, 2012

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.