Unfortunately, this is the most complicated, but it actually works with --no-index
:
git diff | awk '{if (/^diff --git/) {if (/d1\/\S*$/){display=0}else{display=1}};if (display==1) {print}}'
Each file diff git diff
performs starts with "diff --git". So...we have AWK look for that line. If it finds it, and then doesn't like it, it stops printing until it finds a diff --git
it likes.
So, the only part of the AWK statement you modify is if (/d1\/\S*$/)
This is how it filters...if this regular expression matches, it'll ignore this diff—not print it). This filters out "d1/" followed by any number of non-whitespace characters up until the end of the line (so it's looking at the 2nd filename only and not the first). For your example, you'd want the if to be:
if (/datafiles\/\S*$/ || /\.DSstore$/)
If this is too insane for you, I'd highly recommend checking out Beyond Compare which is a crazy powerful directory/file comparison tool with a nice UI.
--noindex
option. – Highpoweredgit diff
isn't a good tool for that.git log
and, at a much lower level,git rev-list
are better tools. – Symphoniousgit diff --stat
might be helpful, depending on your exact requirements. – Symphonious--no-index
– Benyamin--no-index
is explicitly asking a version control system to not use version control information--if I understand the documentation correctly. I'd compare it to using Netbeans or Visual Studio to edit text files. Nothing really wrong with it, but there might be a better tool for the job. – Highpowered