3 # Copyright 2015 by Jan Vales <jan@jvales.net> (Someone <someone@somenet.org>)
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, version 3 of the License.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 # Script to create diff from two selected snapshots.
20 if [ ! -d "untracked" ]; then
21 echo "cannot cd untracked. wtf? fail!"
27 if [ ! -d ".git" ]; then
28 echo "git repo not found. cannot continue."
34 echo "extracting file permission changes..."
35 git diff -U0 "$1".."$2" -- setPerms.sh > vmdiff.perms.changed.txt
37 echo "extracting changed file list..."
38 git diff --name-status "$1".."$2" -- root | sort > vmdiff.files.changed.txt
40 echo "extracting changed files..."
41 echo "setPerms.sh" > vmdiff.tar.files.txt
42 echo "vmdiff.perms.changed.txt" >> vmdiff.tar.files.txt
43 echo "vmdiff.files.changed.txt" >> vmdiff.tar.files.txt
44 echo "root" >> vmdiff.tar.files.txt
45 cat vmdiff.files.changed.txt | egrep -v "^D" | sed -e 's/^.\s\+//' >> vmdiff.tar.files.txt
48 tar -cavf vmdiff.tar.gz -T vmdiff.tar.files.txt --no-recursion