Merge branches 'jc/daemon' and 'mw/http'
authorJunio C Hamano <junkio@cox.net>
Mon, 6 Feb 2006 07:54:14 +0000 (23:54 -0800)
committerJunio C Hamano <junkio@cox.net>
Mon, 6 Feb 2006 07:54:14 +0000 (23:54 -0800)
* jc/daemon:
  daemon: extend user-relative path notation.
  daemon: Set SO_REUSEADDR on listening sockets.
  daemon: do not forbid user relative paths unconditionally under --base-path

* mw/http:
  http-fetch: Tidy control flow in process_alternate_response
  http: Turn on verbose Curl messages if GIT_CURL_VERBOSE set in environment
  http-fetch: Fix message reporting rename of object file.
  http-fetch: Fix object list corruption in fill_active_slots().

Documentation/git-send-email.txt
git-send-email.perl
http-fetch.c
http.c

index b9bec55..00537d8 100644 (file)
@@ -24,25 +24,23 @@ OPTIONS
 -------
 The options available are:
 
---to::
-       Specify the primary recipient of the emails generated.
-       Generally, this will be the upstream maintainer of the
-       project involved.
+--chain-reply-to, --no-chain-reply-to::
+       If this is set, each email will be sent as a reply to the previous
+       email sent.  If disabled with "--no-chain-reply-to", all emails after
+       the first will be sent as replies to the first email sent.  When using
+       this, it is recommended that the first file given be an overview of the
+       entire patch series.
+       Default is --chain-reply-to
+
+--compose::
+       Use $EDITOR to edit an introductory message for the
+       patch series.
 
 --from::
        Specify the sender of the emails.  This will default to
        the value GIT_COMMITTER_IDENT, as returned by "git-var -l".
        The user will still be prompted to confirm this entry.
 
---compose::
-       Use \$EDITOR to edit an introductory message for the
-       patch series.
-
---subject::
-       Specify the initial subject of the email thread.
-       Only necessary if --compose is also set.  If --compose
-       is not set, this will be prompted for.
-
 --in-reply-to::
        Specify the contents of the first In-Reply-To header.
        Subsequent emails will refer to the previous email 
@@ -50,18 +48,24 @@ The options available are:
        Only necessary if --compose is also set.  If --compose
        is not set, this will be prompted for.
 
---chain-reply-to, --no-chain-reply-to::
-       If this is set, each email will be sent as a reply to the previous
-       email sent.  If disabled with "--no-chain-reply-to", all emails after
-       the first will be sent as replies to the first email sent.  When using
-       this, it is recommended that the first file given be an overview of the
-       entire patch series.
-       Default is --chain-reply-to
+--quiet::
+       Make git-send-email less verbose.  One line per email should be
+       all that is output.
 
 --smtp-server::
        If set, specifies the outgoing SMTP server to use.  Defaults to
        localhost.
 
+--subject::
+       Specify the initial subject of the email thread.
+       Only necessary if --compose is also set.  If --compose
+       is not set, this will be prompted for.
+
+--to::
+       Specify the primary recipient of the emails generated.
+       Generally, this will be the upstream maintainer of the
+       project involved.
+
 
 Author
 ------
index 2977b9a..3f1b3ca 100755 (executable)
@@ -186,7 +186,9 @@ for my $f (@ARGV) {
 }
 
 if (@files) {
-       print $_,"\n" for @files;
+       unless ($quiet) {
+               print $_,"\n" for (@files);
+       }
 } else {
        print <<EOT;
 git-send-email [options] <file | directory> [... file | directory ]
@@ -213,6 +215,10 @@ Options:
    --smtp-server  If set, specifies the outgoing SMTP server to use.
                   Defaults to localhost.
 
+   --quiet     Make git-send-email less verbose.  One line per email should be
+               all that is output.
+
+
 Error: Please specify a file or a directory on the command line.
 EOT
        exit(1);
@@ -268,7 +274,9 @@ sub send_message
 
        sendmail(%mail) or die $Mail::Sendmail::error;
 
-       unless ($quiet) {
+       if ($quiet) {
+               printf "Sent %s\n", $subject;
+       } else {
                print "OK. Log says:\n", $Mail::Sendmail::log;
                print "\n\n"
        }
@@ -280,7 +288,6 @@ make_message_id();
 $subject = $initial_subject;
 
 foreach my $t (@files) {
-       my $F = $t;
        open(F,"<",$t) or die "can't open file $t";
 
        @cc = ();
@@ -298,7 +305,7 @@ foreach my $t (@files) {
 
                                } elsif (/^(Cc|From):\s+(.*)$/) {
                                        printf("(mbox) Adding cc: %s from line '%s'\n",
-                                               $2, $_);
+                                               $2, $_) unless $quiet;
                                        push @cc, $2;
                                }
 
@@ -310,7 +317,7 @@ foreach my $t (@files) {
                                # So let's support that, too.
                                if (@cc == 0) {
                                        printf("(non-mbox) Adding cc: %s from line '%s'\n",
-                                               $_, $_);
+                                               $_, $_) unless $quiet;
 
                                        push @cc, $_;
 
@@ -330,7 +337,7 @@ foreach my $t (@files) {
                                chomp $c;
                                push @cc, $c;
                                printf("(sob) Adding cc: %s from line '%s'\n",
-                                       $c, $_);
+                                       $c, $_) unless $quiet;
                        }
                }
        }
index 72edf28..bddbd6b 100644 (file)
@@ -311,7 +311,7 @@ void fill_active_slots(void)
        while (active_requests < max_requests && obj_req != NULL) {
                if (obj_req->state == WAITING) {
                        if (has_sha1_file(obj_req->sha1))
-                               release_object_request(obj_req);
+                               obj_req->state = COMPLETE;
                        else
                                start_object_request(obj_req);
                        curl_multi_perform(curlm, &num_transfers);
@@ -468,13 +468,11 @@ static void process_alternates_response(void *callback_data)
                                         alt_req->url);
                        active_requests++;
                        slot->in_use = 1;
-                       if (start_active_slot(slot)) {
-                               return;
-                       } else {
+                       if (!start_active_slot(slot)) {
                                got_alternates = -1;
                                slot->in_use = 0;
-                               return;
                        }
+                       return;
                }
        } else if (slot->curl_result != CURLE_OK) {
                if (slot->http_code != 404 &&
@@ -822,9 +820,8 @@ static int fetch_object(struct alt_base *repo, unsigned char *sha1)
        } else if (memcmp(obj_req->sha1, obj_req->real_sha1, 20)) {
                ret = error("File %s has bad hash\n", hex);
        } else if (obj_req->rename < 0) {
-               ret = error("unable to write sha1 filename %s: %s",
-                           obj_req->filename,
-                           strerror(obj_req->rename));
+               ret = error("unable to write sha1 filename %s",
+                           obj_req->filename);
        }
 
        release_object_request(obj_req);
diff --git a/http.c b/http.c
index eefb0f0..632c2c5 100644 (file)
--- a/http.c
+++ b/http.c
@@ -192,6 +192,9 @@ static CURL* get_curl_handle(void)
 
        curl_easy_setopt(result, CURLOPT_FOLLOWLOCATION, 1);
 
+       if (getenv("GIT_CURL_VERBOSE"))
+               curl_easy_setopt(result, CURLOPT_VERBOSE, 1);
+
        return result;
 }