{"thread":{"id":"324","subject":"[PATCH COGITO] Do not make cross device hard links","startedAt":"2005-04-26T07:30:14Z","lastAt":"2005-04-26T07:30:14Z","messageCount":1,"participants":["Alexey Nezhdanov"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"1721","messageId":"200504261130.15006.snake@penza-gsm.ru","threadId":"324","inReplyTo":null,"subject":"[PATCH COGITO] Do not make cross device hard links","fromName":"Alexey Nezhdanov","fromEmail":"snake@penza-gsm.ru","sentAt":"2005-04-26T07:30:14Z","receivedAt":"2005-04-26T07:30:14Z","isPatch":true,"sender":{"key":"snake@penza-gsm.ru","avatar":null},"body":"cg-clone doesn't work across devices:\n\ncd /tmp # my tmp is on seperate partition\nmkdir cg\ncd cg\ncg-clone /home/snake/cg/\n....\n`/home/snake/cg/.git/objects/85/eb3d54aeec1d0f4cf3d2de257b8d7e29816147' -> \n`.git/objects/85/eb3d54aeec1d0f4cf3d2de257b8d7e29816147'\ncp: cannot create link \n`.git/objects/85/eb3d54aeec1d0f4cf3d2de257b8d7e29816147': Invalid \ncross-device link\n-----------\n\nI have decided that problem should be solved by omitting -u flag while \nfetching in cg-pul;:\n$fetch -s -d \"$uri/objects\" \".git/objects\" || die \"rsync error\"\n\nMy variant of autodetection is probably very ugly, but it's works for me :)\n\n-- \nRespectfully\nAlexey Nezhdanov\n\n\nIndex: cg-pull\n===================================================================\n--- f262000f302b749e485f5eb971e6aabefbb85680/cg-pull  (mode:100755 sha1:5cd67519fc5399886f22e8758d6d34e0e3014cbb)\n+++ uncommitted/cg-pull  (mode:100755)\n@@ -69,11 +69,15 @@\n \tcp $cp_flags_l \"$src\" \"$dest\"\n }\n \n+u_flag=\"-u\"\n+\n if echo \"$uri\" | grep -q \":\"; then\n \tfetch=fetch_rsync\n else\n \t[ -d $uri/.git ] && uri=$uri/.git\n \tfetch=fetch_local\n+\tcp -l $uri/branches/origin .cross-device-test 2>/dev/null || u_flag=\"\"\n+\t[ -r .cross-device-test ] && rm .cross-device-test\n fi\n \n \n@@ -95,17 +99,17 @@\n [ \"$rsyncerr\" ] && die \"unable to get the head pointer of branch $rembranch\"\n \n [ -d .git/objects ] || mkdir -p .git/objects\n-$fetch -s -u -d \"$uri/objects\" \".git/objects\" || die \"rsync error\"\n+$fetch -s $u_flag -d \"$uri/objects\" \".git/objects\" || die \"rsync error\"\n \n # FIXME: Warn about conflicting tag names?\n # XXX: We now throw stderr to /dev/null since not all repositories\n # may have tags/ and users were confused by the harmless errors.\n [ -d .git/refs/tags ] || mkdir -p .git/refs/tags\n rsyncerr=\n-$fetch -s -u -d \"$uri/refs/tags\" \".git/refs/tags\" 2>/dev/null || rsyncerr=1\n+$fetch -s $u_flag -d \"$uri/refs/tags\" \".git/refs/tags\" 2>/dev/null || rsyncerr=1\n if [ \"$rsyncerr\" ]; then\n \trsyncerr=\n-\t$fetch -s -u -d \"$uri/tags\" \".git/refs/tags\" 2>/dev/null || rsyncerr=1\n+\t$fetch -s $u_flag -d \"$uri/tags\" \".git/refs/tags\" 2>/dev/null || rsyncerr=1\n fi\n [ \"$rsyncerr\" ] && echo \"unable to get tags list (non-fatal)\" >&2\n \n"}]}