{"thread":{"id":"9375","subject":"[PATCH] git-clone: use cpio's --quiet flag","startedAt":"2007-08-04T07:03:08Z","lastAt":"2007-08-05T09:36:45Z","messageCount":9,"participants":["Jeff King","Johannes Schindelin","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"49675","messageId":"20070804070308.GA6493@coredump.intra.peff.net","threadId":"9375","inReplyTo":null,"subject":"[PATCH] git-clone: use cpio's --quiet flag","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2007-08-04T07:03:08Z","receivedAt":"2007-08-04T07:03:08Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"Without this flag, cpio prints the number of blocks copied,\nleading to the somewhat confusing git-clone output:\n\n$ git-clone foo bar\nInitialized empty Git repository in ...\n0 blocks\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\nThis is obviously on top of the jc/clone topic in next.\n\n git-clone.sh |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/git-clone.sh b/git-clone.sh\nindex 4c9b1c9..ccfc316 100755\n--- a/git-clone.sh\n+++ b/git-clone.sh\n@@ -281,7 +281,8 @@ 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\tfind objects -depth -print | cpio --quiet -pumd$l \"$GIT_DIR/\" \\\n+\t\t\t|| exit 1\n \tfi\n \tgit-ls-remote \"$repo\" >\"$GIT_DIR/CLONE_HEAD\" || exit 1\n \t;;\n-- \n1.5.3.rc3.942.g536b2\n"},{"id":"49739","messageId":"Pine.LNX.4.64.0708041636290.14781@racer.site","threadId":"9375","inReplyTo":"20070804070308.GA6493@coredump.intra.peff.net","subject":"Re: [PATCH] git-clone: use cpio's --quiet flag","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-08-04T15:36:59Z","receivedAt":"2007-08-04T15:36:59Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sat, 4 Aug 2007, Jeff King wrote:\n\n> Without this flag, cpio prints the number of blocks copied,\n> leading to the somewhat confusing git-clone output:\n> \n> $ git-clone foo bar\n> Initialized empty Git repository in ...\n> 0 blocks\n\nAccording to http://www.opengroup.org/onlinepubs/7990989775/xcu/cpio.html, \ncpio does not know about --quiet.  I think this is another GNUism...\n\nCiao,\nDscho\n"},{"id":"49745","messageId":"20070804160409.GA16326@sigill.intra.peff.net","threadId":"9375","inReplyTo":"Pine.LNX.4.64.0708041636290.14781@racer.site","subject":"Re: [PATCH] git-clone: use cpio's --quiet flag","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2007-08-04T16:04:09Z","receivedAt":"2007-08-04T16:04:09Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Aug 04, 2007 at 04:36:59PM +0100, Johannes Schindelin wrote:\n\n> > $ git-clone foo bar\n> > Initialized empty Git repository in ...\n> > 0 blocks\n> \n> According to http://www.opengroup.org/onlinepubs/7990989775/xcu/cpio.html, \n> cpio does not know about --quiet.  I think this is another GNUism...\n\nUgh, I didn't even think to check the spec, thanks for looking (I should\nhave been tipped off by the presence only of a long option).\n\nI'm not sure what the best solution is...adding --quiet makes it totally\nunportable, but that message almost looks like an error. We can redirect\nstderr, but then we potentially miss real errors. I guess we could grep\nit out.\n\n-Peff\n"},{"id":"49759","messageId":"7vwswbgphu.fsf@assigned-by-dhcp.cox.net","threadId":"9375","inReplyTo":"20070804160409.GA16326@sigill.intra.peff.net","subject":"Re: [PATCH] git-clone: use cpio's --quiet flag","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-08-04T17:48:29Z","receivedAt":"2007-08-04T17:48:29Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Sat, Aug 04, 2007 at 04:36:59PM +0100, Johannes Schindelin wrote:\n>\n>> > $ git-clone foo bar\n>> > Initialized empty Git repository in ...\n>> > 0 blocks\n>> \n>> According to http://www.opengroup.org/onlinepubs/7990989775/xcu/cpio.html, \n>> cpio does not know about --quiet.  I think this is another GNUism...\n>\n> Ugh, I didn't even think to check the spec, thanks for looking (I should\n> have been tipped off by the presence only of a long option).\n>\n> I'm not sure what the best solution is...adding --quiet makes it totally\n> unportable, but that message almost looks like an error. We can redirect\n> stderr, but then we potentially miss real errors.\n\nI was hoping that we can say that the output is analogous to the\nnative transport reporting \"Conting objects: XXXX\" and stuff...\n"},{"id":"49762","messageId":"20070804175240.GB17113@sigill.intra.peff.net","threadId":"9375","inReplyTo":"7vwswbgphu.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] git-clone: use cpio's --quiet flag","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2007-08-04T17:52:40Z","receivedAt":"2007-08-04T17:52:40Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Aug 04, 2007 at 10:48:29AM -0700, Junio C Hamano wrote:\n\n> I was hoping that we can say that the output is analogous to the\n> native transport reporting \"Conting objects: XXXX\" and stuff...\n\nIt always says \"0 blocks\" for me, which looks a bit like an error (but\nthe clone seems to work fine).\n\n-Peff\n"},{"id":"49766","messageId":"7vps23gnpj.fsf@assigned-by-dhcp.cox.net","threadId":"9375","inReplyTo":"20070804175240.GB17113@sigill.intra.peff.net","subject":"Re: [PATCH] git-clone: use cpio's --quiet flag","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-08-04T18:27:04Z","receivedAt":"2007-08-04T18:27:04Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Sat, Aug 04, 2007 at 10:48:29AM -0700, Junio C Hamano wrote:\n>\n>> I was hoping that we can say that the output is analogous to the\n>> native transport reporting \"Conting objects: XXXX\" and stuff...\n>\n> It always says \"0 blocks\" for me, which looks a bit like an error (but\n> the clone seems to work fine).\n\nTry cloning across filesystem boundaries so that you do not get\na hardlink -- you will get block count of the copy ;-)\n"},{"id":"49838","messageId":"20070805080651.GB10863@coredump.intra.peff.net","threadId":"9375","inReplyTo":"7vps23gnpj.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] git-clone: use cpio's --quiet flag","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2007-08-05T08:06:51Z","receivedAt":"2007-08-05T08:06:51Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Aug 04, 2007 at 11:27:04AM -0700, Junio C Hamano wrote:\n\n> Try cloning across filesystem boundaries so that you do not get\n> a hardlink -- you will get block count of the copy ;-)\n\nI see, though the hardlink warning is a bit much.\n\n$ git-clone /path/on/fs/one /path/on/fs/two\nInitialized empty Git repository in /path/on/fs/two/.git/\nWarning: -l asked but cannot hardlink to /path/on/fs/one/.git\n36634 blocks\n\n-Peff\n"},{"id":"49839","messageId":"7v4pjefkdu.fsf@assigned-by-dhcp.cox.net","threadId":"9375","inReplyTo":"20070805080651.GB10863@coredump.intra.peff.net","subject":"Re: [PATCH] git-clone: use cpio's --quiet flag","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-08-05T08:36:29Z","receivedAt":"2007-08-05T08:36:29Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Sat, Aug 04, 2007 at 11:27:04AM -0700, Junio C Hamano wrote:\n>\n>> Try cloning across filesystem boundaries so that you do not get\n>> a hardlink -- you will get block count of the copy ;-)\n>\n> I see, though the hardlink warning is a bit much.\n>\n> $ git-clone /path/on/fs/one /path/on/fs/two\n> Initialized empty Git repository in /path/on/fs/two/.git/\n> Warning: -l asked but cannot hardlink to /path/on/fs/one/.git\n> 36634 blocks\n\nTrue; -l is not given explicitly in your example.  Should be\ntrivial to fix.\n"},{"id":"49846","messageId":"20070805093645.GD12507@coredump.intra.peff.net","threadId":"9375","inReplyTo":"7v4pjefkdu.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] git-clone: use cpio's --quiet flag","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2007-08-05T09:36:45Z","receivedAt":"2007-08-05T09:36:45Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sun, Aug 05, 2007 at 01:36:29AM -0700, Junio C Hamano wrote:\n\n> > I see, though the hardlink warning is a bit much.\n> >\n> > $ git-clone /path/on/fs/one /path/on/fs/two\n> > Initialized empty Git repository in /path/on/fs/two/.git/\n> > Warning: -l asked but cannot hardlink to /path/on/fs/one/.git\n> > 36634 blocks\n> \n> True; -l is not given explicitly in your example.  Should be\n> trivial to fix.\n\nAh, indeed, I had assumed that it came from cpio (which also uses the -l\nflag!), but reading the code, it's us. Given that \"-l\" is now the\ndefault, and we silently downgrade to copying anyway, I don't see the\npoint of having any warning at all. Unless, I guess, for those people\nwho are still using \"-l\" even though it's a noop.\n\n-Peff\n"}]}