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

2019-06-20 Thread Johannes Sixt
Am 19.06.19 um 20:39 schrieb Jeff King: > But without that, I have to wonder what problem we are really solving. You have a point here. > 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 ove

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

2019-06-19 Thread Jeff King
On Wed, Jun 19, 2019 at 11:32:19PM +0800, LI, BO XUAN wrote: > > [diff "foo"] > > xfuncname = "the pattern starts here... > > and continues through newlines!" > > > > If I recall correctly, the above version wouldn't work, but the > following version would: > > [diff "foo"] > xfuncname

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

2019-06-19 Thread Jeff King
On Wed, Jun 19, 2019 at 08:30:25AM +0200, Johannes Sixt wrote: > >> 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

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

2019-06-19 Thread LI, BO XUAN
On Wed, Jun 19, 2019 at 11:58 AM Jeff King wrote: > > While having separate lines that get joined here does make the result > easier to read, I think it creates some confusion. diff.*.xfuncname in a > regular config file _doesn't_ behave this way (it's the usual > last-one-wins, so we expect a sin

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

2019-06-19 Thread Junio C Hamano
Johannes Sixt writes: > But /etc/gitconfig would be the wrong place, because it would not be > updated when a new version ships with new patterns. > > I would suggest to install the file as $prefix/share/git-core/userdiff > although the name "userdiff" sounds like an accident. How about > .../fil

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

2019-06-19 Thread Junio C Hamano
Jeff King writes: > 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. Yeah, that was what I was wondering too when somebody made a casua

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

2019-06-18 Thread Johannes Sixt
Am 19.06.19 um 05:49 schrieb Jeff King: > On Tue, Jun 18, 2019 at 10:32:47PM +0200, Johannes Sixt wrote: > >> Am 17.06.19 um 18:54 schrieb Boxuan Li: >>> diff --git a/templates/this--userdiff b/templates/this--userdiff >>> new file mode 100644 >>> index 00..85114a7229 >>> --- /dev/null >>>

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

2019-06-18 Thread Jeff King
On Tue, Jun 18, 2019 at 12:54:50AM +0800, Boxuan Li wrote: > A few notes and questions: > 1. In [diff "tex"] section, \x80 and \xff cannot be parsed by git config > parser. > I have no idea why this is happening. I changed them to \\x80 and \\xff as a > workaround, which > resulted in t4034 fail

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

2019-06-18 Thread Jeff King
On Tue, Jun 18, 2019 at 10:32:47PM +0200, Johannes Sixt wrote: > Am 17.06.19 um 18:54 schrieb Boxuan Li: > > The userdiff.c has been rewritten to avoid hard-coded built-in > > driver patterns. Now we ship > > $(sharedir)/git-core/templates/userdiff that can be read using > > git_config_from_file()

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

2019-06-18 Thread Johannes Sixt
Am 18.06.19 um 22:32 schrieb Johannes Sixt: > Am 17.06.19 um 18:54 schrieb Boxuan Li: >> The userdiff.c has been rewritten to avoid hard-coded built-in >> driver patterns. Now we ship >> $(sharedir)/git-core/templates/userdiff that can be read using >> git_config_from_file() interface, using a very

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

2019-06-18 Thread Johannes Sixt
Am 17.06.19 um 18:54 schrieb Boxuan Li: > The userdiff.c has been rewritten to avoid hard-coded built-in > driver patterns. Now we ship > $(sharedir)/git-core/templates/userdiff that can be read using > git_config_from_file() interface, using a very narrow callback > function that understands only

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

2019-06-17 Thread Boxuan Li
The userdiff.c has been rewritten to avoid hard-coded built-in driver patterns. Now we ship $(sharedir)/git-core/templates/userdiff that can be read using git_config_from_file() interface, using a very narrow callback function that understands only diff.*.xfuncname, diff.*.wordregex, and diff.*.reg