git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] update cogito cg-diff to use new git diff format
@ 2005-05-25 19:38 McMullan, Jason
  0 siblings, 0 replies; only message in thread
From: McMullan, Jason @ 2005-05-25 19:38 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 1552 bytes --]

Updates cg-Xdiffdo to handle the new cg-diff-* output format

(Not strictly necessary, since git-diff-* -p is better anyway, but if
someone is relying on cg-* Porcelain....)

Signed-Off-By: Jason McMullan <jason.mcmullan@timesys.com>

Index: cg-Xdiffdo
===================================================================
--- be7e79d03a25ad69405c8e17c024f0c83a9d16cd/cg-Xdiffdo  (mode:100755)
+++ uncommitted/cg-Xdiffdo  (mode:100755)
@@ -48,13 +48,13 @@
 
 while [ "$1" ]; do
 	declare -a param
-	param=($1);
-	op=${param[0]:0:1}
-	mode=${param[0]:1}
-	type=${param[1]}
-	sha=${param[2]}
-	name=${param[3]}
+	param=($1 $2);
+	mode=${param[0]:1}"->"${param[1]}
+	sha=${param[2]}"->"${param[3]}
+	op=${param[4]}
+	name=${param[5]}
 
+	type=`git-cat-file -t $sha`
 	if [ "$filter" ] && (echo "$name" | grep -vqxFf $filter); then
 		shift; continue
 	fi
@@ -72,15 +72,15 @@
 	([ -d "$dir1" ] && [ -d "$dir2" ]) || mkdir -p "$dir1" "$dir2"
 
 	case $op in
-	"+")
+	"A")
 		mkbanner "$loc2" $id2 "$name" $mode $sha
 		diff -L "/dev/null  (tree:$id1)" -L "$label" -u /dev/null "$loc2"
 		;;
-	"-")
+	"D")
 		mkbanner "$loc1" $id1 "$name" $mode $sha
 		diff -L "$label" -L "/dev/null  (tree:$id2)" -u "$loc1" /dev/null
 		;;
-	"*")
+	"M")
 		modes=(${mode/->/ });
 		mode1=${modes[0]}; mode2=${modes[1]}
 		shas=(${sha/->/ });
@@ -94,7 +94,7 @@
 	esac
 
 	#rm -f "$loc1" "$loc2"
-	shift
+	shift 2
 done
 
 rm -rf "$diffdir"


-- 
Jason McMullan <jason.mcmullan@timesys.com>
TimeSys Corporation


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-05-25 19:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-25 19:38 [PATCH] update cogito cg-diff to use new git diff format McMullan, Jason

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).