git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Silence cpio's "N blocks" output when cloning locally
@ 2008-03-28  6:19 Bryan Donlan
  2008-03-28 13:01 ` Johannes Schindelin
  0 siblings, 1 reply; 6+ messages in thread
From: Bryan Donlan @ 2008-03-28  6:19 UTC (permalink / raw)
  To: git; +Cc: gitster, Bryan Donlan

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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-03-31  0:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-28  6:19 [PATCH] Silence cpio's "N blocks" output when cloning locally Bryan Donlan
2008-03-28 13:01 ` Johannes Schindelin
2008-03-28 16:12   ` Wincent Colaiuta
2008-03-28 16:29     ` Johannes Schindelin
2008-03-28 18:59       ` Bryan Donlan
2008-03-31  0:19       ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).