Thread (20 messages) flat view 20 messages, 6 authors, 2016-06-15

Re: [PATCH/RFC] config: Add --null/-z option for null-delimted output

From: Frank Lichtenheld <hidden>
Date: 2016-06-15 22:43:17

On Tue, Jun 19, 2007 at 01:55:24AM +0100, Johannes Schindelin wrote:
Hi,

On Mon, 18 Jun 2007, Frank Lichtenheld wrote:
quoted
 Note the FIXME. Does anyone remember the reason why --get-regexp
 and --list use different output format?
AFAIK --list was meant as a replacement to git-var --list. Thus, it had to 
behave exactly the same.

As for the FIXME: If you have a config like this:

	[core]
		Some = where
		over
		the = core.rainbow

git-config -z would output something like this:

	core.some\0where\0core.over\0core.the\0core.rainbow\0

Right?
No. At least not with my patch. As you noted that would be
incredibly stupid and worthless. Instead we output something like

core.some\nwhere\0core.over\0core.the\ncore.rainbow\0

So you just can split on \0 and then split on \n. If there is
no \n between two \0, you have a key without value.

Gruesse,
-- 
Frank Lichtenheld [off-list ref]
www: http://www.djpig.de/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help