git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: git@vger.kernel.org, Eli Barzilay <eli@barzilay.org>,
	Heiko Voigt <hvoigt@hvoigt.net>
Subject: Re: [PATCH/RFC] Hacky version of a glob() driven config include
Date: Sat, 8 May 2010 01:06:32 -0400	[thread overview]
Message-ID: <20100508050632.GE14998@coredump.intra.peff.net> (raw)
In-Reply-To: <1273180440-8641-1-git-send-email-avarab@gmail.com>

On Thu, May 06, 2010 at 09:14:00PM +0000, Ævar Arnfjörð Bjarmason wrote:

> This is not ready for inclusion in anything. Commiting for RFC on
> whether this way of doing it is sane in theory.

I think the goal of having globbing include files is reasonable.

>   * It relies on the GNU GLOB_TILDE extension with no
>     alternative. That can be done by calling getenv("HOME") and
>     s/~/$home/.

We already have expand_user_path which handles ~ properly (it is used
for the values of some config entries). You could then glob the result.

> +cat > .git/config << EOF
> +[some]
> +	variable = blah
> +[voodoo]
> +	include = .git/more_config_*
> +EOF

My eyes! The goggles do nothing!

That syntax is horrid. Wouldn't it be much simpler to introduce some
top-level syntax for "include this file here", with some very simple
semantics:

  - the included file starts with no section. It should have its own
    section header.

  - after returning from the included file, we are in no section. You
    need a new section header.

Yes, there are some complex tricks those semantics won't allow, but they
are simple to read and understand, simple to use, and simple to
implement.

And really, what is the point in supporting crap like:

   $ cat .gitconfig
   [diff]
   #include foo

   $ cat foo
   rename = true

-Peff

      parent reply	other threads:[~2010-05-08  5:06 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-01 21:20 Is there interest in reading ~/.gitconfig.d/* and /etc/gitconfig.d/*? Ævar Arnfjörð Bjarmason
2010-04-01 22:03 ` Heiko Voigt
2010-04-04  7:24 ` Peter Krefting
2010-04-04  7:59   ` Eli Barzilay
     [not found]   ` <19384.17579.205005.86711@winooski.ccs.neu.edu>
2010-04-06  8:15     ` Ævar Arnfjörð Bjarmason
2010-04-06  9:02       ` Jakub Narebski
2010-05-06 21:14       ` [PATCH/RFC] Hacky version of a glob() driven config include Ævar Arnfjörð Bjarmason
2010-05-07  6:00         ` Bert Wesarg
2010-05-07 16:56           ` Ævar Arnfjörð Bjarmason
2010-05-07 18:29             ` Bert Wesarg
2010-05-07 18:58               ` Ævar Arnfjörð Bjarmason
2010-05-07 19:02                 ` Jacob Helwig
2010-05-07 19:52                 ` Bert Wesarg
2010-05-07 20:11                   ` [PATCH/RFC v2] " Ævar Arnfjörð Bjarmason
2010-05-07 20:46         ` [PATCH/RFC] " Jakub Narebski
2010-05-07 22:15           ` Ævar Arnfjörð Bjarmason
2010-05-07 23:43             ` Jakub Narebski
2010-05-08  2:30               ` Ping Yin
2010-05-08  8:18                 ` Jakub Narebski
2010-05-08  9:03                   ` Ping Yin
2010-05-08  5:06         ` Jeff King [this message]

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=20100508050632.GE14998@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=avarab@gmail.com \
    --cc=eli@barzilay.org \
    --cc=git@vger.kernel.org \
    --cc=hvoigt@hvoigt.net \
    /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).