git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Mar 23, 2013, 00:06 UTC
Message-ID
<20130323000628.GM12223@google.com>
In-Reply-To
<20130322183306.GA32448@sigill.intra.peff.net>
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:
[...]
Show 15 quoted lines
>>    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

Previous: Jeff KingNext: Jeff King
Message 4 of 8 in “feature request - have git honor nested .gitconfig files”
  1. Josh SharpeMar 22, 2013
  2. Jonathan NiederMar 22, 2013
  3. Jeff KingMar 22, 2013
  4. Jonathan NiederMar 23, 2013
  5. Jeff KingMar 23, 2013
  6. Junio C HamanoMar 24, 2013
  7. Thomas RastMar 23, 2013
  8. Jeff KingMar 23, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.