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

[PATCH] git-clone: better error message if curl program is missing

From
Gerrit Pape <pape@smarden.org>
Date
Sep 7, 2007, 17:13 UTC
Message-ID
<20070907171400.28590.qmail@d780fac1e27de6.315fe32.mid.smarden.org>

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
Next: Junio C Hamano
Message 1 of 2 in “git-clone: better error message if curl program is missing”
  1. git-clone: better error message if curl program is missingGerrit Pape, Sep 7, 2007
  2. Junio C HamanoSep 7, 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.