t / t5100 / sample.mboxon commit t4014: fix test commit labels. (982b64e)
   1From nobody Mon Sep 17 00:00:00 2001
   2From: A U Thor <a.u.thor@example.com>
   3Date: Fri, 9 Jun 2006 00:44:16 -0700
   4Subject: [PATCH] a commit.
   5
   6Here is a patch from A U Thor.
   7
   8---
   9 foo |    2 +-
  10 1 files changed, 1 insertions(+), 1 deletions(-)
  11
  12diff --git a/foo b/foo
  13index 9123cdc..918dcf8 100644
  14--- a/foo
  15+++ b/foo
  16@@ -1 +1 @@
  17-Fri Jun  9 00:44:04 PDT 2006
  18+Fri Jun  9 00:44:13 PDT 2006
  19-- 
  201.4.0.g6f2b
  21
  22From nobody Mon Sep 17 00:00:00 2001
  23From: A U Thor <a.u.thor@example.com>
  24Date: Fri, 9 Jun 2006 00:44:16 -0700
  25Subject: [PATCH] another patch
  26
  27Here is a patch from A U Thor.  This addresses the issue raised in the
  28message:
  29
  30From: Nit Picker <nit.picker@example.net>
  31Subject: foo is too old
  32Message-Id: <nitpicker.12121212@example.net>
  33
  34Hopefully this would fix the problem stated there.
  35
  36
  37I have included an extra blank line above, but it does not have to be
  38stripped away here, along with the                                 
  39whitespaces at the end of the above line.  They are expected to be squashed
  40when the message is made into a commit log by stripspace,
  41Also, there are three blank lines after this paragraph,
  42two truly blank and another full of spaces in between.
  43
  44            
  45
  46Hope this helps.
  47
  48---
  49 foo |    2 +-
  50 1 files changed, 1 insertions(+), 1 deletions(-)
  51
  52diff --git a/foo b/foo
  53index 9123cdc..918dcf8 100644
  54--- a/foo
  55+++ b/foo
  56@@ -1 +1 @@
  57-Fri Jun  9 00:44:04 PDT 2006
  58+Fri Jun  9 00:44:13 PDT 2006
  59-- 
  601.4.0.g6f2b
  61
  62From nobody Mon Sep 17 00:00:00 2001
  63From: Junio C Hamano <junio@kernel.org>
  64Date: Fri, 9 Jun 2006 00:44:16 -0700
  65Subject: re: [PATCH] another patch
  66
  67From: A U Thor <a.u.thor@example.com>
  68Subject: [PATCH] third patch
  69
  70Here is a patch from A U Thor.  This addresses the issue raised in the
  71message:
  72
  73From: Nit Picker <nit.picker@example.net>
  74Subject: foo is too old
  75Message-Id: <nitpicker.12121212@example.net>
  76
  77Hopefully this would fix the problem stated there.
  78
  79---
  80 foo |    2 +-
  81 1 files changed, 1 insertions(+), 1 deletions(-)
  82
  83diff --git a/foo b/foo
  84index 9123cdc..918dcf8 100644
  85--- a/foo
  86+++ b/foo
  87@@ -1 +1 @@
  88-Fri Jun  9 00:44:04 PDT 2006
  89+Fri Jun  9 00:44:13 PDT 2006
  90-- 
  911.4.0.g6f2b
  92
  93From nobody Sat Aug 27 23:07:49 2005
  94Path: news.gmane.org!not-for-mail
  95Message-ID: <20050721.091036.01119516.yoshfuji@linux-ipv6.org>
  96From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= 
  97        <yoshfuji@linux-ipv6.org>
  98Newsgroups: gmane.comp.version-control.git
  99Subject: [PATCH 1/2] GIT: Try all addresses for given remote name
 100Date: Thu, 21 Jul 2005 09:10:36 -0400 (EDT)
 101Lines: 99
 102Organization: USAGI/WIDE Project
 103Approved: news@gmane.org
 104NNTP-Posting-Host: main.gmane.org
 105Mime-Version: 1.0
 106Content-Type: Text/Plain; charset=us-ascii
 107Content-Transfer-Encoding: 7bit
 108X-Trace: sea.gmane.org 1121951434 29350 80.91.229.2 (21 Jul 2005 13:10:34 GMT)
 109X-Complaints-To: usenet@sea.gmane.org
 110NNTP-Posting-Date: Thu, 21 Jul 2005 13:10:34 +0000 (UTC)
 111
 112Hello.
 113
 114Try all addresses for given remote name until it succeeds.
 115Also supports IPv6.
 116
 117Signed-of-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
 118
 119diff --git a/connect.c b/connect.c
 120--- a/connect.c
 121+++ b/connect.c
 122@@ -96,42 +96,57 @@ static enum protocol get_protocol(const 
 123        die("I don't handle protocol '%s'", name);
 124 }
 125 
 126-static void lookup_host(const char *host, struct sockaddr *in)
 127-{
 128-       struct addrinfo *res;
 129-       int ret;
 130-
 131-       ret = getaddrinfo(host, NULL, NULL, &res);
 132-       if (ret)
 133-               die("Unable to look up %s (%s)", host, gai_strerror(ret));
 134-       *in = *res->ai_addr;
 135-       freeaddrinfo(res);
 136-}
 137+#define STR_(s)        # s
 138+#define STR(s) STR_(s)
 139 
 140 static int git_tcp_connect(int fd[2], const char *prog, char *host, char *path)
 141 {
 142-       struct sockaddr addr;
 143-       int port = DEFAULT_GIT_PORT, sockfd;
 144-       char *colon;
 145-
 146-       colon = strchr(host, ':');
 147-       if (colon) {
 148-               char *end;
 149-               unsigned long n = strtoul(colon+1, &end, 0);
 150-               if (colon[1] && !*end) {
 151-                       *colon = 0;
 152-                       port = n;
 153+       int sockfd = -1;
 154+       char *colon, *end;
 155+       char *port = STR(DEFAULT_GIT_PORT);
 156+       struct addrinfo hints, *ai0, *ai;
 157+       int gai;
 158+
 159+       if (host[0] == '[') {
 160+               end = strchr(host + 1, ']');
 161+               if (end) {
 162+                       *end = 0;
 163+                       end++;
 164+                       host++;
 165+               } else
 166+                       end = host;
 167+       } else
 168+               end = host;
 169+       colon = strchr(end, ':');
 170+
 171+       if (colon)
 172+               port = colon + 1;
 173+
 174+       memset(&hints, 0, sizeof(hints));
 175+       hints.ai_socktype = SOCK_STREAM;
 176+       hints.ai_protocol = IPPROTO_TCP;
 177+
 178+       gai = getaddrinfo(host, port, &hints, &ai);
 179+       if (gai)
 180+               die("Unable to look up %s (%s)", host, gai_strerror(gai));
 181+
 182+       for (ai0 = ai; ai; ai = ai->ai_next) {
 183+               sockfd = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
 184+               if (sockfd < 0)
 185+                       continue;
 186+               if (connect(sockfd, ai->ai_addr, ai->ai_addrlen) < 0) {
 187+                       close(sockfd);
 188+                       sockfd = -1;
 189+                       continue;
 190                }
 191+               break;
 192        }
 193 
 194-       lookup_host(host, &addr);
 195-       ((struct sockaddr_in *)&addr)->sin_port = htons(port);
 196+       freeaddrinfo(ai0);
 197 
 198-       sockfd = socket(PF_INET, SOCK_STREAM, IPPROTO_IP);
 199        if (sockfd < 0)
 200                die("unable to create socket (%s)", strerror(errno));
 201-       if (connect(sockfd, (void *)&addr, sizeof(addr)) < 0)
 202-               die("unable to connect (%s)", strerror(errno));
 203+
 204        fd[0] = sockfd;
 205        fd[1] = sockfd;
 206        packet_write(sockfd, "%s %s\n", prog, path);
 207
 208-- 
 209YOSHIFUJI Hideaki @ USAGI Project  <yoshfuji@linux-ipv6.org>
 210GPG-FP  : 9022 65EB 1ECF 3AD1 0BDF  80D8 4807 F894 E062 0EEA
 211
 212From nobody Sat Aug 27 23:07:49 2005
 213Path: news.gmane.org!not-for-mail
 214Message-ID: <u5tacjjdpxq.fsf@lysator.liu.se>
 215From: =?iso-8859-1?Q?David_K=E5gedal?= <davidk@lysator.liu.se>
 216Newsgroups: gmane.comp.version-control.git
 217Subject: [PATCH] Fixed two bugs in git-cvsimport-script.
 218Date: Mon, 15 Aug 2005 20:18:25 +0200
 219Lines: 83
 220Approved: news@gmane.org
 221NNTP-Posting-Host: main.gmane.org
 222Mime-Version: 1.0
 223Content-Type: text/plain; charset=iso-8859-1
 224Content-Transfer-Encoding: QUOTED-PRINTABLE
 225X-Trace: sea.gmane.org 1124130247 31839 80.91.229.2 (15 Aug 2005 18:24:07 GMT)
 226X-Complaints-To: usenet@sea.gmane.org
 227NNTP-Posting-Date: Mon, 15 Aug 2005 18:24:07 +0000 (UTC)
 228Cc: "Junio C. Hamano" <junkio@cox.net>
 229Original-X-From: git-owner@vger.kernel.org Mon Aug 15 20:24:05 2005
 230
 231The git-cvsimport-script had a copule of small bugs that prevented me
 232from importing a big CVS repository.
 233
 234The first was that it didn't handle removed files with a multi-digit
 235primary revision number.
 236
 237The second was that it was asking the CVS server for "F" messages,
 238although they were not handled.
 239
 240I also updated the documentation for that script to correspond to
 241actual flags.
 242
 243Signed-off-by: David K=E5gedal <davidk@lysator.liu.se>
 244---
 245
 246 Documentation/git-cvsimport-script.txt |    9 ++++++++-
 247 git-cvsimport-script                   |    4 ++--
 248 2 files changed, 10 insertions(+), 3 deletions(-)
 249
 25050452f9c0c2df1f04d83a26266ba704b13861632
 251diff --git a/Documentation/git-cvsimport-script.txt b/Documentation/git=
 252-cvsimport-script.txt
 253--- a/Documentation/git-cvsimport-script.txt
 254+++ b/Documentation/git-cvsimport-script.txt
 255@@ -29,6 +29,10 @@ OPTIONS
 256        currently, only the :local:, :ext: and :pserver: access methods=20
 257        are supported.
 258=20
 259+-C <target-dir>::
 260+        The GIT repository to import to.  If the directory doesn't
 261+        exist, it will be created.  Default is the current directory.
 262+
 263 -i::
 264        Import-only: don't perform a checkout after importing.  This option
 265        ensures the working directory and cache remain untouched and will
 266@@ -44,7 +48,7 @@ OPTIONS
 267=20
 268 -p <options-for-cvsps>::
 269        Additional options for cvsps.
 270-       The options '-x' and '-A' are implicit and should not be used here.
 271+       The options '-u' and '-A' are implicit and should not be used here.
 272=20
 273        If you need to pass multiple options, separate them with a comma.
 274=20
 275@@ -57,6 +61,9 @@ OPTIONS
 276 -h::
 277        Print a short usage message and exit.
 278=20
 279+-z <fuzz>::
 280+        Pass the timestamp fuzz factor to cvsps.
 281+
 282 OUTPUT
 283 ------
 284 If '-v' is specified, the script reports what it is doing.
 285diff --git a/git-cvsimport-script b/git-cvsimport-script
 286--- a/git-cvsimport-script
 287+++ b/git-cvsimport-script
 288@@ -190,7 +190,7 @@ sub conn {
 289        $self->{'socketo'}->write("Root $repo\n");
 290=20
 291        # Trial and error says that this probably is the minimum set
 292-       $self->{'socketo'}->write("Valid-responses ok error Valid-requests Mo=
 293de M Mbinary E F Checked-in Created Updated Merged Removed\n");
 294+       $self->{'socketo'}->write("Valid-responses ok error Valid-requests Mo=
 295de M Mbinary E Checked-in Created Updated Merged Removed\n");
 296=20
 297        $self->{'socketo'}->write("valid-requests\n");
 298        $self->{'socketo'}->flush();
 299@@ -691,7 +691,7 @@ while(<CVS>) {
 300                unlink($tmpname);
 301                my $mode =3D pmode($cvs->{'mode'});
 302                push(@new,[$mode, $sha, $fn]); # may be resurrected!
 303-       } elsif($state =3D=3D 9 and /^\s+(\S+):\d(?:\.\d+)+->(\d(?:\.\d+)+)\(=
 304DEAD\)\s*$/) {
 305+       } elsif($state =3D=3D 9 and /^\s+(\S+):\d+(?:\.\d+)+->(\d+(?:\.\d+)+)=
 306\(DEAD\)\s*$/) {
 307                my $fn =3D $1;
 308                $fn =3D~ s#^/+##;
 309                push(@old,$fn);
 310
 311--=20
 312David K=E5gedal
 313-
 314To unsubscribe from this list: send the line "unsubscribe git" in
 315the body of a message to majordomo@vger.kernel.org
 316More majordomo info at  http://vger.kernel.org/majordomo-info.html
 317