git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Alexey Nezhdanov <snake@penza-gsm.ru>
To: git@vger.kernel.org
Subject: [PATCH COGITO] Do not make cross device hard links
Date: Tue, 26 Apr 2005 11:30:14 +0400	[thread overview]
Message-ID: <200504261130.15006.snake@penza-gsm.ru> (raw)

[-- Attachment #1: Type: text/plain, Size: 650 bytes --]

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

[-- Attachment #2: do-not-link-cross-device.patch --]
[-- Type: text/x-diff, Size: 1509 bytes --]

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
 

                 reply	other threads:[~2005-04-26  7:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200504261130.15006.snake@penza-gsm.ru \
    --to=snake@penza-gsm.ru \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).