Re: [PATCH/RFC] config: Add --null/-z option for null-delimted output
- From
Frank Lichtenheld <frank@lichtenheld.de>
- Date
- Jun 19, 2007, 01:17 UTC
- Message-ID
- <20070619011734.GD19725@planck.djpig.de>
- In-Reply-To
- <Pine.LNX.4.64.0706190151160.4059@racer.site>
On Tue, Jun 19, 2007 at 01:55:24AM +0100, Johannes Schindelin wrote:
Show 22 quoted lines
> Hi, > > On Mon, 18 Jun 2007, Frank Lichtenheld wrote: > > > 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 <frank@lichtenheld.de> www: http://www.djpig.de/