{"thread":{"id":"10538","subject":"cpio command not found","startedAt":"2007-10-31T12:51:30Z","lastAt":"2007-10-31T20:22:21Z","messageCount":10,"participants":["Bill Lear","Karl Hasselström","David Symonds","Erik Mouw","Johannes Schindelin","Allan Wind","Mike Hommey","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"57689","messageId":"18216.31314.990545.518458@lisa.zopyra.com","threadId":"10538","inReplyTo":null,"subject":"cpio command not found","fromName":"Bill Lear","fromEmail":"rael@zopyra.com","sentAt":"2007-10-31T12:51:30Z","receivedAt":"2007-10-31T12:51:30Z","isPatch":false,"sender":{"key":"rael@zopyra.com","avatar":"https://gravatar.com/avatar/c4f2d2790ca3828d3b4e7dfebabf61d2fe94fd82fa49cdac2a5295dd2d46a874?d=mp&s=160"},"body":"I just cloned the latest git and it builds ok, but fails when I clone:\n\n% uname -a\nLinux gronk.zopyra.com 2.4.9-21 #1 Thu Jan 17 14:16:30 EST 2002 i686 unknown\n\n% git --version\ngit version gitgui.0.8.4.g9c514\n\n% git clone --bare ~/my_repo\nInitialized empty Git repository in /repos/git/my_repo/\n/opt/git/bin/git-clone: line 297: cpio: command not found\n\nSo, should git not check this when it is building?  I don't remember\nthis dependence from earlier versions of git.  I have been running git\n1.4.xx on this machine for a while...\n\n\nBill\n"},{"id":"57691","messageId":"20071031133039.GA29065@diana.vm.bytemark.co.uk","threadId":"10538","inReplyTo":"18216.31314.990545.518458@lisa.zopyra.com","subject":"Re: cpio command not found","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-10-31T13:30:39Z","receivedAt":"2007-10-31T13:30:39Z","isPatch":false,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2007-10-31 06:51:30 -0600, Bill Lear wrote:\n\n> I don't remember this dependence from earlier versions of git. I\n> have been running git 1.4.xx on this machine for a while...\n\nWhen you clone with -l, git uses cpio to hardlink to the original\nrepository. What has changed is that -l is now used by default when\ncloning a repository that's accessed via the file system (as opposed\nto over some network protocol).\n\nTo work around this, specify the repository location with file://, and\ngit won't try to hardlink (and hence won't try to use cpio).\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"57694","messageId":"18216.35066.259686.376571@lisa.zopyra.com","threadId":"10538","inReplyTo":"20071031133039.GA29065@diana.vm.bytemark.co.uk","subject":"Re: cpio command not found","fromName":"Bill Lear","fromEmail":"rael@zopyra.com","sentAt":"2007-10-31T13:54:02Z","receivedAt":"2007-10-31T13:54:02Z","isPatch":false,"sender":{"key":"rael@zopyra.com","avatar":"https://gravatar.com/avatar/c4f2d2790ca3828d3b4e7dfebabf61d2fe94fd82fa49cdac2a5295dd2d46a874?d=mp&s=160"},"body":"On Wednesday, October 31, 2007 at 14:30:39 (+0100) Karl Hasselström writes:\n>On 2007-10-31 06:51:30 -0600, Bill Lear wrote:\n>\n>> I don't remember this dependence from earlier versions of git. I\n>> have been running git 1.4.xx on this machine for a while...\n>\n>When you clone with -l, git uses cpio to hardlink to the original\n>repository. What has changed is that -l is now used by default when\n>cloning a repository that's accessed via the file system (as opposed\n>to over some network protocol).\n>\n>To work around this, specify the repository location with file://, and\n>git won't try to hardlink (and hence won't try to use cpio).\n\nHmm, thanks for the workaround, but I don't altogether like leaving\nthings like this.\n\nIf the system does not have cpio, I think the build of git should\ncomplain and fail, or it should activate code that treats any\nrepository accessed over the file system as it would file://.\n\nNo sense in leaving this surprise to the user so late in the cycle.\n\n\nBill\n"},{"id":"57701","messageId":"20071031135846.GU23408@lifeintegrity.com","threadId":"10538","inReplyTo":"18216.35066.259686.376571@lisa.zopyra.com","subject":"Re: cpio command not found","fromName":"Allan Wind","fromEmail":"allan_wind@lifeintegrity.com","sentAt":"2007-10-31T13:58:46Z","receivedAt":"2007-10-31T13:58:46Z","isPatch":false,"sender":{"key":"allan_wind@lifeintegrity.com","avatar":null},"body":"On 2007-10-31T07:54:02-0600, Bill Lear wrote:\n> If the system does not have cpio, I think the build of git should\n> complain and fail, or it should activate code that treats any\n> repository accessed over the file system as it would file://.\n\ngit may be build and run on two different hosts, so while the build-time \ncheck is good there should be a run-time check as well.\n\n\n/Allan\n"},{"id":"57696","messageId":"ee77f5c20710310700jf5e4aa4waede0da924d38adc@mail.gmail.com","threadId":"10538","inReplyTo":"18216.35066.259686.376571@lisa.zopyra.com","subject":"Re: cpio command not found","fromName":"David Symonds","fromEmail":"dsymonds@gmail.com","sentAt":"2007-10-31T14:00:18Z","receivedAt":"2007-10-31T14:00:18Z","isPatch":false,"sender":{"key":"dsymonds@gmail.com","avatar":"https://gravatar.com/avatar/b22f5051cbfc11836e36cf7a690e6cde4e225d835e13295ff98d15c7a9ee3c0f?d=mp&s=160"},"body":"On 11/1/07, Bill Lear <rael@zopyra.com> wrote:\n> On Wednesday, October 31, 2007 at 14:30:39 (+0100) Karl Hasselström writes:\n> >On 2007-10-31 06:51:30 -0600, Bill Lear wrote:\n> >\n> >> I don't remember this dependence from earlier versions of git. I\n> >> have been running git 1.4.xx on this machine for a while...\n> >\n> >When you clone with -l, git uses cpio to hardlink to the original\n> >repository. What has changed is that -l is now used by default when\n> >cloning a repository that's accessed via the file system (as opposed\n> >to over some network protocol).\n> >\n> >To work around this, specify the repository location with file://, and\n> >git won't try to hardlink (and hence won't try to use cpio).\n>\n> Hmm, thanks for the workaround, but I don't altogether like leaving\n> things like this.\n>\n> If the system does not have cpio, I think the build of git should\n> complain and fail, or it should activate code that treats any\n> repository accessed over the file system as it would file://.\n\nSomething like this could be done at run-time instead. You might\ninstall cpio, but shouldn't require a rebuild of git just to use it.\n\n\nDave.\n"},{"id":"57699","messageId":"20071031140655.GA8802@gateway.home","threadId":"10538","inReplyTo":"20071031133039.GA29065@diana.vm.bytemark.co.uk","subject":"Re: cpio command not found","fromName":"Erik Mouw","fromEmail":"mouw@nl.linux.org","sentAt":"2007-10-31T14:06:55Z","receivedAt":"2007-10-31T14:06:55Z","isPatch":false,"sender":{"key":"mouw@nl.linux.org","avatar":null},"body":"On Wed, Oct 31, 2007 at 02:30:39PM +0100, Karl Hasselstr?m wrote:\n> On 2007-10-31 06:51:30 -0600, Bill Lear wrote:\n> \n> > I don't remember this dependence from earlier versions of git. I\n> > have been running git 1.4.xx on this machine for a while...\n> \n> When you clone with -l, git uses cpio to hardlink to the original\n> repository. What has changed is that -l is now used by default when\n> cloning a repository that's accessed via the file system (as opposed\n> to over some network protocol).\n\nWhy cpio? What is wrong with ln(1) (every Unix should have one) or\nlink(2) ?\n\n\nErik\n\n-- \nThey're all fools. Don't worry. Darwin may be slow, but he'll\neventually get them. -- Matthew Lammers in alt.sysadmin.recovery\n"},{"id":"57700","messageId":"Pine.LNX.4.64.0710311420330.4362@racer.site","threadId":"10538","inReplyTo":"20071031140655.GA8802@gateway.home","subject":"Re: cpio command not found","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-10-31T14:20:47Z","receivedAt":"2007-10-31T14:20:47Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 31 Oct 2007, Erik Mouw wrote:\n\n> On Wed, Oct 31, 2007 at 02:30:39PM +0100, Karl Hasselstr?m wrote:\n> > On 2007-10-31 06:51:30 -0600, Bill Lear wrote:\n> > \n> > > I don't remember this dependence from earlier versions of git. I \n> > > have been running git 1.4.xx on this machine for a while...\n> > \n> > When you clone with -l, git uses cpio to hardlink to the original \n> > repository. What has changed is that -l is now used by default when \n> > cloning a repository that's accessed via the file system (as opposed \n> > to over some network protocol).\n> \n> Why cpio? What is wrong with ln(1) (every Unix should have one) or\n> link(2) ?\n\nPatch, please?\n\nCiao,\nDscho\n"},{"id":"57720","messageId":"20071031194821.GA16215@glandium.org","threadId":"10538","inReplyTo":"20071031140655.GA8802@gateway.home","subject":"Re: cpio command not found","fromName":"Mike Hommey","fromEmail":"mh@glandium.org","sentAt":"2007-10-31T19:48:21Z","receivedAt":"2007-10-31T19:48:21Z","isPatch":false,"sender":{"key":"mh@glandium.org","avatar":"https://avatars.githubusercontent.com/u/1038527?v=4"},"body":"On Wed, Oct 31, 2007 at 03:06:55PM +0100, Erik Mouw wrote:\n> On Wed, Oct 31, 2007 at 02:30:39PM +0100, Karl Hasselstr?m wrote:\n> > On 2007-10-31 06:51:30 -0600, Bill Lear wrote:\n> > \n> > > I don't remember this dependence from earlier versions of git. I\n> > > have been running git 1.4.xx on this machine for a while...\n> > \n> > When you clone with -l, git uses cpio to hardlink to the original\n> > repository. What has changed is that -l is now used by default when\n> > cloning a repository that's accessed via the file system (as opposed\n> > to over some network protocol).\n> \n> Why cpio? What is wrong with ln(1) (every Unix should have one) or\n> link(2) ?\n\nSince git-clone is not yet a builtin, and is actually a shell script, it\nmakes more sense to use cpio than ln.\n\nMike\n"},{"id":"57725","messageId":"20071031201425.GA29332@gateway.home","threadId":"10538","inReplyTo":"Pine.LNX.4.64.0710311420330.4362@racer.site","subject":"[PATCH] Get rid of cpio in git-clone (was: Re: cpio command not found)","fromName":"Erik Mouw","fromEmail":"mouw@nl.linux.org","sentAt":"2007-10-31T20:14:25Z","receivedAt":"2007-10-31T20:14:25Z","isPatch":true,"sender":{"key":"mouw@nl.linux.org","avatar":null},"body":"On Wed, Oct 31, 2007 at 02:20:47PM +0000, Johannes Schindelin wrote:\n> On Wed, 31 Oct 2007, Erik Mouw wrote:\n> \n> > On Wed, Oct 31, 2007 at 02:30:39PM +0100, Karl Hasselstr?m wrote:\n> > > On 2007-10-31 06:51:30 -0600, Bill Lear wrote:\n> > > \n> > > > I don't remember this dependence from earlier versions of git. I \n> > > > have been running git 1.4.xx on this machine for a while...\n> > > \n> > > When you clone with -l, git uses cpio to hardlink to the original \n> > > repository. What has changed is that -l is now used by default when \n> > > cloning a repository that's accessed via the file system (as opposed \n> > > to over some network protocol).\n> > \n> > Why cpio? What is wrong with ln(1) (every Unix should have one) or\n> > link(2) ?\n> \n> Patch, please?\n\nHere you go.\n\nRemove dependency on cpio for git-clone. Apparently some POSIX systems\nout there don't have cpio, just assume cp is there.\n\nSigned-off-by: Erik Mouw <mouw@nl.linux.org>\n\ndiff --git a/INSTALL b/INSTALL\nindex f1eb404..9074563 100644\n--- a/INSTALL\n+++ b/INSTALL\n@@ -79,8 +79,7 @@ Issues of note:\n \t- \"perl\" and POSIX-compliant shells are needed to use most of\n \t  the barebone Porcelainish scripts.\n \n-\t- \"cpio\" is used by git-merge for saving and restoring the index,\n-\t  and by git-clone when doing a local (possibly hardlinked) clone.\n+\t- \"cpio\" is used by git-merge for saving and restoring the index.\n \n  - Some platform specific issues are dealt with Makefile rules,\n    but depending on your specific installation, you may not\ndiff --git a/git-clone.sh b/git-clone.sh\nindex 0ea3c24..061534c 100755\n--- a/git-clone.sh\n+++ b/git-clone.sh\n@@ -294,7 +294,7 @@ yes)\n \t\t\tfi\n \t\tfi &&\n \t\tcd \"$repo\" &&\n-\t\tfind objects -depth -print | cpio -pumd$l \"$GIT_DIR/\" || exit 1\n+\t\tcp -Rp$l objects/ \"$GIT_DIR/\" || exit 1\n \tfi\n \tgit-ls-remote \"$repo\" >\"$GIT_DIR/CLONE_HEAD\" || exit 1\n \t;;\n\n\n\n-- \nThey're all fools. Don't worry. Darwin may be slow, but he'll\neventually get them. -- Matthew Lammers in alt.sysadmin.recovery\n"},{"id":"57727","messageId":"20071031202220.GA13300@coredump.intra.peff.net","threadId":"10538","inReplyTo":"20071031201425.GA29332@gateway.home","subject":"Re: [PATCH] Get rid of cpio in git-clone (was: Re: cpio command not found)","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2007-10-31T20:22:21Z","receivedAt":"2007-10-31T20:22:21Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Oct 31, 2007 at 09:14:25PM +0100, Erik Mouw wrote:\n\n> > Patch, please?\n> \n> Here you go.\n\nGood, now we have something to critique. :)\n\n> -\t\tfind objects -depth -print | cpio -pumd$l \"$GIT_DIR/\" || exit 1\n> +\t\tcp -Rp$l objects/ \"$GIT_DIR/\" || exit 1\n\ncp -l isn't even close to portable. It's not in POSIX, and doesn't work\non (at least) Solaris.\n\nI think Mike's patch (cpio if available, copy otherwise) is a reasonable\napproach. If there are other methods (and I think cp -l is not\nunreasonable for systems where it is supported and cpio is unavailable),\nthen perhaps it is worth trying them one by one and dropping back to\nfull copy if all fail.\n\n-Peff\n"}]}