On Wed, Jun 18, 2008 at 03:30:35PM -0700, Linus Torvalds wrote:Maybe it would be easier still to read (and unmeasurably more efficient) to actually do it like: if (!prefixcmp(var, "core.")) return git_default_core_config(var+5, value); ... int git_default_core_config(const char *var, const char *value) { if (!strcmp(var, "pager")) ... I was curious a while ago and instrumented git_config to write the PID to a tempfile each time it was called. Most git programs parse the config files (.git/config, ~/.gitconfig, /etc/gitconfig) three times each, with some doing it as many as five times. Most of the config functions are simply "if this key, then set this value". I wonder if it would be simpler to just load the whole thing at once, using a table similar to parseopt. Then we could do useful things like say "you specified core.foobar, but there is no such variable." I know we can't know all values, since some non-git programs put values in the config, but I don't think it's unreasonable for us to claim all of core.*, especially if it helps us catch simple configuration errors. -Peff -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
| Justin C. Sherrill | Re: pkgsrc bulk build and tiff |
| Linus Torvalds | Linux 2.6.27-rc5 |
| Ingo Molnar | [crash, bisected] Kernel BUG at ffffffff8079afb1 (__netif_schedule()) |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
git: | |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| David Miller | [GIT]: Networking |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Evgeniy Polyakov | Re: tbench wrt. loopback TSO |
