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

[PATCH COGITO] Do not make cross device hard links

From
ANAlexey Nezhdanov <snake@penza-gsm.ru>
Date
Apr 26, 2005, 07:30 UTC
Message-ID
<200504261130.15006.snake@penza-gsm.ru>
cg-clone doesn't work across devices:

cd /tmp # my tmp is on seperate partition mkdir cg cd cg cg-clone /home/snake/cg/ .... `/home/snake/cg/.git/objects/85/eb3d54aeec1d0f4cf3d2de257b8d7e29816147' -> `.git/objects/85/eb3d54aeec1d0f4cf3d2de257b8d7e29816147' cp: cannot create link `.git/objects/85/eb3d54aeec1d0f4cf3d2de257b8d7e29816147': Invalid cross-device link -----------

I have decided that problem should be solved by omitting -u flag while fetching in cg-pul;: $fetch -s -d "$uri/objects" ".git/objects" || die "rsync error"

My variant of autodetection is probably very ugly, but it's works for me :)
-- 
Respectfully
Alexey Nezhdanov


Index: cg-pull
===================================================================
--- f262000f302b749e485f5eb971e6aabefbb85680/cg-pull  (mode:100755 sha1:5cd67519fc5399886f22e8758d6d34e0e3014cbb)
+++ uncommitted/cg-pull  (mode:100755)
@@ -69,11 +69,15 @@
 	cp $cp_flags_l "$src" "$dest"
 }
 
+u_flag="-u"
+
 if echo "$uri" | grep -q ":"; then
 	fetch=fetch_rsync
 else
 	[ -d $uri/.git ] && uri=$uri/.git
 	fetch=fetch_local
+	cp -l $uri/branches/origin .cross-device-test 2>/dev/null || u_flag=""
+	[ -r .cross-device-test ] && rm .cross-device-test
 fi
 
 
@@ -95,17 +99,17 @@
 [ "$rsyncerr" ] && die "unable to get the head pointer of branch $rembranch"
 
 [ -d .git/objects ] || mkdir -p .git/objects
-$fetch -s -u -d "$uri/objects" ".git/objects" || die "rsync error"
+$fetch -s $u_flag -d "$uri/objects" ".git/objects" || die "rsync error"
 
 # FIXME: Warn about conflicting tag names?
 # XXX: We now throw stderr to /dev/null since not all repositories
 # may have tags/ and users were confused by the harmless errors.
 [ -d .git/refs/tags ] || mkdir -p .git/refs/tags
 rsyncerr=
-$fetch -s -u -d "$uri/refs/tags" ".git/refs/tags" 2>/dev/null || rsyncerr=1
+$fetch -s $u_flag -d "$uri/refs/tags" ".git/refs/tags" 2>/dev/null || rsyncerr=1
 if [ "$rsyncerr" ]; then
 	rsyncerr=
-	$fetch -s -u -d "$uri/tags" ".git/refs/tags" 2>/dev/null || rsyncerr=1
+	$fetch -s $u_flag -d "$uri/tags" ".git/refs/tags" 2>/dev/null || rsyncerr=1
 fi
 [ "$rsyncerr" ] && echo "unable to get tags list (non-fatal)" >&2
 
Message 1 of 1 in “Do not make cross device hard links”
  1. Do not make cross device hard linksAlexey Nezhdanov, Apr 26, 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.