Thread (25 messages) flat view 25 messages, 5 authors, 2016-06-15

Re: [PATCH v4 3/3] config: add '--show-origin' option to print the origin of a config value

From: Jeff King <hidden>
Date: 2016-06-15 23:08:16

On Tue, Feb 16, 2016 at 10:14:45PM +0000, Ramsay Jones wrote:
quoted
I think it's more than that one-liner. This patch shows "type:name"
verbatim from what is passed into do_config_from_file, as does the error
message. If they are going to have different output formats (e.g.,
"<stdin>" versus "stdin"), there needs to be logic transforming them in
at least one of the spots.
Ugh, yes you are right.

Hmm, I just hacked something up (see below) and, since its a bit
ugly, I'm now in two minds! (it could be improved, of course). ;-)

So, I'll leave it to yourself and Lars to decide.
[...]
+	if (!strcmp(cftype, "stdin")) {
+		cftype = "file";
+		cfname = "<stdin>";
+	}
I think if we go this route it would be cleaner to just make "type" an
enum and convert it to the appropriate string in the callers. But other
than that, I think your patch is along the correct lines.

I dunno. Personally I am fine with the change in error messages done by
Lars. I could go either way.

-Peff

PS Thanks also for your patch fixing the prototypes. I completely missed
   that.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help