Reputation: 276181
Something like which likes were modified
, added
or removed
--- a/src/app/codemirror/codeEditor.tsx
+++ b/src/app/codemirror/codeEditor.tsx
M 12
+ 72
+ 73
- 83
- 84
The basic objective is to get nice status highlights like e.g. Atom (or VsCode):
I've gone through https://git-scm.com/docs/git-diff and can't figure it out.
Upvotes: 4
Views: 2139
Reputation: 276181
The closest I have gotten is git diff -U0
i.e. Unified diff format with 0
spare lines. This generates output like:
Where each section @@ -n1,n2 +n3,n4 @@
means that previously (n1,n2
) the lines n1 to n1+n2
are now lines n3 to n3+n4
.
This means that
n2
is zero then its all addition (Use n3 to n3 + n4
to highlight)n4
is zero then its all deletion (Use n3
to higlight)n3
to highlight)Upvotes: 3