A few months ago I created scripts that can take all database module into script such as table scripts, stored procedure, views. It could get all database changes be trackable.
But this scripts has a small issues which output new blank or new line at when it works. I couldn't end up find out the root so that I created new scripts that can reset these new blank or new line. It's going to be OK if new blank and new line are removed!
Reset script is like this;
$diffs = git diff --stat-width=800 -w --ignore-blank-lines
foreach($diff in $diffs){
if($diff -match "\|\s+0"){
$diff -match "\S+"
$filename = $matches[0]
git checkout $filename
echo "Reset $filename"
}
}
git diff
can't do for several diffs at once, so I use for
to process each files.