Subject: Re: feature request - have git honor nested .gitconfig files

From: Jonathan Nieder <[email-masked]>
Date: Fri, 22 Mar 2013 17:06:28 -0700

Jeff King wrote:
> On Fri, Mar 22, 2013 at 11:22:11AM -0700, Jonathan Nieder wrote:

>>                                     It would be easier to understand
>>    the configuration if ~/.gitconfig could spell out the rule
>>    explicitly:
[...]
>>    It sounds hard to do right, especially considering use cases like
>>    "User runs into trouble, asks a privileged sysadmin to try running
>>    a command in her untrusted repository", but it is worth thinking
>>    about how to do.
>
> I'd rather not invent a new language. It will either not be featureful
> enough, or will end up bloated. Or both. How about something like:
>
>   [include]
>        exec = "
>          case \"$GIT_DIR\" in)
>            */dev/*) cat ~/.config/git/dev-config ;;
>                  *) cat ~/.config/git/nondev-config ;;
>           esac
>        "

Yes, an existing language like shell or lua would presumably be the
way to go.  The scary aspect of shell is the "Prankster sets up a
malicious configuration, asks a sysadmin to help in her repository"
scenario.  Of course we already have that problem with command
aliases, but if the sysadmin has perfect spelling then aliases would
never trip, so...

Hopefully that's enough information for anyone interested to start and
understand the relevant variables at play.

Thanks,
Jonathan