git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Ben Walton <bwalton@artsci.utoronto.ca>
To: Junio C Hamano <gitster@pobox.com>
Cc: git <git@vger.kernel.org>
Subject: Re: [PATCH] Prevent git-config from storing section keys that are too long
Date: Thu, 06 Sep 2012 22:34:21 -0400	[thread overview]
Message-ID: <1346984829-sup-4477@pinkfloyd.chass.utoronto.ca> (raw)
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,

> > 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...

> 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

  reply	other threads:[~2012-09-07  2:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-07  0:47 [PATCH] Prevent git-config from storing section keys that are too long Ben Walton
2012-09-07  1:33 ` Junio C Hamano
2012-09-07  2:34   ` Ben Walton [this message]
2012-09-29 10:19   ` [PATCH] Remove the hard coded length limit on variable names in config files Ben Walton
2012-09-30  4:05     ` Michael Haggerty
2012-09-30 18:20       ` Ben Walton
2012-09-30 19:44         ` Ben Walton
2012-10-01 19:33           ` Junio C Hamano
2012-10-01  3:16         ` Michael Haggerty

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1346984829-sup-4477@pinkfloyd.chass.utoronto.ca \
    --to=bwalton@artsci.utoronto.ca \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).