Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How best to parse and display Git patch (diff) info?

I want to display Github patches, and I don't want to write my own parser. Specifically we are parsing the files.patch like in this example from the Github API docs.

I was hoping for something like Google-Code-Prettify, but extensive Googling hasn't turned anything up. Is there anything to do this?

like image 939
Fred Stevens-Smith Avatar asked Oct 08 '22 11:10

Fred Stevens-Smith


1 Answers

parse-diff (CoffeeScript as well, but shouldn't matter as it can be used in any JS context) sounds a better (more widely used, maintained) option.

like image 76
Gluck Avatar answered Oct 12 '22 20:10

Gluck