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

Re: Proposal: sharing .git/config

From
Jeff King <peff@peff.net>
Date
Mar 12, 2013, 08:53 UTC
Message-ID
<20130312085342.GA11340@sigill.intra.peff.net>
In-Reply-To
<CALkWK0kZiYmbh-dSr-c2mzK2Mzhf3iZ_T3hFNuR57F0b5tptGw@mail.gmail.com>
On Tue, Mar 12, 2013 at 01:01:08AM +0530, Ramkumar Ramachandra wrote:
Show 16 quoted lines
> > But it was pointed out that you could also just do:
> >
> >   $ git config include.ref upstream-config
> >   $ git show origin/config ;# make sure it looks reasonable
> >   $ git show origin/config >.git/upstream-config
> >
> > and so forth. There are some ways that a pure ref can be more
> > convenient (e.g., if you are carrying local changes on top of the
> > upstream config and want to merge), but ultimately, you can replicate
> > any include.ref workflow with include.path by adding a "deploy" step
> > where you copy the file into $GIT_DIR.
> 
> This seems to be unnecessarily complex and inelegant.  Maybe this
> functionality is best managed as a separate git repository: `repo`
> from depot_tools uses a manifest repository containing all the project
> metadata.  Maybe we can extend it/ write an more general version?

I don't think you can avoid the 3-step problem and retain the safety in the general case. Forgetting implementation details for a minute, you have either a 1-step system:

  1. Fetch and start using config from the remote.
which is subject to fetching and executing malicious config, or:
  1. Fetch config from remote.
  2. Inspect it.
  3. Integrate it into the current config.

We can automate the sequence to remove as much friction as possible, but fundamentally step 2 requires some effort from the user. Moving the config to a separate repo does not get rid of those steps. The user either does not look at the config before using it, in which case we are no better than the 1-step scenario, or they do, in which case they are replicating the 3-step scenario.

The other alternative is to automate step 2. The simplest way would be to have a whitelist of "ok to share" config, that would not include things like diff.external that can run arbitrary code. I don't know whether that would make the system too limited for what people want to do. Do we have a concrete example of what config people would like to share in this manner?

-Peff
Previous: Ramkumar RamachandraNext: Ramkumar Ramachandra
Message 8 of 11 in “Proposal: sharing .git/config”
  1. Ramkumar RamachandraFeb 19, 2013
  2. Thomas RastFeb 19, 2013
  3. Ramkumar RamachandraFeb 19, 2013
  4. Thomas RastFeb 19, 2013
  5. Duy NguyenFeb 19, 2013
  6. Jeff KingFeb 19, 2013
  7. Ramkumar RamachandraMar 11, 2013
  8. Jeff KingMar 12, 2013
  9. Ramkumar RamachandraMar 18, 2013
  10. Jeff KingMar 18, 2013
  11. Adam SpiersFeb 19, 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.