Skip to content

Getting diff in a 'raw' format #670

@jakubka

Description

@jakubka

Hi,

Is it possible to get diff as a string in the same format as git itself produces?

I.e.

diff --git a/file.txt b/file.txt
index ada066f..a252b8c 100644
--- a/file.txt
+++ b/file.txt
@@ -1,4 +1,4 @@
 line 1
-line 2
-line 3
+this is a new line
+line change 3

I am planning to fetch this string to a library which will parse it and 'colorise' it before printing it to the console. So having an option to print the diff with colors would solve the problem as well.

Thanks for the great library!

Jakub

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions