Re: config-file includes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Sep 26, 2011 at 08:45:58PM +1000, Nguyen Thai Ngoc Duy wrote:
> On Sat, Sep 24, 2011 at 5:58 AM, Jeff King <peff@xxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]