On Wed, 14 Apr 2010 23:16:06 +0200, Jakub Narebski <jnareb@xxxxxxxxx> wrote: > On Wed, 14 Apr 2010, Julian Phillips wrote: >> On Wed, 14 Apr 2010 21:10:35 +0200, Jakub Narebski <jnareb@xxxxxxxxx> >> wrote: >> Anyway, I have already converted blame to use the library for both >> --porcelain and --incremental output, so it'll be in the next version of >> the patch series. So you can try before you buy ... > > Nice. > > How did you managed to work with a bit non-standard rules of --porcelain > format, namely maybe-quoting of filenames, and that not all lines conform > to "<header> SP <value> LF" syntax: group definition begins with SHA-1, > and contents is indented with TAB? I had to extend the output API for quoting rules. There are now qstr/qstrf output functions that call different backend functions. The normal output then applies git quoting rules to the q versions only, whereas the JSON output treats them both the same. For the rest of it, only the actual data is going through the output_str etc functions the rest is using output_token that is ignored by the JSON backend. I actually started converting blame twice - the first time I added an API function that allowed telling the normal output how to format values, but I decided that I wanted to apply grouping to the structured output, so that e.g. the author and committer information were two objects with name, mail, date and tz members so I never finished the first attempt. -- Julian -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html