On Sat, Jun 22, 2019 at 6:31 AM brian m. carlson <sandals@xxxxxxxxxxxxxxxxxxxx> wrote: > > On 2019-06-19 at 09:58:50, 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. > > I'm generally in favor of this, but we need to document what this does > when it encounters paths that are not valid UTF-8. (Ideally, the answer > is, "die()", but I suspect the answer will be "silently produce invalid > output".) I think you're right, we don't assume anything when writing json strings, so it's not going to be utf-8 (or die) if the path is also not valid utf-8. The good thing is all this could be done in just one place, append_quoted_string(), if someone needs too. I'll just go document the fact that we may produce invalid UTF-8. -- Duy