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

Re: General support for ! in git-config values

From
KMKyle Moffett <kyle@moffetthome.net>
Date
Feb 3, 2012, 07:35 UTC
Message-ID
<CAGZ=bq+i6t7ik6WoX8B=_uKR6WVvnBk3KuJDngFpWObGWgivzw@mail.gmail.com>
In-Reply-To
<7vmx90say8.fsf@alter.siamese.dyndns.org>
On Thu, Feb 2, 2012 at 22:11, Junio C Hamano <gitster@pobox.com> wrote:
Show 15 quoted lines
> Kyle Moffett <kyle@moffetthome.net> writes:
>
>> Alternatively, you could extend the recent proposal for GIT config
>> "include" statements so that something like this works:
>>
>> [include]
>>     exec = echo "deploy.prefix = `cat /etc/SERVER_ROLE`"
>>     exec = /usr/local/bin/git-config-for-ldap-user
>
> Erh...
>
> Running known stuff from your own .git/config may be justifiable as "at
> your own risk", but if we consider sources that are not under your direct
> control, such as /etc/gitconfig and whatever your project encourages you
> to include from your .git/config,... eek.

Well yes, but running commands from .git/config is exactly what the OP requested, and if it applies to .git/config it should also be applicable to other trusted include sources too, no?

Perhaps allow config files to perform a "trusted" include, EG:
[include]
    trusted_exec = /usr/local/bin/site-specific-config-program
    blob = v1.0:src/gitconfig

By default, the only files which would be trusted are /etc/gitconfig, ~/.gitconfig, and .git/config (but ONLY if it has the same owner and mode go-w), and they would only pass trust on to other files if they use "trusted_*" include lines.

Also, since "include" is intended to introduce a non-backwards-compatible change in behavior, perhaps a totally different format should be used, EG:

$include exec_trusted /usr/local/bin/site-specific-config-program $include blob v1.0:src/gitconfig

Something that would cause noticeable warnings in older versions of git instead of silently ignoring the desired config includes.

Just a few thoughts.

Cheers, Kyle Moffett

Previous: Junio C HamanoNext: Jeff King
Message 16 of 20 in “General support for ! in git-config values”
  1. Ævar Arnfjörð BjarmasonFeb 1, 2012
  2. Jeff KingFeb 1, 2012
  3. Ævar Arnfjörð BjarmasonFeb 1, 2012
  4. Junio C HamanoFeb 1, 2012
  5. demerphqFeb 2, 2012
  6. Junio C HamanoFeb 2, 2012
  7. demerphqFeb 2, 2012
  8. Junio C HamanoFeb 2, 2012
  9. demerphqFeb 2, 2012
  10. Jeff KingFeb 2, 2012
  11. demerphqFeb 2, 2012
  12. Jeff KingFeb 2, 2012
  13. demerphqFeb 2, 2012
  14. Kyle MoffettFeb 3, 2012
  15. Junio C HamanoFeb 3, 2012
  16. Kyle MoffettFeb 3, 2012
  17. Jeff KingFeb 3, 2012
  18. Jeff KingFeb 3, 2012
  19. Junio C HamanoFeb 2, 2012
  20. demerphqFeb 2, 2012

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.