git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Jonas Fonseca <fonseca@diku.dk>
Date
May 30, 2005, 16:39 UTC
Message-ID
<20050530163957.GC28681@diku.dk>
In-Reply-To
<1117466600.7072.188.camel@pegasus>
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
Previous: Marcel HoltmannNext: Jonas Fonseca
Message 2 of 3 in “Problem with cg-update and deleted files”
  1. Marcel HoltmannMay 30, 2005
  2. [PATH] cg-Xlib: Fix problem with cg-update and deleted filesJonas Fonseca, May 30, 2005
  3. Jonas FonsecaMay 30, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.