Question: Is there a way to generate back raw Unified Diff from UnifiedDiff object?
challarao opened this issue · comments
I'm experimenting this library for one of my use cases. I have a git patch that I parse with #parseUnifiedDiff. Is there a way to get raw unified diff back from UnifiedDiff object? I see there is a generateUnifiedDiff method that requires original lines.
My requirement is to try and get raw Unified Diff for each individual file from git patch. I can of course use the metadata from UnifiedDiff object and and hand code it myself. Just wondering if there is an existing way out of the lib.
This can be rephrased as splitting per file Unified Diff out of git patch.
I am not quite sure if I understand you right. Isn't UnifiedDiffWriterl.write
what you want? However, you are using the new implementation of this unified diff processing and the writer is not yet complete, so if you have problems lets improve it.