git-svn: fix log with single revision against a non-HEAD branch
[git/dscho.git] / t / t5100 / sample.mbox
blobb80c981c165e9c82f56f826a0542f3bef3f13eb3
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.
6 Here is a patch from A U Thor.
8 ---
9  foo |    2 +-
10  1 files changed, 1 insertions(+), 1 deletions(-)
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
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
27 Here is a patch from A U Thor.  This addresses the issue raised in the
28 message:
30 From: Nit Picker <nit.picker@example.net>
31 Subject: foo is too old
32 Message-Id: <nitpicker.12121212@example.net>
34 Hopefully this would fix the problem stated there.
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.
44             
46 Hope this helps.
48 ---
49  foo |    2 +-
50  1 files changed, 1 insertions(+), 1 deletions(-)
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
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
67 From: A U Thor <a.u.thor@example.com>
68 Subject: [PATCH] third patch
70 Here is a patch from A U Thor.  This addresses the issue raised in the
71 message:
73 From: Nit Picker <nit.picker@example.net>
74 Subject: foo is too old
75 Message-Id: <nitpicker.12121212@example.net>
77 Hopefully this would fix the problem stated there.
79 ---
80  foo |    2 +-
81  1 files changed, 1 insertions(+), 1 deletions(-)
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
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)
112 Hello.
114 Try all addresses for given remote name until it succeeds.
115 Also supports IPv6.
117 Signed-of-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
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);
126 -static void lookup_host(const char *host, struct sockaddr *in)
128 -       struct addrinfo *res;
129 -       int ret;
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);
137 +#define STR_(s)        # s
138 +#define STR(s) STR_(s)
140  static int git_tcp_connect(int fd[2], const char *prog, char *host, char *path)
142 -       struct sockaddr addr;
143 -       int port = DEFAULT_GIT_PORT, sockfd;
144 -       char *colon;
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;
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, ':');
171 +       if (colon)
172 +               port = colon + 1;
174 +       memset(&hints, 0, sizeof(hints));
175 +       hints.ai_socktype = SOCK_STREAM;
176 +       hints.ai_protocol = IPPROTO_TCP;
178 +       gai = getaddrinfo(host, port, &hints, &ai);
179 +       if (gai)
180 +               die("Unable to look up %s (%s)", host, gai_strerror(gai));
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         }
194 -       lookup_host(host, &addr);
195 -       ((struct sockaddr_in *)&addr)->sin_port = htons(port);
196 +       freeaddrinfo(ai0);
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));
204         fd[0] = sockfd;
205         fd[1] = sockfd;
206         packet_write(sockfd, "%s %s\n", prog, path);
208 -- 
209 YOSHIFUJI Hideaki @ USAGI Project  <yoshfuji@linux-ipv6.org>
210 GPG-FP  : 9022 65EB 1ECF 3AD1 0BDF  80D8 4807 F894 E062 0EEA
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
231 The git-cvsimport-script had a copule of small bugs that prevented me
232 from importing a big CVS repository.
234 The first was that it didn't handle removed files with a multi-digit
235 primary revision number.
237 The second was that it was asking the CVS server for "F" messages,
238 although they were not handled.
240 I also updated the documentation for that script to correspond to
241 actual flags.
243 Signed-off-by: David K=E5gedal <davidk@lysator.liu.se>
246  Documentation/git-cvsimport-script.txt |    9 ++++++++-
247  git-cvsimport-script                   |    4 ++--
248  2 files changed, 10 insertions(+), 3 deletions(-)
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.
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.
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
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.
273         If you need to pass multiple options, separate them with a comma.
275 @@ -57,6 +61,9 @@ OPTIONS
276  -h::
277         Print a short usage message and exit.
279 +-z <fuzz>::
280 +        Pass the timestamp fuzz factor to cvsps.
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");
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");
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);
311 --=20
312 David K=E5gedal
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
318 From nobody Mon Sep 17 00:00:00 2001
319 From: A U Thor <a.u.thor@example.com>
320 References: <Pine.LNX.4.640.0001@woody.linux-foundation.org>
321  <Pine.LNX.4.640.0002@woody.linux-foundation.org>
322  <Pine.LNX.4.640.0003@woody.linux-foundation.org>
323  <Pine.LNX.4.640.0004@woody.linux-foundation.org>
324  <Pine.LNX.4.640.0005@woody.linux-foundation.org>
325  <Pine.LNX.4.640.0006@woody.linux-foundation.org>
326  <Pine.LNX.4.640.0007@woody.linux-foundation.org>
327  <Pine.LNX.4.640.0008@woody.linux-foundation.org>
328  <Pine.LNX.4.640.0009@woody.linux-foundation.org>
329  <Pine.LNX.4.640.0010@woody.linux-foundation.org>
330  <Pine.LNX.4.640.0011@woody.linux-foundation.org>
331  <Pine.LNX.4.640.0012@woody.linux-foundation.org>
332  <Pine.LNX.4.640.0013@woody.linux-foundation.org>
333  <Pine.LNX.4.640.0014@woody.linux-foundation.org>
334  <Pine.LNX.4.640.0015@woody.linux-foundation.org>
335  <Pine.LNX.4.640.0016@woody.linux-foundation.org>
336  <Pine.LNX.4.640.0017@woody.linux-foundation.org>
337  <Pine.LNX.4.640.0018@woody.linux-foundation.org>
338  <Pine.LNX.4.640.0019@woody.linux-foundation.org>
339  <Pine.LNX.4.640.0020@woody.linux-foundation.org>
340  <Pine.LNX.4.640.0021@woody.linux-foundation.org>
341  <Pine.LNX.4.640.0022@woody.linux-foundation.org>
342  <Pine.LNX.4.640.0023@woody.linux-foundation.org>
343  <Pine.LNX.4.640.0024@woody.linux-foundation.org>
344  <Pine.LNX.4.640.0025@woody.linux-foundation.org>
345  <Pine.LNX.4.640.0026@woody.linux-foundation.org>
346  <Pine.LNX.4.640.0027@woody.linux-foundation.org>
347  <Pine.LNX.4.640.0028@woody.linux-foundation.org>
348  <Pine.LNX.4.640.0029@woody.linux-foundation.org>
349  <Pine.LNX.4.640.0030@woody.linux-foundation.org>
350  <Pine.LNX.4.640.0031@woody.linux-foundation.org>
351  <Pine.LNX.4.640.0032@woody.linux-foundation.org>
352  <Pine.LNX.4.640.0033@woody.linux-foundation.org>
353  <Pine.LNX.4.640.0034@woody.linux-foundation.org>
354  <Pine.LNX.4.640.0035@woody.linux-foundation.org>
355  <Pine.LNX.4.640.0036@woody.linux-foundation.org>
356  <Pine.LNX.4.640.0037@woody.linux-foundation.org>
357  <Pine.LNX.4.640.0038@woody.linux-foundation.org>
358  <Pine.LNX.4.640.0039@woody.linux-foundation.org>
359  <Pine.LNX.4.640.0040@woody.linux-foundation.org>
360  <Pine.LNX.4.640.0041@woody.linux-foundation.org>
361  <Pine.LNX.4.640.0042@woody.linux-foundation.org>
362  <Pine.LNX.4.640.0043@woody.linux-foundation.org>
363  <Pine.LNX.4.640.0044@woody.linux-foundation.org>
364  <Pine.LNX.4.640.0045@woody.linux-foundation.org>
365  <Pine.LNX.4.640.0046@woody.linux-foundation.org>
366  <Pine.LNX.4.640.0047@woody.linux-foundation.org>
367  <Pine.LNX.4.640.0048@woody.linux-foundation.org>
368  <Pine.LNX.4.640.0049@woody.linux-foundation.org>
369  <Pine.LNX.4.640.0050@woody.linux-foundation.org>
370 Date: Fri, 9 Jun 2006 00:44:16 -0700
371 Subject: [PATCH] a commit.
373 Here is a patch from A U Thor.
376  foo |    2 +-
377  1 files changed, 1 insertions(+), 1 deletions(-)
379 diff --git a/foo b/foo
380 index 9123cdc..918dcf8 100644
381 --- a/foo
382 +++ b/foo
383 @@ -1 +1 @@
384 -Fri Jun  9 00:44:04 PDT 2006
385 +Fri Jun  9 00:44:13 PDT 2006
386 -- 
387 1.4.0.g6f2b
389 From nobody Mon Sep 17 00:00:00 2001
390 From: A U Thor <a.u.thor@example.com>
391 Date: Fri, 9 Jun 2006 00:44:16 -0700
392 Subject: [PATCH] another patch
394 Here is an empty patch from A U Thor.
396 From nobody Mon Sep 17 00:00:00 2001
397 From: Junio C Hamano <junio@kernel.org>
398 Date: Fri, 9 Jun 2006 00:44:16 -0700
399 Subject: re: [PATCH] another patch
401 From: A U Thor <a.u.thor@example.com>
402 Subject: [PATCH] another patch
403 >Here is an empty patch from A U Thor.
405 Hey you forgot the patch!