Re: [PATCH v2 01/10] ls-files: add --json to dump the index

2019-06-26 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > This --json is supposed to help that. It dumps the index in a human This and another one on the title need to become "--debug-json". Are we expecting a reroll to introduce another layer above the most primitive json writer that knows the schema used to represent

Re: [PATCH v2 01/10] ls-files: add --json to dump the index

2019-06-25 Thread Junio C Hamano
Johannes Schindelin writes: >> +echo 's/\("'$name'":\) [0-9]\+/\1 /' >>filter.sed > > This does not do what you think it does, in Ubuntu Xenial and on macOS: > > https://dev.azure.com/gitgitgadget/git/_build/results?buildId=11408&view=ms.vss-test-web.build-test-results-tab&runId=27736

Re: [PATCH v2 01/10] ls-files: add --json to dump the index

2019-06-25 Thread Jeff Hostetler
On 6/25/2019 5:52 AM, Duy Nguyen wrote: On Tue, Jun 25, 2019 at 2:15 AM Jeff Hostetler wrote: @@ -202,6 +202,28 @@ void jw_object_null(struct json_writer *jw, const char *key) strbuf_addstr(&jw->json, "null"); } +void jw_object_filemode(struct json_writer *jw, const char *key, mo

Re: [PATCH v2 01/10] ls-files: add --json to dump the index

2019-06-25 Thread Johannes Schindelin
Hi Duy, On Tue, 25 Jun 2019, Johannes Schindelin wrote: > diff --git a/t/t3011-ls-files-json.sh b/t/t3011-ls-files-json.sh > index 9f4ad4c9cf..8b782c48e0 100755 > --- a/t/t3011-ls-files-json.sh > +++ b/t/t3011-ls-files-json.sh > @@ -4,18 +4,6 @@ test_description='ls-files dumping json' > > . ./t

Re: [PATCH v2 01/10] ls-files: add --json to dump the index

2019-06-25 Thread Johannes Schindelin
Hi Duy, On Tue, 25 Jun 2019, Johannes Schindelin wrote: > On Mon, 24 Jun 2019, Nguyễn Thái Ngọc Duy wrote: > > > diff --git a/t/t3011-ls-files-json.sh b/t/t3011-ls-files-json.sh > > new file mode 100755 > > index 00..97bcd814be > > --- /dev/null > > +++ b/t/t3011-ls-files-json.sh > > @@ -

Re: [PATCH v2 01/10] ls-files: add --json to dump the index

2019-06-25 Thread Duy Nguyen
On Tue, Jun 25, 2019 at 2:15 AM Jeff Hostetler wrote: > > @@ -202,6 +202,28 @@ void jw_object_null(struct json_writer *jw, const char > > *key) > > strbuf_addstr(&jw->json, "null"); > > } > > > > +void jw_object_filemode(struct json_writer *jw, const char *key, mode_t > > mode) > > +{ >

Re: [PATCH v2 01/10] ls-files: add --json to dump the index

2019-06-25 Thread Johannes Schindelin
Hi Duy, On Mon, 24 Jun 2019, Nguyễn Thái Ngọc Duy wrote: > diff --git a/t/t3011-ls-files-json.sh b/t/t3011-ls-files-json.sh > new file mode 100755 > index 00..97bcd814be > --- /dev/null > +++ b/t/t3011-ls-files-json.sh > @@ -0,0 +1,44 @@ > +#!/bin/sh > + > +test_description='ls-files dump

Re: [PATCH v2 01/10] ls-files: add --json to dump the index

2019-06-25 Thread Johannes Schindelin
Hi Jeff, On Mon, 24 Jun 2019, Jeff Hostetler wrote: > On 6/24/2019 9:02 AM, Nguyễn Thái Ngọc Duy wrote: > [...] > > +{ > > + jw_object_inline_begin_object(jw, name); > > + jw_object_intmax(jw, "ctime_sec", sd->sd_ctime.sec); > > + jw_object_intmax(jw, "ctime_nsec", sd->sd_ctime.nsec); > > +

Re: [PATCH v2 01/10] ls-files: add --json to dump the index

2019-06-25 Thread Thomas Gummerer
On 06/24, Nguyễn Thái Ngọc Duy wrote: > So far we don't have a command to basically dump the index file out, > with all its glory details. Checking some info, for example, stat > time, usually involves either writing new code or firing up "xxd" and > decoding values by yourself. > > This --json is

Re: [PATCH v2 01/10] ls-files: add --json to dump the index

2019-06-24 Thread Junio C Hamano
Jeff Hostetler writes: > On 6/24/2019 9:02 AM, Nguyễn Thái Ngọc Duy wrote: > ... >> +void jw_object_stat_data(struct json_writer *jw, const char *name, >> + const struct stat_data *sd) > > Should this be in json_writer.c or in read-cache.c ? > Currently, json_writer.c is conce

Re: [PATCH v2 01/10] ls-files: add --json to dump the index

2019-06-24 Thread Jeff Hostetler
On 6/24/2019 9:02 AM, Nguyễn Thái Ngọc Duy wrote: So far we don't have a command to basically dump the index file out, with all its glory details. Checking some info, for example, stat time, usually involves either writing new code or firing up "xxd" and decoding values by yourself. This --js

[PATCH v2 01/10] ls-files: add --json to dump the index

2019-06-24 Thread Nguyễn Thái Ngọc Duy
So far we don't have a command to basically dump the index file out, with all its glory details. Checking some info, for example, stat time, usually involves either writing new code or firing up "xxd" and decoding values by yourself. This --json is supposed to help that. It dumps the index in a hu