Re: [PATCH] git-clone: better error message if curl program is missing
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 7, 2007, 21:19 UTC
- Message-ID
- <7vtzq62mxn.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <20070907171400.28590.qmail@d780fac1e27de6.315fe32.mid.smarden.org>
Gerrit Pape <pape@smarden.org> writes:
Show 5 quoted lines
> 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
Perhaps we should die at this point so that...
> Cannot get remote repository information. > Perhaps git-update-server-info needs to be run there?
the user does not have to see this.
In other words, instead of this:
Show 6 quoted lines
> 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"
> }something like this, perhaps:
http_fetch () {
# $1 = remote, $2 = local
curl -nsfL $curl_extra_args "$1" >"$2" || exit
}Then the shell would say "curl: command not found" and we would stop.
I am just hestating to use "type" there (yeah, I know mergetool has one but that one is not as close to the core of the workflow as git-fetch is).
BTW, isn't it a packaging bug not to depend git-fetch on curl?