I need hunks (lines added and deleted) with context so I used git diff -u to obtain a diff. I can do line.is_added to to obtain lines_added but those line will not include lines of context. How do I parse this diff to get lines_added and lines deleted along with some lines of context. Right now I have
Line 1
......
Line 5
- Line 6
+ Line 7
......
Line n
Essentially I want
lines_deleted = context lines, Line 6, more context lines and
lines_added = context lines , Line 7, more context lines