Re: [PATH] cg-Xlib: Fix problem with cg-update and deleted files

From: Jonas Fonseca <fonseca@diku.dk>
Date: 2005-05-31 02:43:39
Jonas Fonseca <fonseca@diku.dk> wrote Mon, May 30, 2005:
> Marcel Holtmann <marcel@holtmann.org> wrote Mon, May 30, 2005:
> > with the latest cg-update and pulling the linux-2.6 repository I saw
> > problems with deleted files:
> 
> I've only tested it in a small test script ...

... which of course is no the best thing. Here's one with -z option.

Update tree_timewarp()s git-diff-tree logic to handle the diff-format
header and file both being NUL separated.

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
---

diff --git a/cg-Xlib b/cg-Xlib
--- a/cg-Xlib
+++ b/cg-Xlib
@@ -73,10 +73,15 @@ tree_timewarp () {
 	echo "$branch" > $_git/HEAD
 
 	# Kill gone files
-	git-diff-tree -z -r $base $branch | egrep -z '^:([^ ][^ ]* ){4}D' | xargs -0 bash -c '
+	git-diff-tree -z -r $base $branch | xargs -0 bash -c '
 		while [ "$1" ]; do
-			rm -- "$(echo "$1" | cut -f 2)"
-			shift
+			header="$1"; shift
+			file="$1"; shift
+
+			# match ":100755 000000 14d43b1abf... 000000000... D"
+			if echo "$header" | egrep "^:([^ ][^ ]* ){4}D" >/dev/null; then
+				rm -- "$file"
+			fi
 		done
 	' padding
 	git-checkout-cache -f -a
-- 
Jonas Fonseca
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Tue May 31 02:43:49 2005

This archive was generated by hypermail 2.1.8 : 2005-05-31 02:43:49 EST