#!/bin/sh
#parameter check
# $1 is regarded as the original folder
# $2 is regarded as the latest folder
# $3 is regraded as the patch file
if [ $# -lt 3 ];then
echo "usage:$0 original_dir dest_dir patch_file"
exit -1;
fi
#variable declare
ori_dir=$1
new_dir=$2
patch_file=$3
#remove the old patch file
if [ -f ${patch_file} ];then
rm ${patch_file}
fi
#remove the "./" symbol from the file string.
ori_dir=`echo ${ori_dir} | sed s/"^\.\/"//`
new_dir=`echo ${new_dir} | sed s/"^\.\/"//`
echo "git diff --stat --binary ${ori_dir} ${new_dir} > ${patch_file}"
git diff --stat --binary ${ori_dir} ${new_dir} > ${patch_file}
echo "Finished."
echo ""
ls -lh ${patch_file}
echo ""
#!/bin/sh
#parameter check
# $1 is regarded as the original folder
# $2 is regarded as the latest folder
# $3 is regraded as the patch file
if [ $# -lt 2 ];then
echo "usage:$0 original_dir dest_dir patch_file"
exit 1;
fi
#variable declare
ori_dir=$1
new_dir=$2
if [ $# -eq 3 ];then
patch_file=$3
#remove the old patch file
if [ -f ${patch_file} ];then
rm ${patch_file}
fi
fi
#remove the "./" symbol from the file string.
ori_dir=`echo ${ori_dir} | sed s/"^\.\/"//`
new_dir=`echo ${new_dir} | sed s/"^\.\/"//`
if [ $# -eq 2 ];then
echo "git diff --stat --binary --ignore-all-space ${ori_dir} ${new_dir}:\n"
git diff --stat --binary --ignore-all-space ${ori_dir} ${new_dir}
exit 0
fi
echo "git diff --stat --binary --ignore-all-space ${ori_dir} ${new_dir} > ${patch_file}"
git diff --stat --binary --ignore-all-space ${ori_dir} ${new_dir} > ${patch_file}
echo "Finished."
echo ""
ls -lh ${patch_file}
echo ""
#!/bin/sh#parameter check# $1 is regarded as the original folder# $2 is regarded as the latest folder# $3 is regraded as the patch fileif [ $# -lt 3 ];thenecho "usage:$0 original_dir dest_dir p