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

Re: [RFC PATCH] userdiff: ship built-in driver config file

From
Jeff King <peff@peff.net>
Date
Jun 19, 2019, 18:39 UTC
Message-ID
<20190619183931.GA28145@sigill.intra.peff.net>
In-Reply-To
<1da78555-96eb-1206-679b-527911f6af29@kdbg.org>
On Wed, Jun 19, 2019 at 08:30:25AM +0200, Johannes Sixt wrote:
Show 10 quoted lines
> >> Why place this file in .git? To have per-repository diff drivers, we can
> >> already specify them via 'git config'. This file should be installed in
> >> the system.
> > 
> > I think it _could_ actually just be part of the system /etc/gitconfig,
> > though it is kind of big, and Git has a tendency to parse the config
> > more than necessary. I wonder if would add a noticeable slowdown.
> 
> But /etc/gitconfig would be the wrong place, because it would not be
> updated when a new version ships with new patterns.

I was thinking it would be, but I guess there is a merging problem if the admin has made their own changes.

> I would suggest to install the file as $prefix/share/git-core/userdiff
> although the name "userdiff" sounds like an accident. How about
> .../filetypes?

Does it need to be specific to userdiff or filetypes? Could this be a generic fourth level of config: repo, user, system, builtin? We effectively already have that, except the "builtin" ones are truly baked into the binary, which means they are not visible. So right now you cannot say "git config diff.tex.xfuncname" and get any useful information, even though we clearly are going to respect it.

On the other hand, this would make "git config --list" quite a bit longer. And any solution that involves putting it into the generic config paths may suffer from the bloating/slowdown problem I mentioned.

But without that, I have to wonder what problem we are really solving. Now it's baked into the binary. Later it will be baked into the distribution, but we still don't want anybody to touch it because their changes will be overwritten. I guess it's a little easier for somebody to find .../share/git-core/userdiff and use it as a template than it is to find the definitions in the source. But it's not exactly easy.

-Peff
Previous: Junio C HamanoNext: Johannes Sixt
Message 7 of 12 in “userdiff: ship built-in driver config file”
  1. userdiff: ship built-in driver config fileBoxuan Li, Jun 17, 2019
  2. Johannes SixtJun 18, 2019
  3. Johannes SixtJun 18, 2019
  4. Jeff KingJun 19, 2019
  5. Johannes SixtJun 19, 2019
  6. Junio C HamanoJun 19, 2019
  7. Jeff KingJun 19, 2019
  8. Johannes SixtJun 20, 2019
  9. Junio C HamanoJun 19, 2019
  10. Jeff KingJun 19, 2019
  11. LI, BO XUANJun 19, 2019
  12. Jeff KingJun 19, 2019

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.