From fd35e42683113e367eee0bb8ac956dde3d95edde Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Thu, 7 Aug 2008 02:06:30 +0200 Subject: [PATCH 1/2] Fail properly when cloning from invalid HTTP URL Currently, when cloning from invalid HTTP URL, git clone will possibly return curl error, then a confusing message about remote HEAD and then return success and leave an empty repository behind, confusing either the end-user or the automated service calling it (think repo.or.cz). This patch changes the error() calls in get_refs_via_curl() to die()s, akin to the other get_refs_*() functions. Cc: Daniel Barkalow Signed-off-by: Petr Baudis Signed-off-by: Junio C Hamano --- transport.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/transport.c b/transport.c index 6f549b336..b3e3e61f9 100644 --- a/transport.c +++ b/transport.c @@ -463,17 +463,14 @@ static struct ref *get_refs_via_curl(struct transport *transport) run_active_slot(slot); if (results.curl_result != CURLE_OK) { strbuf_release(&buffer); - if (missing_target(&results)) { - return NULL; - } else { - error("%s", curl_errorstr); - return NULL; - } + if (missing_target(&results)) + die("%s not found: did you run git update-server-info on the server?", refs_url); + else + die("%s download error - %s", refs_url, curl_errorstr); } } else { strbuf_release(&buffer); - error("Unable to start request"); - return NULL; + die("Unable to start HTTP request"); } data = buffer.buf; From 0f4f4d1597219bad74c4fde624321d8a05d1b55e Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 7 Aug 2008 16:05:25 -0700 Subject: [PATCH 2/2] asciidoc markup fixes I see quite a few pages on k.org site, e.g. http://www.kernel.org/pub/software/scm/git/docs/git-rerere.html (scroll down to find "After this test merge") are misformatted to lose teletype text '+' that is followed by a comma, and turns the following paragraph all typeset in teletype. This patch seems to fix the issue at the site (meaning, with the particular vintage of asciidoc and docbook toolchain), without breaking things with the version I have at my primary development machine, but wider testing is very much appreciated. After this patch, git grep '`+`,' -- Documentation should report noting. Signed-off-by: Junio C Hamano --- Documentation/git-push.txt | 2 +- Documentation/git-rerere.txt | 6 +++--- Documentation/pull-fetch-param.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt index 82dd4433f..60d53391d 100644 --- a/Documentation/git-push.txt +++ b/Documentation/git-push.txt @@ -31,7 +31,7 @@ OPTIONS :: The canonical format of a parameter is - `+?:`; that is, an optional plus `+`, followed + `+?:`; that is, an optional plus `{plus}`, followed by the source ref, followed by a colon `:`, followed by the destination ref. + diff --git a/Documentation/git-rerere.txt b/Documentation/git-rerere.txt index 37828e5c5..8f12dc975 100644 --- a/Documentation/git-rerere.txt +++ b/Documentation/git-rerere.txt @@ -90,15 +90,15 @@ One way to do it is to pull master into the topic branch: The commits marked with `*` touch the same area in the same file; you need to resolve the conflicts when creating the commit -marked with `+`. Then you can test the result to make sure your +marked with `{plus}`. Then you can test the result to make sure your work-in-progress still works with what is in the latest master. After this test merge, there are two ways to continue your work on the topic. The easiest is to build on top of the test merge -commit `+`, and when your work in the topic branch is finally +commit `{plus}`, and when your work in the topic branch is finally ready, pull the topic branch into master, and/or ask the upstream to pull from you. By that time, however, the master or -the upstream might have been advanced since the test merge `+`, +the upstream might have been advanced since the test merge `{plus}`, in which case the final commit graph would look like this: ------------ diff --git a/Documentation/pull-fetch-param.txt b/Documentation/pull-fetch-param.txt index cbee36994..f15773827 100644 --- a/Documentation/pull-fetch-param.txt +++ b/Documentation/pull-fetch-param.txt @@ -6,7 +6,7 @@ :: The canonical format of a parameter is - `+?:`; that is, an optional plus `+`, followed + `+?:`; that is, an optional plus `{plus}`, followed by the source ref, followed by a colon `:`, followed by the destination ref. +