From: Jeff Hostetler Date: Thu, 20 Jun 2019 19:12:23 GMT Subject: Re: [PATCH 0/8] Add 'ls-files --json' to dump the index in json Message-ID: <1d24e390-5269-2a9a-4301-d4c462052e25@jeffhostetler.com> In-Reply-To: <20190619095858.30124-1-pclouds@gmail.com> On 6/19/2019 5:58 AM, Nguyễn Thái Ngọc Duy wrote: > This is probably just my itch. Every time I have to do something with > the index, I need to add a little bit code here, a little bit there to > get a better "view" of the index. > > This solves it for me. It allows me to see pretty much everything in the > index (except really low detail stuff like pathname compression). It's > readable by human, but also easy to parse if you need to do statistics > and stuff. You could even do a "diff" between two indexes. > > I'm not really sure if anybody else finds this useful. Because if not, > I guess there's not much point trying to merge it to git.git just for a > single user. Maintaining off tree is still a pain for me, but I think > I can manage it. > > Nguyễn Thái Ngọc Duy (8): > ls-files: add --json to dump the index > split-index.c: dump "link" extension as json > fsmonitor.c: dump "FSMN" extension as json > resolve-undo.c: dump "REUC" extension as json > read-cache.c: dump "EOIE" extension as json > read-cache.c: dump "IEOT" extension as json > cache-tree.c: dump "TREE" extension as json > dir.c: dump "UNTR" extension as json > > Documentation/git-ls-files.txt | 5 ++ > builtin/ls-files.c | 30 +++++-- > cache-tree.c | 41 ++++++++-- > cache-tree.h | 5 +- > cache.h | 2 + > dir.c | 56 ++++++++++++- > dir.h | 4 +- > fsmonitor.c | 9 +++ > json-writer.c | 30 +++++++ > json-writer.h | 29 +++++++ > read-cache.c | 139 ++++++++++++++++++++++++++++++--- > resolve-undo.c | 36 ++++++++- > resolve-undo.h | 4 +- > split-index.c | 13 ++- > 14 files changed, 376 insertions(+), 27 deletions(-) > Thanks for working on this! I've been wanting to do something like this for a while. I too am tired of digging thru hex dumps or "od" output whenever I have an odd problem to investigate. This will certainly help. Jeff