git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Get rid of cpio in git-clone (was: Re: cpio command not found)

From
EMErik Mouw <mouw@nl.linux.org>
Date
Oct 31, 2007, 20:14 UTC
Message-ID
<20071031201425.GA29332@gateway.home>
In-Reply-To
<Pine.LNX.4.64.0710311420330.4362@racer.site>
On Wed, Oct 31, 2007 at 02:20:47PM +0000, Johannes Schindelin wrote:
Show 17 quoted lines
> On Wed, 31 Oct 2007, Erik Mouw wrote:
> 
> > On Wed, Oct 31, 2007 at 02:30:39PM +0100, Karl Hasselstr?m wrote:
> > > On 2007-10-31 06:51:30 -0600, Bill Lear wrote:
> > > 
> > > > I don't remember this dependence from earlier versions of git. I 
> > > > have been running git 1.4.xx on this machine for a while...
> > > 
> > > When you clone with -l, git uses cpio to hardlink to the original 
> > > repository. What has changed is that -l is now used by default when 
> > > cloning a repository that's accessed via the file system (as opposed 
> > > to over some network protocol).
> > 
> > Why cpio? What is wrong with ln(1) (every Unix should have one) or
> > link(2) ?
> 
> Patch, please?
Here you go.

Remove dependency on cpio for git-clone. Apparently some POSIX systems out there don't have cpio, just assume cp is there.

Signed-off-by: Erik Mouw <mouw@nl.linux.org>
diff --git a/INSTALL b/INSTALL
index f1eb404..9074563 100644
--- a/INSTALL
+++ b/INSTALL
@@ -79,8 +79,7 @@ Issues of note:
 	- "perl" and POSIX-compliant shells are needed to use most of
 	  the barebone Porcelainish scripts.
 
-	- "cpio" is used by git-merge for saving and restoring the index,
-	  and by git-clone when doing a local (possibly hardlinked) clone.
+	- "cpio" is used by git-merge for saving and restoring the index.
 
  - Some platform specific issues are dealt with Makefile rules,
    but depending on your specific installation, you may not
diff --git a/git-clone.sh b/git-clone.sh
index 0ea3c24..061534c 100755
--- a/git-clone.sh
+++ b/git-clone.sh
@@ -294,7 +294,7 @@ yes)
 			fi
 		fi &&
 		cd "$repo" &&
-		find objects -depth -print | cpio -pumd$l "$GIT_DIR/" || exit 1
+		cp -Rp$l objects/ "$GIT_DIR/" || exit 1
 	fi
 	git-ls-remote "$repo" >"$GIT_DIR/CLONE_HEAD" || exit 1
 	;;
-- 
They're all fools. Don't worry. Darwin may be slow, but he'll
eventually get them. -- Matthew Lammers in alt.sysadmin.recovery
Previous: Johannes SchindelinNext: Jeff King
Message 8 of 10 in “cpio command not found”
  1. Bill LearOct 31, 2007
  2. Karl HasselströmOct 31, 2007
  3. Bill LearOct 31, 2007
  4. Allan WindOct 31, 2007
  5. David SymondsOct 31, 2007
  6. Erik MouwOct 31, 2007
  7. Johannes SchindelinOct 31, 2007
  8. Get rid of cpio in git-clone (was: Re: cpio command not found)Erik Mouw, Oct 31, 2007
  9. Jeff KingOct 31, 2007
  10. Mike HommeyOct 31, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.