t5100: mailinfo and mailsplit tests.
[git.git] / t / t5100 / sample.mbox
1 From nobody Mon Sep 17 00:00:00 2001
2 From: A U Thor <a.u.thor@example.com>
3 Date: Fri, 9 Jun 2006 00:44:16 -0700
4 Subject: [PATCH] a commit.
5
6 Here is a patch from A U Thor.
7
8 ---
9  foo |    2 +-
10  1 files changed, 1 insertions(+), 1 deletions(-)
11
12 diff --git a/foo b/foo
13 index 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 -- 
20 1.4.0.g6f2b
21
22 From nobody Mon Sep 17 00:00:00 2001
23 From: A U Thor <a.u.thor@example.com>
24 Date: Fri, 9 Jun 2006 00:44:16 -0700
25 Subject: [PATCH] another patch
26
27 Here is a patch from A U Thor.  This addresses the issue raised in the
28 message:
29
30 From: Nit Picker <nit.picker@example.net>
31 Subject: foo is too old
32 Message-Id: <nitpicker.12121212@example.net>
33
34 Hopefully this would fix the problem stated there.
35
36
37 I have included an extra blank line above, but it does not have to be
38 stripped away here, along with the                                 
39 whitespaces at the end of the above line.  They are expected to be squashed
40 when the message is made into a commit log by stripspace,
41 Also, there are three blank lines after this paragraph,
42 two truly blank and another full of spaces in between.
43
44             
45
46 Hope this helps.
47
48 ---
49  foo |    2 +-
50  1 files changed, 1 insertions(+), 1 deletions(-)
51
52 diff --git a/foo b/foo
53 index 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 -- 
60 1.4.0.g6f2b
61
62 From nobody Mon Sep 17 00:00:00 2001
63 From: Junio C Hamano <junio@kernel.org>
64 Date: Fri, 9 Jun 2006 00:44:16 -0700
65 Subject: re: [PATCH] another patch
66
67 From: A U Thor <a.u.thor@example.com>
68 Subject: [PATCH] third patch
69
70 Here is a patch from A U Thor.  This addresses the issue raised in the
71 message:
72
73 From: Nit Picker <nit.picker@example.net>
74 Subject: foo is too old
75 Message-Id: <nitpicker.12121212@example.net>
76
77 Hopefully this would fix the problem stated there.
78
79 ---
80  foo |    2 +-
81  1 files changed, 1 insertions(+), 1 deletions(-)
82
83 diff --git a/foo b/foo
84 index 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 -- 
91 1.4.0.g6f2b
92
93 From nobody Sat Aug 27 23:07:49 2005
94 Path: news.gmane.org!not-for-mail
95 Message-ID: <20050721.091036.01119516.yoshfuji@linux-ipv6.org>
96 From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= 
97         <yoshfuji@linux-ipv6.org>
98 Newsgroups: gmane.comp.version-control.git
99 Subject: [PATCH 1/2] GIT: Try all addresses for given remote name
100 Date: Thu, 21 Jul 2005 09:10:36 -0400 (EDT)
101 Lines: 99
102 Organization: USAGI/WIDE Project
103 Approved: news@gmane.org
104 NNTP-Posting-Host: main.gmane.org
105 Mime-Version: 1.0
106 Content-Type: Text/Plain; charset=us-ascii
107 Content-Transfer-Encoding: 7bit
108 X-Trace: sea.gmane.org 1121951434 29350 80.91.229.2 (21 Jul 2005 13:10:34 GMT)
109 X-Complaints-To: usenet@sea.gmane.org
110 NNTP-Posting-Date: Thu, 21 Jul 2005 13:10:34 +0000 (UTC)
111
112 Hello.
113
114 Try all addresses for given remote name until it succeeds.
115 Also supports IPv6.
116
117 Signed-of-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
118
119 diff --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 -- 
209 YOSHIFUJI Hideaki @ USAGI Project  <yoshfuji@linux-ipv6.org>
210 GPG-FP  : 9022 65EB 1ECF 3AD1 0BDF  80D8 4807 F894 E062 0EEA
211
212 From nobody Sat Aug 27 23:07:49 2005
213 Path: news.gmane.org!not-for-mail
214 Message-ID: <u5tacjjdpxq.fsf@lysator.liu.se>
215 From: =?iso-8859-1?Q?David_K=E5gedal?= <davidk@lysator.liu.se>
216 Newsgroups: gmane.comp.version-control.git
217 Subject: [PATCH] Fixed two bugs in git-cvsimport-script.
218 Date: Mon, 15 Aug 2005 20:18:25 +0200
219 Lines: 83
220 Approved: news@gmane.org
221 NNTP-Posting-Host: main.gmane.org
222 Mime-Version: 1.0
223 Content-Type: text/plain; charset=iso-8859-1
224 Content-Transfer-Encoding: QUOTED-PRINTABLE
225 X-Trace: sea.gmane.org 1124130247 31839 80.91.229.2 (15 Aug 2005 18:24:07 GMT)
226 X-Complaints-To: usenet@sea.gmane.org
227 NNTP-Posting-Date: Mon, 15 Aug 2005 18:24:07 +0000 (UTC)
228 Cc: "Junio C. Hamano" <junkio@cox.net>
229 Original-X-From: git-owner@vger.kernel.org Mon Aug 15 20:24:05 2005
230
231 The git-cvsimport-script had a copule of small bugs that prevented me
232 from importing a big CVS repository.
233
234 The first was that it didn't handle removed files with a multi-digit
235 primary revision number.
236
237 The second was that it was asking the CVS server for "F" messages,
238 although they were not handled.
239
240 I also updated the documentation for that script to correspond to
241 actual flags.
242
243 Signed-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
250 50452f9c0c2df1f04d83a26266ba704b13861632
251 diff --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.
285 diff --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=
293 de M Mbinary E F Checked-in Created Updated Merged Removed\n");
294 +       $self->{'socketo'}->write("Valid-responses ok error Valid-requests Mo=
295 de 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+)+)\(=
304 DEAD\)\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
312 David K=E5gedal
313 -
314 To unsubscribe from this list: send the line "unsubscribe git" in
315 the body of a message to majordomo@vger.kernel.org
316 More majordomo info at  http://vger.kernel.org/majordomo-info.html
317