CatanaCorp / github_diff_parser

A Ruby Gem to parse unified git diff output
MIT License
6 stars 1 forks source link

Can we add an API to reconstruct the header programmatically? #12

Closed aruprakshit closed 1 week ago

aruprakshit commented 2 months ago

When we are parsing a Hunk header like this @@ -6,9 +6,11 @@ def add(string), we are only capturing previous_lino_start for e.g. -6, new_lino_start for example +6. So we are missing important information like def add(string), and total line changes like 9, 11 etc. I think the lib should add API to reconstruct the header in case someone want it.

Edouard-chin commented 3 weeks ago

That make sense. I merged https://github.com/CatanaCorp/github_diff_parser/pull/13 which should address your use case.