Re: config-file includes
- From
David Aguilar <davvid@gmail.com>
- Date
- Sep 26, 2011, 19:21 UTC
- Message-ID
- <20110926192126.GA55743@gmail.com>
- In-Reply-To
- <CACsJy8BAVRAct=sxTpZ+b-ft1OjbY9oZG6uEXrcsTXw3CXnwSg@mail.gmail.com>
On Mon, Sep 26, 2011 at 08:45:58PM +1000, Nguyen Thai Ngoc Duy wrote:
Show 21 quoted lines
> On Sat, Sep 24, 2011 at 5:58 AM, Jeff King <peff@peff.net> wrote: > > Another thing is, what if I want to exclude certain part of the included config? > > [1] http://thread.gmane.org/gmane.comp.version-control.git/163285/focus=163288 > > > [1] I want conditional inclusion because sometimes the rules for config > > entries changes from version to version. For example, I have > > pager.diff set to a script in my ~/.gitconfig. But older versions of > > git don't understand non-boolean values and barf. I'd really like to > > do something like: > > > > [include-ifdef "has-pager-scripts"] > > path = ~/.gitconfig-pager > > > > where "has-pager-scripts" would be a magic flag compiled into git > > versions that understand that config. > > But how far would you go with conditional expressions? > -- > Duy
This syntax is simple yet would solve one problem I run into often. It could be used for the case where some settings (e.g. diff.tool, merge.tool) are different on OS X and Linux.
[include-ifdef "darwin"] path = ~/.gitconfig-darwin
-- David