Jeff King <peff@xxxxxxxx> writes: > The simplest way (IMHO) to parse --porcelain output is: > > - maintain a mapping of commit sha1s to the commit's details > > - whenever you see a "<sha1> <line_nr> <orig_nr> [<size-of-hunk>]" > line, any key-value fields which follow impact _only_ that sha1, and > you should update the details for that map entry > > - when you see the actual tab-indented line content, you have gotten > all of the key-value updates for that sha1. You can now safely do > what you like with the line entry. Yup, that was how the output was meant to be read. At least in the mind of the person who designed the output format ;-)