Re: [PATCH v4] json_writer: new routines to create data in JSON format

2018-06-04 Thread Jeff Hostetler
On 6/2/2018 1:13 AM, Jeff King wrote: On Sat, Jun 02, 2018 at 06:41:06AM +0200, Duy Nguyen wrote: On Mon, Mar 26, 2018 at 4:31 PM, wrote: +static inline void assert_in_array(const struct json_writer *jw) +{ + if (!jw->open_stack.len) + die("json-writer: array: missing

Re: [PATCH v4] json_writer: new routines to create data in JSON format

2018-06-01 Thread Jeff King
On Sat, Jun 02, 2018 at 06:41:06AM +0200, Duy Nguyen wrote: > On Mon, Mar 26, 2018 at 4:31 PM, wrote: > > +static inline void assert_in_array(const struct json_writer *jw) > > +{ > > + if (!jw->open_stack.len) > > + die("json-writer: array: missing jw_array_begin()"); > > Wh

Re: [PATCH v4] json_writer: new routines to create data in JSON format

2018-06-01 Thread Duy Nguyen
On Mon, Mar 26, 2018 at 4:31 PM, wrote: > +static inline void assert_in_array(const struct json_writer *jw) > +{ > + if (!jw->open_stack.len) > + die("json-writer: array: missing jw_array_begin()"); When you reroll, please consider marking all these string for translation wit

Re: [PATCH v4] json_writer: new routines to create data in JSON format

2018-03-27 Thread Junio C Hamano
"Randall S. Becker" writes: > cat <<-EOF | sed "1,\$s/_/ /g" >expect > { level1 ... > { level2 > Etc. > EOF > > Providing you don't use _ elsewhere in the output. It's a bit hacky but works. The trick is especially useful if your golden master has mixture of SP and HT, as you can write t

Re: [PATCH v4] json_writer: new routines to create data in JSON format

2018-03-27 Thread Junio C Hamano
Ramsay Jones writes: > BTW, I forgot to mention that you had some whitespace problems > with this patch, viz: > > $ git log --oneline -1 --check master-json > ab643d838 (master-json) json_writer: new routines to create data in JSON > format > t/helper/test-json-writer.c:280: trailing white

Re: [PATCH v4] json_writer: new routines to create data in JSON format

2018-03-27 Thread Ramsay Jones
On 27/03/18 18:14, Jeff Hostetler wrote: > > > On 3/27/2018 11:45 AM, Ramsay Jones wrote: >> >> >> On 27/03/18 04:18, Ramsay Jones wrote: >>> On 26/03/18 15:31, g...@jeffhostetler.com wrote: From: Jeff Hostetler >>> [snip] >>> >>> Thanks, this version fixes all issues I had (with the

RE: [PATCH v4] json_writer: new routines to create data in JSON format

2018-03-27 Thread Randall S. Becker
On March 27, 2018 1:43 PM, Wink Saville wrote: > > the leading spaces are required in this case. > > the pretty json output contains 8 spaces for that sub-structure not a tab. > > is there a preferred way to denote this in the test script? > > > > Jeff > > I've used "git diff --check" which I got

Re: [PATCH v4] json_writer: new routines to create data in JSON format

2018-03-27 Thread Wink Saville
> the leading spaces are required in this case. > the pretty json output contains 8 spaces for that sub-structure not a tab. > is there a preferred way to denote this in the test script? > > Jeff I've used "git diff --check" which I got from Documentation/SubmittingPatches. -- Wink

Re: [PATCH v4] json_writer: new routines to create data in JSON format

2018-03-27 Thread Jeff Hostetler
On 3/27/2018 11:45 AM, Ramsay Jones wrote: On 27/03/18 04:18, Ramsay Jones wrote: On 26/03/18 15:31, g...@jeffhostetler.com wrote: From: Jeff Hostetler [snip] Thanks, this version fixes all issues I had (with the compilation and sparse warnings). [Was using UINT64_C(0x)

Re: [PATCH v4] json_writer: new routines to create data in JSON format

2018-03-27 Thread Ramsay Jones
On 27/03/18 04:18, Ramsay Jones wrote: > On 26/03/18 15:31, g...@jeffhostetler.com wrote: >> From: Jeff Hostetler >> > [snip] > > Thanks, this version fixes all issues I had (with the compilation > and sparse warnings). > > [Was using UINT64_C(0x) a problem on windows?] BTW, I

Re: [PATCH v4] json_writer: new routines to create data in JSON format

2018-03-27 Thread Jeff Hostetler
On 3/26/2018 11:18 PM, Ramsay Jones wrote: On 26/03/18 15:31, g...@jeffhostetler.com wrote: From: Jeff Hostetler [snip] Thanks, this version fixes all issues I had (with the compilation and sparse warnings). [Was using UINT64_C(0x) a problem on windows?] Thanks for the co

Re: [PATCH v4] json_writer: new routines to create data in JSON format

2018-03-26 Thread Ramsay Jones
On 26/03/18 15:31, g...@jeffhostetler.com wrote: > From: Jeff Hostetler > > Add a series of jw_ routines and "struct json_writer" structure to compose > JSON data. The resulting string data can then be output by commands wanting > to support a JSON output format. > > The json-writer routines