git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Gerrit Pape <pape@smarden.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: [PATCH] git-clone: better error message if curl program is missing
Date: Fri, 7 Sep 2007 17:13:59 +0000	[thread overview]
Message-ID: <20070907171400.28590.qmail@d780fac1e27de6.315fe32.mid.smarden.org> (raw)

If the curl program is not available, and git clone is started to clone a
repository through http, this is the output

 Initialized empty Git repository in /tmp/puppet/.git/
 /usr/bin/git-clone: line 37: curl: command not found
 Cannot get remote repository information.
 Perhaps git-update-server-info needs to be run there?

This patch improves the error message by testing for availability of the
curl program before running it, the error output now is

 Initialized empty Git repository in /tmp/puppet/.git/
 The curl program is not available

Adrian Bridgett noticed this and reported through
 http://bugs.debian.org/440976

Signed-off-by: Gerrit Pape <pape@smarden.org>
---
 git-clone.sh |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/git-clone.sh b/git-clone.sh
index 18003ab..834371d 100755
--- a/git-clone.sh
+++ b/git-clone.sh
@@ -34,6 +34,8 @@ fi
 
 http_fetch () {
 	# $1 = Remote, $2 = Local
+	type curl >/dev/null 2>&1 ||
+	    die "The curl program is not available"
 	curl -nsfL $curl_extra_args "$1" >"$2"
 }
 
-- 
1.5.3.1

             reply	other threads:[~2007-09-07 17:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-07 17:13 Gerrit Pape [this message]
2007-09-07 21:19 ` [PATCH] git-clone: better error message if curl program is missing Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070907171400.28590.qmail@d780fac1e27de6.315fe32.mid.smarden.org \
    --to=pape@smarden.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).