# [PATCH] Silence cpio's "N blocks" output when cloning locally

6 messages from 2008-03-28 to 2008-03-31. Participants: Bryan Donlan, Johannes Schindelin, Wincent Colaiuta, Junio C Hamano.
Thread: https://gitlist.dev/t/12896

## Bryan Donlan, 2008-03-28 06:19

Subject: [PATCH] Silence cpio's "N blocks" output when cloning locally
Message-ID: <1206685186-10352-1-git-send-email-bdonlan@fushizen.net>
URL: https://gitlist.dev/e/1206685186-10352-1-git-send-email-bdonlan%40fushizen.net

```
Pass --quiet to cpio in git-clone to hide the (confusing) "0 blocks" message.
For compatibility with operating systems which might not support GNUisms,
the presence of --quiet is probed for by grepping cpio's --help output.

Signed-off-by: Bryan Donlan <bdonlan@fushizen.net>
---
 git-clone.sh |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/git-clone.sh b/git-clone.sh
index e981122..2636159 100755
--- a/git-clone.sh
+++ b/git-clone.sh
@@ -310,6 +310,9 @@ yes)
 		mkdir -p "$GIT_DIR/objects/info"
 		echo "$repo/objects" >>"$GIT_DIR/objects/info/alternates"
 	else
+		cpio_quiet_flag=""
+		cpio --help 2>&1 | grep -- --quiet >/dev/null && \
+			cpio_quiet_flag=--quiet
 		l= &&
 		if test "$use_local_hardlink" = yes
 		then
@@ -330,7 +333,8 @@ yes)
 			fi
 		fi &&
 		cd "$repo" &&
-		find objects -depth -print | cpio -pumd$l "$GIT_DIR/" || exit 1
+		find objects -depth -print | cpio $cpio_quiet_flag -pumd$l "$GIT_DIR/" || \
+			exit 1
 	fi
 	git-ls-remote "$repo" >"$GIT_DIR/CLONE_HEAD" || exit 1
 	;;
-- 
1.5.4.3

```

## Johannes Schindelin, 2008-03-28 13:01

Subject: Re: [PATCH] Silence cpio's "N blocks" output when cloning locally
Message-ID: <alpine.LSU.1.00.0803281400330.18259@racer.site>
URL: https://gitlist.dev/e/alpine.LSU.1.00.0803281400330.18259%40racer.site
In-Reply-To: <1206685186-10352-1-git-send-email-bdonlan@fushizen.net>

```
Hi,

On Fri, 28 Mar 2008, Bryan Donlan wrote:

> Pass --quiet to cpio in git-clone to hide the (confusing) "0 blocks" 
> message. For compatibility with operating systems which might not 
> support GNUisms, the presence of --quiet is probed for by grepping 
> cpio's --help output.

We have a builtin clone which is almost ready for 'next', and I think that 
this issue would be resolved there anyway.

Ciao,
Dscho

```

## Wincent Colaiuta, 2008-03-28 16:12

Subject: Re: [PATCH] Silence cpio's "N blocks" output when cloning locally
Message-ID: <2145F4A8-7C6E-4AE9-A531-026DC65417BE@wincent.com>
URL: https://gitlist.dev/e/2145F4A8-7C6E-4AE9-A531-026DC65417BE%40wincent.com
In-Reply-To: <alpine.LSU.1.00.0803281400330.18259@racer.site>

```
El 28/3/2008, a las 14:01, Johannes Schindelin escribió:

> On Fri, 28 Mar 2008, Bryan Donlan wrote:
>
>> Pass --quiet to cpio in git-clone to hide the (confusing) "0 blocks"
>> message. For compatibility with operating systems which might not
>> support GNUisms, the presence of --quiet is probed for by grepping
>> cpio's --help output.
>
> We have a builtin clone which is almost ready for 'next', and I  
> think that
> this issue would be resolved there anyway.

In any case, I'd rather see the cpio check at configure-time rather  
than run-time.

Cheers,
Wincent

```

## Johannes Schindelin, 2008-03-28 16:29

