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

Re: project wide: git config entry for [diff] renames=true

From
JHJunio C Hamano <gitster-e+axbwqsrlaavxtiumwx3w@public.gmane.org>
Date
Sep 25, 2014, 18:53 UTC
Message-ID
<xmqqy4t7a5vx.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20140925180005.GA11755-AdEPDUrAXsQ@public.gmane.org>
Jeff King <peff-AdEPDUrAXsQ@public.gmane.org> writes:
Show 9 quoted lines
> There is no such mechanism within git. We've resisted adding one because
> of the danger of something like:
>
>   [diff]
>     external = rm -rf /
>
> diff.renames is probably safe, but any config-sharing mechanism would
> have to deal with either whitelisting, or providing some mechanism for
> the puller to review changes before blindly following them.

It might be useful to add a "safe include" feature, perhaps? We ship a small set of hardcoded default whitelist (diff.renames may be included in there), and allow the user who do not want to be affected to override it with

    [include]
        safe = !diff.renames
or even
    [config]
    	safe = !*

at the same time allow them to add what we do not hardcode to it using the same mechanism, e.g.

    [config]
    	safe = merge.*
Then
    [include]
	safe
    	path = ../project.gitconfig
    [include]
    	path = $HOME/.gitconfig-variant1

would only allow the variables include.safe deems safe to affect us from the in-tree file, and use everything from my personal set in my home directory.

    	
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 14 in “project wide: git config entry for [diff] renames=true”
  1. Joe PerchesSep 25, 2014
  2. Jeff KingSep 25, 2014
  3. Joe PerchesSep 25, 2014
  4. Junio C HamanoSep 25, 2014
  5. Junio C HamanoSep 25, 2014
  6. Junio C HamanoSep 25, 2014
  7. 0/2 Introduce safe-include config featureRasmus Villemoes, Oct 3, 2014
  8. 1/2 config: Add safe-include directiveRasmus Villemoes, Oct 3, 2014
  9. Junio C HamanoOct 3, 2014
  10. Junio C HamanoOct 3, 2014
  11. Junio C HamanoOct 3, 2014
  12. Rasmus VillemoesOct 6, 2014
  13. Junio C HamanoOct 6, 2014
  14. 2/2 config: Add test of safe-include featureRasmus Villemoes, Oct 3, 2014

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.