threads / discuss / 768

Problem with cg-update and deleted files

Subject: Problem with cg-update and deleted files

## tl;dr

3 messages between May 30, 2005 and May 30, 2005.

replies: 2people: 2as markdown or json

Marcel Holtmann· May 30, 2005, 15:23 UTC · lore
Hi Petr,

with the latest cg-update and pulling the linux-2.6 repository I saw problems with deleted files:

Applying changes...
Fast-forwarding 37e0915b701281182cea9fc90e894d10addf134a -> 5e485b7975472ba4a408523deb6541e70c451842
        on top of 37e0915b701281182cea9fc90e894d10addf134a...
rm: cannot remove `:100644 000000 057cc3f8ff378c0de881482d55b47255e3c5ea72 0000000000000000000000000000000000000000 D': No such file or directory
rm: cannot remove `:100644 000000 d1352120acd7ef7853041098bf12ae79a8ac1e0a 0000000000000000000000000000000000000000 D': No such file or directory
rm: cannot remove `:100644 000000 abdb015a4d71036eb7305e18b606151eb35fb810 0000000000000000000000000000000000000000 D': No such file or directory
rm: cannot remove `:100644 000000 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0000000000000000000000000000000000000000 D': No such file or directory
rm: cannot remove `:100644 000000 fc568af468b9482b9e09cc618d726ece226cb9db 0000000000000000000000000000000000000000 D': No such file or directory
rm: cannot remove `:100644 000000 cb90681e151cd510825dd8f7ca555ad8e0be137f 0000000000000000000000000000000000000000 D': No such file or directory
rm: cannot remove `:100644 000000 c91976274e7b007b78269e40fd8b354a4e888b86 0000000000000000000000000000000000000000 D': No such file or directory
rm: cannot remove `:100644 000000 57d03d9178f611f73079d6a83af0302f9c33dc3c 0000000000000000000000000000000000000000 D': No such file or directory
rm: cannot remove `:100644 000000 a7ffd9c45a2c272594a0be593cdaa467ce7abf5e 0000000000000000000000000000000000000000 D': No such file or directory
rm: cannot remove `:100644 000000 98fa3f7a9eff4721531ca060cee5961f7fba0100 0000000000000000000000000000000000000000 D': No such file or directory
rm: cannot remove `:100644 000000 5b2aacdefa6cb7db6d3aa87194f210d5fcb87974 0000000000000000000000000000000000000000 D': No such file or directory
rm: cannot remove `:100644 000000 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0000000000000000000000000000000000000000 D': No such file or directory
rm: cannot remove `:100644 000000 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0000000000000000000000000000000000000000 D': No such file or directory
rm: cannot remove `:100644 000000 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0000000000000000000000000000000000000000 D': No such file or directory
Regards
Marcel
Jonas Fonseca· May 30, 2005, 16:39 UTC · re: Marcel Holtmann · lore

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

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:

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>
---
I've only tested it in a small test script ...
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 -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
Jonas Fonseca· May 30, 2005, 16:43 UTC · re: Jonas Fonseca · lore

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

Jonas Fonseca <fonseca@diku.dk> wrote Mon, May 30, 2005:
Show 5 quoted lines
> 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

← back to recent threads