Is it possible to operate on git diff
output in case I wanted to script around it and edit the actual new/updated line of code?
Say I have file 'foo' tracked by git
foo:
line 1
line 2
line 3
line 4
I edit it (adding '(edit)' to line 3) and
git diff foo
gives me
workspace@workspace:~/gitRepo/$ git diff foo
diff --git a/foo b/foo
index 9c2a709..30fb870 100644
--- a/foo
+++ b/foo
@@ -1,4 +1,4 @@
line 1
line 2
-line 3
+line 3 (edit)
line 4
And I want to be able to run git diff | scriptThatAddsBarToNewStrings
which would edit foo such that
cat foo
would render
line 1
line 2
line 3 (edit)bar
line 4
Is that something that can conceivably be done?