Re: [PATCH] Get rid of cpio in git-clone (was: Re: cpio command not found)
- From
Jeff King <peff@peff.net>
- Date
- Oct 31, 2007, 20:22 UTC
- Message-ID
- <20071031202220.GA13300@coredump.intra.peff.net>
- In-Reply-To
- <20071031201425.GA29332@gateway.home>
On Wed, Oct 31, 2007 at 09:14:25PM +0100, Erik Mouw wrote:
> > Patch, please? > > Here you go.
Good, now we have something to critique. :)
> - find objects -depth -print | cpio -pumd$l "$GIT_DIR/" || exit 1 > + cp -Rp$l objects/ "$GIT_DIR/" || exit 1
cp -l isn't even close to portable. It's not in POSIX, and doesn't work on (at least) Solaris.
I think Mike's patch (cpio if available, copy otherwise) is a reasonable approach. If there are other methods (and I think cp -l is not unreasonable for systems where it is supported and cpio is unavailable), then perhaps it is worth trying them one by one and dropping back to full copy if all fail.
-Peff