{"thread":{"id":"784","subject":"[PATCH] cg-clone fails to clone tags","startedAt":"2005-06-01T01:58:35Z","lastAt":"2005-06-01T01:58:35Z","messageCount":1,"participants":["Miguel Bazdresch"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"4335","messageId":"20050601015835.GA11507@localhost.domain.invalid","threadId":"784","inReplyTo":null,"subject":"[PATCH] cg-clone fails to clone tags","fromName":"Miguel Bazdresch","fromEmail":"git-01@thewizardstower.org","sentAt":"2005-06-01T01:58:35Z","receivedAt":"2005-06-01T01:58:35Z","isPatch":true,"sender":{"key":"git-01@thewizardstower.org","avatar":null},"body":"Hi,\n\nI noticed that cg-clone fails to clone tags when the source and\ndestination directories are on different filesystems (this is on a local\nclone). The command produces warnings of the type:\n\ncp: cannot create link `.git/refs/tags/git-pasky-0.6.2': Invalid cross-device link\n`/home/miguel/bin/cogito/.git/refs/tags/git-pasky-0.6.3' -> `.git/refs/tags/git-pasky-0.6.3'\n\nI think the culprit is the \"l\" flag passed to cp in fetch-local() in\nscript cg-pull. After thinking a bit on how to solve this, I decided on\na \"blunt force\" approach, where the cp is done twice, once with \"l\" and\nonce without it. Only when both fail is a warning issued about the\nfailure to get the tag list.\n\nThis has the unfortunate side effect of also removing the \"u\" flag to\ncp, but I don't think it's a big deal (cg-pull adds the \"l\" and \"u\"\nflags at the same time).\n\nFollowing is the output of cg-mkpatch:\n\n---\n\nCurrently, cg-clone fails to clone the tag list if the destination\nand source directory are in different filesystem. This caused by the\n\"l\" flag used by fetch_local.\n\nThis patch tries the copy without the \"l\" flag if it fails with it.\n\nSigned-off-by: Miguel Bazdresch <miguelb@ieee.org>\n\n---\ncommit 5823514635ca67be41914d9294081353b70272a4\ntree 19092122a45366f46b7f140d411f875000ff2ba7\nparent 20e473c9afd8b5d2d549b0e7881473600beb9c37\nauthor Miguel Bazdresch <miguelb@ieee.org> Tue, 31 May 2005 20:23:44\n-0500\ncommitter Miguel Bazdresch <miguelb@ieee.org> Tue, 31 May 2005 20:23:44\n-0500\n\n cg-pull |   10 +++++++++-\n 1 files changed, 9 insertions(+), 1 deletions(-)\n\ndiff --git a/cg-pull b/cg-pull\n--- a/cg-pull\n+++ b/cg-pull\n@@ -259,8 +259,16 @@ rsyncerr=\n $fetch -i -s -u -d \"$uri/refs/tags\" \"$_git/refs/tags\" || rsyncerr=1\n if [ \"$rsyncerr\" ]; then\n rsyncerr=\n-\t$fetch -i -s -u -d \"$uri/tags\" \"$_git/refs/tags\" || rsyncerr=1\n+\t$fetch -i -s -d \"$uri/refs/tags\" \"$_git/refs/tags\" || rsyncerr=1\n fi\n+if [ \"$rsyncerr\" ]; then\n+rsyncerr=\n+\t$fetch -i -s -u -d \"$uri/tags\" \"$_git/refs/tags\" || rsyncerr=1\n+fi\n+if [ \"$rsyncerr\" ]; then\n+rsyncerr=\n+\t$fetch -i -s -d \"$uri/tags\" \"$_git/refs/tags\" || rsyncerr=1\n+fi\n [ \"$rsyncerr\" ] && echo \"unable to get tags list (non-fatal)\" >&2\n"}]}