Re: [PATCH v3 2/3] config: add 'type' to config_source struct that identifies config type

2016-02-14 Thread Jeff King
On Sun, Feb 14, 2016 at 01:24:55PM +0100, Lars Schneider wrote: > > Should git_config_from_buf() take a "type" parameter, and > > git_config_from_blob_sha1() pass in "blob"? > Haha, fun fact: this was how I implemented it initially. Because of that > I noticed that "submodule-config.c" also uses "

Re: [PATCH v3 2/3] config: add 'type' to config_source struct that identifies config type

2016-02-14 Thread Lars Schneider
On 13 Feb 2016, at 22:04, Junio C Hamano wrote: > Jeff King writes: > >>> @@ -1104,6 +1106,7 @@ int git_config_from_buf(config_fn_t fn, const char >>> *name, const char *buf, >>> top.u.buf.buf = buf; >>> top.u.buf.len = len; >>> top.u.buf.pos = 0; >>> + top.type = "blob"; >>>

Re: [PATCH v3 2/3] config: add 'type' to config_source struct that identifies config type

2016-02-14 Thread Lars Schneider
On 13 Feb 2016, at 18:24, Jeff King wrote: > On Sat, Feb 13, 2016 at 03:24:15PM +0100, larsxschnei...@gmail.com wrote: > >> From: Lars Schneider >> >> Use the config type to print more detailed error messages that inform >> the user about the origin of a config error (file, stdin, blob). > >

Re: [PATCH v3 2/3] config: add 'type' to config_source struct that identifies config type

2016-02-13 Thread Junio C Hamano
Jeff King writes: >> @@ -1104,6 +1106,7 @@ int git_config_from_buf(config_fn_t fn, const char >> *name, const char *buf, >> top.u.buf.buf = buf; >> top.u.buf.len = len; >> top.u.buf.pos = 0; >> +top.type = "blob"; >> top.name = name; >> top.path = NULL; >> top.d

Re: [PATCH v3 2/3] config: add 'type' to config_source struct that identifies config type

2016-02-13 Thread Jeff King
On Sat, Feb 13, 2016 at 03:24:15PM +0100, larsxschnei...@gmail.com wrote: > From: Lars Schneider > > Use the config type to print more detailed error messages that inform > the user about the origin of a config error (file, stdin, blob). This looks OK overall. A few minor nits... > @@ -1104,6

[PATCH v3 2/3] config: add 'type' to config_source struct that identifies config type

2016-02-13 Thread larsxschneider
From: Lars Schneider Use the config type to print more detailed error messages that inform the user about the origin of a config error (file, stdin, blob). Signed-off-by: Lars Schneider --- config.c | 17 ++--- t/t1300-repo-config.sh | 8 +++- t/t1308-config-set.