dir1 has 1 file and dir2 has 2 files as below:
/tmp$ ls dir1
file1
/tmp$ cat dir1/file1
line1
line2
line3
/tmp$ ls dir2
file1 file2
/tmp$ cat dir2/file1
line1
/tmp$ cat dir2/file2
line1
/tmp$ diff -ur dir1 dir2 | diffstat
file1 | 2 --
file2 |only
2 files changed, 2 deletions(-)
I am looking for a command to print the lines in dir2 new files as insertions(+)
dir2/file2 has one line, so I am looking to print
2 files changed, 2 deletions(-), 1 insertions(+)
This question is relevant to Diff of directory statistics sumarry (git diff --stat like for non-git repo)
Thanks!