Subject: Re: [PATCH] Silence cpio's "N blocks" output when cloning locally
Message-ID: <alpine.LSU.1.00.0803281728530.18259@racer.site>
URL: https://gitlist.dev/e/alpine.LSU.1.00.0803281728530.18259%40racer.site
In-Reply-To: <2145F4A8-7C6E-4AE9-A531-026DC65417BE@wincent.com>

```
Hi,

On Fri, 28 Mar 2008, Wincent Colaiuta wrote:

> El 28/3/2008, a las 14:01, Johannes Schindelin escribió:
> 
> >On Fri, 28 Mar 2008, Bryan Donlan wrote:
> >
> > >Pass --quiet to cpio in git-clone to hide the (confusing) "0 blocks" 
> > >message. For compatibility with operating systems which might not 
> > >support GNUisms, the presence of --quiet is probed for by grepping 
> > >cpio's --help output.
> >
> >We have a builtin clone which is almost ready for 'next', and I think 
> >that this issue would be resolved there anyway.
> 
> In any case, I'd rather see the cpio check at configure-time rather than 
> run-time.

That would have to be done via ./configure, missing out those people who 
do not run ./configure, but just make.

Ciao,
Dscho

```

## Bryan Donlan, 2008-03-28 18:59

Subject: Re: [PATCH] Silence cpio's "N blocks" output when cloning locally
Message-ID: <3e8340490803281159t2ecdcdd6rea502331dcf04457@mail.gmail.com>
URL: https://gitlist.dev/e/3e8340490803281159t2ecdcdd6rea502331dcf04457%40mail.gmail.com
In-Reply-To: <alpine.LSU.1.00.0803281728530.18259@racer.site>

```
On Fri, Mar 28, 2008 at 12:29 PM, Johannes Schindelin
<Johannes.Schindelin@gmx.de> wrote:
> Hi,
>
>
>  On Fri, 28 Mar 2008, Wincent Colaiuta wrote:
>
>  > El 28/3/2008, a las 14:01, Johannes Schindelin escribió:
>  >
>  > >On Fri, 28 Mar 2008, Bryan Donlan wrote:
>  > >
>  > > >Pass --quiet to cpio in git-clone to hide the (confusing) "0 blocks"
>  > > >message. For compatibility with operating systems which might not
>  > > >support GNUisms, the presence of --quiet is probed for by grepping
>  > > >cpio's --help output.
>  > >
>  > >We have a builtin clone which is almost ready for 'next', and I think
>  > >that this issue would be resolved there anyway.
>  >
>  > In any case, I'd rather see the cpio check at configure-time rather than
>  > run-time.
>
>  That would have to be done via ./configure, missing out those people who
>  do not run ./configure, but just make.

Some distributions don't run configure either, including debian (and
by extension, likely ubuntu). That said, if git-clone's going builtin
anyway, we might as well wait for that :)

```

## Junio C Hamano, 2008-03-31 00:19

Subject: Re: [PATCH] Silence cpio's "N blocks" output when cloning locally
Message-ID: <7v1w5rwxs7.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7v1w5rwxs7.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <alpine.LSU.1.00.0803281728530.18259@racer.site>

```
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> On Fri, 28 Mar 2008, Wincent Colaiuta wrote:
>
>> El 28/3/2008, a las 14:01, Johannes Schindelin escribió:
>> 
>> >On Fri, 28 Mar 2008, Bryan Donlan wrote:
>> >
>> > >Pass --quiet to cpio in git-clone to hide the (confusing) "0 blocks" 
>> > >message. For compatibility with operating systems which might not 
>> > >support GNUisms, the presence of --quiet is probed for by grepping 
>> > >cpio's --help output.
>> >
>> >We have a builtin clone which is almost ready for 'next', and I think 
>> >that this issue would be resolved there anyway.
>> 
>> In any case, I'd rather see the cpio check at configure-time rather than 
>> run-time.
>
> That would have to be done via ./configure, missing out those people who 
> do not run ./configure, but just make.

Runtime is just fine for this case.  Unlike other commands, clone is not
something you run all the time.  Anything more elaborate is just
overengineered.

```
