From f44585dd2105a120b3255d6789f636751c3e78e4 Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Sun, 24 Sep 2006 20:26:28 +0200 Subject: [PATCH] cg-diff: cleanup -s to not invoke git-apply but use diff machinery Signed-off-by: Jonas Fonseca --- cg-diff | 10 ++++------ 1 files changed, 4 insertions(+), 6 deletions(-) diff --git a/cg-diff b/cg-diff index 5129760..abdf7cd 100755 --- a/cg-diff +++ b/cg-diff @@ -102,9 +102,7 @@ setup_colors() colorize() { - if [ "$opt_summary" ]; then - git-apply --summary --stat - elif [ "$opt_color" ]; then + if [ "$opt_color" ]; then sed -e ' s/^diff --git.*/'$coldiffhdr'&'$coldefault'/ s/^+++.*/'$coldiffhdradd'&'$coldefault'/ @@ -129,7 +127,7 @@ diffcore= parent= opt_color= mergebase= -opt_summary= +style=-p renames=-M while optparse; do @@ -143,7 +141,7 @@ while optparse; do elif optparse -R || optparse --no-renames; then renames= elif optparse -s; then - opt_summary=1 + style="--stat" elif optparse -r=; then if echo "$OPTARG" | fgrep -q '..'; then id2="${OPTARG#*..}" @@ -226,7 +224,7 @@ fi # FIXME: Update ret based on what did we match. And take "$@" # to account after all. #ret= -$diffprog -r -p $renames $diffcore "${diffargs[@]}" | colorize | pager +$diffprog -r $renames $diffcore $style "${diffargs[@]}" | colorize | pager #[ "$ret" ] && die "no files matched" #exit $ret exit 0 -- 1.4.2.1.gca4e