capillary 0.2.0 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/README +123 -14
- data/lib/capillary/commit.rb +3 -0
- data/lib/capillary/log_parser.rb +26 -12
- data/lib/capillary/version.rb +1 -1
- data/test/capillary/log_parser_test.rb +331 -0
- data/test/fixtures/4x_dangling_branches.txt +18 -0
- data/test/fixtures/double_fork.txt +20 -0
- data/test/fixtures/log_graph.txt +11 -0
- metadata +7 -4
data/Gemfile.lock
CHANGED
data/README
CHANGED
@@ -7,37 +7,146 @@ gitk and `git log --graph`, except beautiful.
|
|
7
7
|
|
8
8
|
Capillary consists of two parts:
|
9
9
|
|
10
|
-
* capillary.rb: which parses the output from Git log data and
|
11
|
-
|
10
|
+
* capillary.rb: which parses the output from Git log data and generates a
|
11
|
+
JSON representation of it, usable from:
|
12
12
|
* capillary.js: the javascript library doing the presentation
|
13
13
|
|
14
14
|
The emitted JSON
|
15
15
|
----------------
|
16
16
|
|
17
17
|
Capillary.rb emits a JSON array consisting of JSON objects in the
|
18
|
-
following form (starting with
|
18
|
+
following form (starting with seqId=0):
|
19
19
|
|
20
20
|
[[{
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
21
|
+
"refNames": ["HEAD", "origin/production", "production"],
|
22
|
+
"seqId": 0,
|
23
|
+
"committedAt": "Fri Jul 15 07:23:44 +0200 2011",
|
24
|
+
"parentIds": ["8f38426b1641a20511f6eeb6878f2e1e00712df2", "ce7de03fc2cb6114d2f859fefc996e7fffa2d7f6"],
|
25
|
+
"id": "a490db7b450e6c58bb69ac64dfe725b188bfe5b3",
|
26
|
+
"committerEmail": "christian@gitorious.org",
|
27
|
+
"message": "Merge branch 'master' into production"
|
28
|
+
}, {
|
29
|
+
"refNames": [],
|
30
|
+
"seqId": 1,
|
31
|
+
"committedAt": "Thu Jun 16 10:20:03 +0200 2011",
|
32
|
+
"parentIds": ["0443fcdf66df410993441b617d14dab121245ff7"],
|
33
|
+
"id": "909d42da14d186e4580995f24b56aa4223f7965f",
|
34
|
+
"committerEmail": "christian@gitorious.org",
|
35
|
+
"message":"Don't allow destructive actions via GET etc"
|
36
|
+
}]]
|
37
|
+
|
38
|
+
* seqId: The relative sequence id of the commit. This is used to order commits,
|
39
|
+
and seqId == 0 is given to the newest commit, because Capillary looks at the
|
40
|
+
commit graph top-down (newest-oldest).
|
41
|
+
* committedAt: The commit date.
|
42
|
+
* committerEmail: The committer email.
|
43
|
+
* id: The commit sha
|
44
|
+
* parentIds: The commit sha of all parent commits of this commit
|
45
|
+
* message: The commit message
|
46
|
+
* Ref names: Relevant names of branches that concern the commit
|
47
|
+
in question
|
48
|
+
|
49
|
+
Note that the JSON emitted is a nested array - an array of "paths", where each
|
50
|
+
path is an array of commits.
|
51
|
+
|
52
|
+
What is a path? If you look at a log graph from the "top" (newest commit),
|
53
|
+
each merge point is considered the start of a new path through the graph. The
|
54
|
+
commit where the branch was originally created marks the end of the path.
|
55
|
+
|
56
|
+
Consider the following graph (the numbers to the left indicate each commit's
|
57
|
+
assigned seqId):
|
58
|
+
|
59
|
+
0 0
|
60
|
+
|\
|
61
|
+
1 0 |
|
62
|
+
| |
|
63
|
+
2 | 0
|
64
|
+
| |
|
65
|
+
3 | 0
|
66
|
+
| |\
|
67
|
+
4 | 0 |
|
68
|
+
| | |
|
69
|
+
5 | 0 |
|
70
|
+
| | |
|
71
|
+
6 | | 0
|
72
|
+
| |/
|
73
|
+
7 | 0
|
74
|
+
|/
|
75
|
+
8 0
|
76
|
+
|
|
77
|
+
|
78
|
+
Capillary parses this log into three paths:
|
79
|
+
|
80
|
+
Path #1: [{ seqId: 0 }, { seqId: 1 }, { seqId: 8 }]
|
81
|
+
0 0
|
82
|
+
|
|
83
|
+
1 0
|
84
|
+
|
|
85
|
+
2 |
|
86
|
+
|
|
87
|
+
3 |
|
88
|
+
|
|
89
|
+
4 |
|
90
|
+
|
|
91
|
+
5 |
|
92
|
+
|
|
93
|
+
6 |
|
94
|
+
|
|
95
|
+
7 |
|
96
|
+
|
|
97
|
+
8 0
|
98
|
+
|
|
99
|
+
|
100
|
+
Path #2: [{ seqId: 0 }, { seqId: 2 }, { seqId: 3 }, { seqId: 4 },
|
101
|
+
{ seqId: 5 }, { seqId: 7 }, { seqId: 8 }]
|
102
|
+
0 0
|
103
|
+
\
|
104
|
+
1 |
|
105
|
+
|
|
106
|
+
2 0
|
107
|
+
|
|
108
|
+
3 0
|
109
|
+
|
|
110
|
+
4 0
|
111
|
+
|
|
112
|
+
5 0
|
113
|
+
|
|
114
|
+
6 |
|
115
|
+
|
|
116
|
+
7 0
|
117
|
+
/
|
118
|
+
8 0
|
119
|
+
|
|
120
|
+
|
121
|
+
Path #3: [{ seqId: 3 }, { seqId: 6 }, { seqId: 7 }]
|
122
|
+
3 0
|
123
|
+
\
|
124
|
+
4 |
|
125
|
+
|
|
126
|
+
5 |
|
127
|
+
|
|
128
|
+
6 0
|
129
|
+
/
|
130
|
+
7 0
|
131
|
+
|
132
|
+
This output can be further processed by capillary.js.
|
31
133
|
|
32
134
|
Input to capillary.rb
|
33
135
|
---------------------
|
34
136
|
|
35
|
-
Capillary parses output from Git, in the format as specified in
|
137
|
+
Capillary parses output from Git log, in the format as specified in
|
36
138
|
test/fixtures/single_commit.txt. This output was generated from Git using the
|
37
139
|
following command:
|
38
140
|
|
39
141
|
git log --pretty=format:"%H§%P§%ad§%ae§%d§%s§"
|
40
142
|
|
143
|
+
You may also use the following command, which orders commits slightly
|
144
|
+
differently, and is perhaps more suitable for graph generation. Note that this
|
145
|
+
command outputs an extra line per commit, which may be an issue if I/O is a
|
146
|
+
concern:
|
147
|
+
|
148
|
+
git rev-list --pretty=format:"%H§%P§%ad§%ae§%d§%s§" --topo-order -50 master
|
149
|
+
|
41
150
|
The name
|
42
151
|
--------
|
43
152
|
|
data/lib/capillary/commit.rb
CHANGED
data/lib/capillary/log_parser.rb
CHANGED
@@ -27,10 +27,13 @@ module Capillary
|
|
27
27
|
@branches = []
|
28
28
|
@seq_ids = {}
|
29
29
|
@commit_positions = {}
|
30
|
+
@relationships = {}
|
30
31
|
end
|
31
32
|
|
32
33
|
def <<(commit)
|
33
34
|
commit = Capillary::Commit.parse(commit) if String === commit
|
35
|
+
return if commit.nil?
|
36
|
+
|
34
37
|
seq_id = @commit_count
|
35
38
|
@commit_count += 1
|
36
39
|
|
@@ -55,16 +58,7 @@ module Capillary
|
|
55
58
|
|
56
59
|
placed = branches.inject(false) do |was_placed, branch|
|
57
60
|
if !branch.last.closed? && branch.last.parent_id == commit.id
|
58
|
-
|
59
|
-
|
60
|
-
if pos
|
61
|
-
diff = (pos.first - col).abs
|
62
|
-
next true if diff > 1
|
63
|
-
else
|
64
|
-
@commit_positions[commit.id] = [col, branch.length]
|
65
|
-
end
|
66
|
-
|
67
|
-
branch << commit
|
61
|
+
save_commit_pos(col, commit)
|
68
62
|
was_placed = true
|
69
63
|
end
|
70
64
|
|
@@ -73,9 +67,29 @@ module Capillary
|
|
73
67
|
end
|
74
68
|
|
75
69
|
unless placed
|
76
|
-
|
77
|
-
|
70
|
+
save_commit_pos(col, commit)
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
def save_commit_pos(col, commit)
|
75
|
+
branch = branches[col]
|
76
|
+
prev_commit = branch && branch.last
|
77
|
+
pos = prev_commit && @commit_positions[prev_commit.parent_id]
|
78
|
+
|
79
|
+
if !pos
|
80
|
+
branches << [] if branches.length <= col
|
81
|
+
@commit_positions[commit.id] = [col, branches[col].length]
|
78
82
|
end
|
83
|
+
|
84
|
+
if branches[col].length > 0
|
85
|
+
pid = branches[col].last.commit.id
|
86
|
+
relationship = "#{commit.id}:#{pid}"
|
87
|
+
return if @relationships[relationship]
|
88
|
+
@relationships[relationship] = true
|
89
|
+
end
|
90
|
+
|
91
|
+
parent = commit.parent_id ? " (#{commit.parent_id[0...7]})" : ""
|
92
|
+
branches[col] << commit
|
79
93
|
end
|
80
94
|
end
|
81
95
|
|
data/lib/capillary/version.rb
CHANGED
@@ -20,6 +20,27 @@ require "test_helper"
|
|
20
20
|
require "capillary/log_parser"
|
21
21
|
|
22
22
|
class LogParserTest < MiniTest::Spec
|
23
|
+
attr_reader :log_parser, :lines
|
24
|
+
|
25
|
+
def commits_for_branch(num)
|
26
|
+
branches[num].collect { |c| c.id[0...7] }
|
27
|
+
end
|
28
|
+
|
29
|
+
def load_fixture(fixture)
|
30
|
+
fixtures = fixture(fixture).split("\n")
|
31
|
+
@log_parser = Capillary::LogParser.new
|
32
|
+
@lines = []
|
33
|
+
|
34
|
+
fixtures.reject { |f| f.strip == "" }.each do |fixture|
|
35
|
+
@lines << Capillary::Commit.parse(fixture)
|
36
|
+
@log_parser << @lines.last
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def branches
|
41
|
+
log_parser.branches
|
42
|
+
end
|
43
|
+
|
23
44
|
# * a7cf78bfff06d52b5b0aa021508b44c00cad067a
|
24
45
|
# * db75ad82d678d51b29709d26af64d4a85b6f8071
|
25
46
|
context "A linear graph" do
|
@@ -265,6 +286,316 @@ class LogParserTest < MiniTest::Spec
|
|
265
286
|
end
|
266
287
|
end
|
267
288
|
|
289
|
+
# 0
|
290
|
+
# |
|
291
|
+
# 0
|
292
|
+
# |
|
293
|
+
# 0
|
294
|
+
# |\
|
295
|
+
# | 0
|
296
|
+
# | |
|
297
|
+
# | 0
|
298
|
+
# | |
|
299
|
+
# | 0
|
300
|
+
# | |
|
301
|
+
# | 0
|
302
|
+
# | |
|
303
|
+
# | 0
|
304
|
+
# | |
|
305
|
+
# | 0
|
306
|
+
# | |
|
307
|
+
# | 0
|
308
|
+
# | |
|
309
|
+
context "Parsing log --graph output" do
|
310
|
+
setup do
|
311
|
+
fixtures = fixture("log_graph.txt").split("\n")
|
312
|
+
@log_parser = Capillary::LogParser.new
|
313
|
+
@lines = []
|
314
|
+
|
315
|
+
fixtures.reject { |f| f.strip == "" }.each do |fixture|
|
316
|
+
@lines << Capillary::Commit.parse(fixture)
|
317
|
+
@log_parser << @lines.last
|
318
|
+
end
|
319
|
+
end
|
320
|
+
|
321
|
+
should "have two branches" do
|
322
|
+
assert_equal 2, @log_parser.branches.length
|
323
|
+
end
|
324
|
+
end
|
325
|
+
|
326
|
+
# 0
|
327
|
+
# |
|
328
|
+
# 0
|
329
|
+
# |
|
330
|
+
# 0
|
331
|
+
# |\
|
332
|
+
# | 0
|
333
|
+
# | |
|
334
|
+
# | 0
|
335
|
+
# | |
|
336
|
+
# | 0
|
337
|
+
# | |
|
338
|
+
# | 0
|
339
|
+
# | |
|
340
|
+
# | 0
|
341
|
+
# | |
|
342
|
+
# | 0
|
343
|
+
# | |
|
344
|
+
# | 0
|
345
|
+
# | |
|
346
|
+
# | 0
|
347
|
+
# | |
|
348
|
+
# 0--
|
349
|
+
# | |\
|
350
|
+
# | | 0
|
351
|
+
# | | |
|
352
|
+
# | | 0
|
353
|
+
# | | |
|
354
|
+
# | | 0
|
355
|
+
# | | |
|
356
|
+
# | | 0
|
357
|
+
# | | |
|
358
|
+
# | | 0
|
359
|
+
# | | |
|
360
|
+
# | | 0
|
361
|
+
# |/ /
|
362
|
+
# 0--
|
363
|
+
# |
|
364
|
+
# 0
|
365
|
+
# |
|
366
|
+
context "Two branches forked from same commit" do
|
367
|
+
setup do
|
368
|
+
fixtures = fixture("double_fork.txt").split("\n")
|
369
|
+
@log_parser = Capillary::LogParser.new
|
370
|
+
@lines = []
|
371
|
+
|
372
|
+
fixtures.reject { |f| f.strip == "" }.each do |fixture|
|
373
|
+
@lines << Capillary::Commit.parse(fixture)
|
374
|
+
@log_parser << @lines.last
|
375
|
+
end
|
376
|
+
end
|
377
|
+
|
378
|
+
should "have three branches" do
|
379
|
+
assert_equal 3, @log_parser.branches.length
|
380
|
+
end
|
381
|
+
|
382
|
+
should "have the six commits in the first branch" do
|
383
|
+
commits = @log_parser.branches[0].collect { |c| c.id[0...7] }
|
384
|
+
|
385
|
+
assert_equal 6, commits.length
|
386
|
+
assert_equal %w[0f54800 5bdf304 2477a17 ea4d6ce fdc39f6 9002b5b], commits
|
387
|
+
end
|
388
|
+
|
389
|
+
should "have the ten commits in the second branch" do
|
390
|
+
commits = @log_parser.branches[1].collect { |c| c.id[0...7] }
|
391
|
+
|
392
|
+
assert_equal 10, commits.length
|
393
|
+
assert_equal %w[2477a17 13c727b bd73540 6fb3997 9266f54 a5f9deb 1551dfe 16d2ac1 1e69972 fdc39f6], commits
|
394
|
+
end
|
395
|
+
|
396
|
+
should "have the eight commits in the third branch" do
|
397
|
+
commits = @log_parser.branches[2].collect { |c| c.id[0...7] }
|
398
|
+
|
399
|
+
assert_equal 8, commits.length
|
400
|
+
assert_equal %w[ea4d6ce 74510fd 09b2486 4f0eaf7 fe57cfc cbdfa12 81febec fdc39f6], commits
|
401
|
+
end
|
402
|
+
end
|
403
|
+
|
404
|
+
# 0
|
405
|
+
# |\
|
406
|
+
# | 0
|
407
|
+
# | |
|
408
|
+
context "Two dangling branches" do
|
409
|
+
setup do
|
410
|
+
log = <<-GIT
|
411
|
+
ca2d07e0172565c9e0f18d41e49b70d7d75fced6§3370cb3615b3368be97c0f39b86f5dc2f9fa3650 c4e7446e2a98f1bf28da51fc57bb42b532222942§Tue May 10 12:47:08 2011 +0200§christian@gitorious.org§§Merge branch 'merge-requests/2230'§
|
412
|
+
c4e7446e2a98f1bf28da51fc57bb42b532222942§c3e1d675667939e64ced1bb5b541c9042a1d60f8§Tue May 10 12:41:19 2011 +0200§christian@gitorious.org§§Merge commit 'refs/merge-requests/2230' of gitorious.org:gitorious/mainline into merge-requests/2230§
|
413
|
+
GIT
|
414
|
+
|
415
|
+
@log_parser = Capillary::LogParser.new
|
416
|
+
log.split("\n").each { |l| @log_parser << l }
|
417
|
+
end
|
418
|
+
|
419
|
+
should "have two branches" do
|
420
|
+
assert_equal 2, branches.length
|
421
|
+
end
|
422
|
+
|
423
|
+
should "have one commit in first branch" do
|
424
|
+
assert_equal %w[ca2d07e], commits_for_branch(0)
|
425
|
+
end
|
426
|
+
|
427
|
+
should "have two commits in second branch" do
|
428
|
+
assert_equal %w[ca2d07e c4e7446], commits_for_branch(1)
|
429
|
+
end
|
430
|
+
end
|
431
|
+
|
432
|
+
# 0
|
433
|
+
# |
|
434
|
+
# 0
|
435
|
+
# |\
|
436
|
+
# | 0
|
437
|
+
# | |
|
438
|
+
context "Two dangling branches with leading commit" do
|
439
|
+
setup do
|
440
|
+
log = <<-GIT
|
441
|
+
1f2b8a4e3f61ffedf9908e28b280de8c6bf38a16§ca2d07e0172565c9e0f18d41e49b70d7d75fced6§Tue May 10 13:04:10 2011 +0200§christian@gitorious.org§§Some commit§
|
442
|
+
ca2d07e0172565c9e0f18d41e49b70d7d75fced6§3370cb3615b3368be97c0f39b86f5dc2f9fa3650 c4e7446e2a98f1bf28da51fc57bb42b532222942§Tue May 10 12:47:08 2011 +0200§christian@gitorious.org§§Merge branch 'merge-requests/2230'§
|
443
|
+
c4e7446e2a98f1bf28da51fc57bb42b532222942§c3e1d675667939e64ced1bb5b541c9042a1d60f8§Tue May 10 12:41:19 2011 +0200§christian@gitorious.org§§Merge commit 'refs/merge-requests/2230' of gitorious.org:gitorious/mainline into merge-requests/2230§
|
444
|
+
GIT
|
445
|
+
|
446
|
+
@log_parser = Capillary::LogParser.new
|
447
|
+
log.split("\n").each { |l| @log_parser << l }
|
448
|
+
end
|
449
|
+
|
450
|
+
should "have two branches" do
|
451
|
+
assert_equal 2, branches.length
|
452
|
+
end
|
453
|
+
|
454
|
+
should "have two commits in first branch" do
|
455
|
+
assert_equal %w[1f2b8a4 ca2d07e], commits_for_branch(0)
|
456
|
+
end
|
457
|
+
|
458
|
+
should "have two commits in second branch" do
|
459
|
+
assert_equal %w[ca2d07e c4e7446], commits_for_branch(1)
|
460
|
+
end
|
461
|
+
end
|
462
|
+
|
463
|
+
# 0
|
464
|
+
# |\
|
465
|
+
# 0-|
|
466
|
+
# | |\
|
467
|
+
# | | 0
|
468
|
+
# | | |
|
469
|
+
context "Three dangling branches" do
|
470
|
+
setup do
|
471
|
+
log = <<-GIT
|
472
|
+
1f2b8a4e3f61ffedf9908e28b280de8c6bf38a16§ca2d07e0172565c9e0f18d41e49b70d7d75fced6 275932ab0995a11fcebeb0af7f19a7b8df5dea3f§Tue May 10 13:04:10 2011 +0200§christian@gitorious.org§§Some commit§
|
473
|
+
ca2d07e0172565c9e0f18d41e49b70d7d75fced6§3370cb3615b3368be97c0f39b86f5dc2f9fa3650 c4e7446e2a98f1bf28da51fc57bb42b532222942§Tue May 10 12:47:08 2011 +0200§christian@gitorious.org§§Merge branch 'merge-requests/2230'§
|
474
|
+
c4e7446e2a98f1bf28da51fc57bb42b532222942§c3e1d675667939e64ced1bb5b541c9042a1d60f8§Tue May 10 12:41:19 2011 +0200§christian@gitorious.org§§Merge commit 'refs/merge-requests/2230' of gitorious.org:gitorious/mainline into merge-requests/2230§
|
475
|
+
GIT
|
476
|
+
|
477
|
+
@log_parser = Capillary::LogParser.new
|
478
|
+
log.split("\n").each { |l| @log_parser << l }
|
479
|
+
end
|
480
|
+
|
481
|
+
should "have three branches" do
|
482
|
+
assert_equal 3, branches.length
|
483
|
+
end
|
484
|
+
|
485
|
+
should "have two commits in first branch" do
|
486
|
+
assert_equal %w[1f2b8a4 ca2d07e], commits_for_branch(0)
|
487
|
+
end
|
488
|
+
|
489
|
+
should "have one commit in second branch" do
|
490
|
+
assert_equal %w[1f2b8a4], commits_for_branch(1)
|
491
|
+
end
|
492
|
+
|
493
|
+
should "have two commits in third branch" do
|
494
|
+
assert_equal %w[ca2d07e c4e7446], commits_for_branch(2)
|
495
|
+
end
|
496
|
+
end
|
497
|
+
|
498
|
+
# 0--
|
499
|
+
# | \
|
500
|
+
# 0 |
|
501
|
+
# |\ |
|
502
|
+
# | 0 |
|
503
|
+
# | | 0
|
504
|
+
# |/ |
|
505
|
+
# 0 |
|
506
|
+
# |\ |
|
507
|
+
# | 0 |
|
508
|
+
# | | |
|
509
|
+
context "Three dangling branches with closed branch" do
|
510
|
+
setup do
|
511
|
+
log = <<-GIT
|
512
|
+
0000000000000000000000000000000000000000§1111111111111111111111111111111111111111 3333333333333333333333333333333333333333§Tue May 10 13:00:00 2011 +0200§christian@gitorious.org§§Message§
|
513
|
+
1111111111111111111111111111111111111111§4444444444444444444444444444444444444444 2222222222222222222222222222222222222222§Tue May 10 12:00:00 2011 +0200§christian@gitorious.org§§Message§
|
514
|
+
2222222222222222222222222222222222222222§4444444444444444444444444444444444444444§Tue May 10 11:00:00 2011 +0200§christian@gitorious.org§§Message§
|
515
|
+
3333333333333333333333333333333333333333§6666666666666666666666666666666666666666§Tue May 10 10:00:00 2011 +0200§christian@gitorious.org§§Message§
|
516
|
+
4444444444444444444444444444444444444444§7777777777777777777777777777777777777777 5555555555555555555555555555555555555555§Tue May 10 09:00:00 2011 +0200§christian@gitorious.org§§Message§
|
517
|
+
5555555555555555555555555555555555555555§8888888888888888888888888888888888888888§Tue May 10 08:00:00 2011 +0200§christian@gitorious.org§§Message§
|
518
|
+
GIT
|
519
|
+
|
520
|
+
@log_parser = Capillary::LogParser.new
|
521
|
+
log.split("\n").each { |l| @log_parser << l }
|
522
|
+
end
|
523
|
+
|
524
|
+
should "have four branches" do
|
525
|
+
assert_equal 4, branches.length
|
526
|
+
end
|
527
|
+
|
528
|
+
should "have three commits in first branch" do
|
529
|
+
assert_equal %w[0000000 1111111 4444444], commits_for_branch(0)
|
530
|
+
end
|
531
|
+
|
532
|
+
should "two commits in second branch" do
|
533
|
+
assert_equal %w[0000000 3333333], commits_for_branch(1)
|
534
|
+
end
|
535
|
+
|
536
|
+
should "have three commits in third branch" do
|
537
|
+
assert_equal %w[1111111 2222222 4444444], commits_for_branch(2)
|
538
|
+
end
|
539
|
+
|
540
|
+
should "have two commits in fourth branch" do
|
541
|
+
assert_equal %w[4444444 5555555], commits_for_branch(3)
|
542
|
+
end
|
543
|
+
end
|
544
|
+
|
545
|
+
# 0
|
546
|
+
# |\
|
547
|
+
# | 0
|
548
|
+
# | |\
|
549
|
+
# | | 0
|
550
|
+
# |/ |
|
551
|
+
# 0 |
|
552
|
+
# |\ |
|
553
|
+
# | 0 |
|
554
|
+
# | | |
|
555
|
+
# | 0 |
|
556
|
+
# | | |
|
557
|
+
# | 0-|
|
558
|
+
# | | |\
|
559
|
+
# | | | 0
|
560
|
+
# |/ | |
|
561
|
+
# 0 | |
|
562
|
+
# |\ | |
|
563
|
+
# | 0 | |
|
564
|
+
# | | | |
|
565
|
+
context "Four dangling branches" do
|
566
|
+
setup do
|
567
|
+
load_fixture("4x_dangling_branches.txt")
|
568
|
+
end
|
569
|
+
|
570
|
+
should "have seven branches" do
|
571
|
+
assert_equal 6, branches.length
|
572
|
+
end
|
573
|
+
|
574
|
+
should "have 3 commits in the first branch" do
|
575
|
+
assert_equal %w[44c5c1d 1f2b8a4 ca2d07e], commits_for_branch(0)
|
576
|
+
end
|
577
|
+
|
578
|
+
should "have 3 commits in the second branch" do
|
579
|
+
assert_equal %w[44c5c1d e81d019 1f2b8a4], commits_for_branch(1)
|
580
|
+
end
|
581
|
+
|
582
|
+
should "have 2 commits in the third branch" do
|
583
|
+
assert_equal %w[e81d019 bbbd502], commits_for_branch(2)
|
584
|
+
end
|
585
|
+
|
586
|
+
should "have 5 commits in the fourth branch" do
|
587
|
+
assert_equal %w[1f2b8a4 275932a 7487183 a2f271b ca2d07e], commits_for_branch(3)
|
588
|
+
end
|
589
|
+
|
590
|
+
should "have 2 commits in the fifth branch" do
|
591
|
+
assert_equal %w[a2f271b 3ec0ec6], commits_for_branch(4)
|
592
|
+
end
|
593
|
+
|
594
|
+
should "have 2 commits in the sixth branch" do
|
595
|
+
assert_equal %w[ca2d07e c4e7446], commits_for_branch(5)
|
596
|
+
end
|
597
|
+
end
|
598
|
+
|
268
599
|
context "Streaming parser" do
|
269
600
|
setup do
|
270
601
|
@lines = fixture("complex_graph_no_ff.txt").split("\n")
|
@@ -0,0 +1,18 @@
|
|
1
|
+
* 44c5c1d3726701942e684f1197c8f0d23c132e3e§1f2b8a4e3f61ffedf9908e28b280de8c6bf38a16 e81d019a466d135ea37dba95284af15bb0e12ed0§Tue May 10 13:51:23 2011 +0200§christian@gitorious.org§§Merge branch 'merge-requests/2222'§
|
2
|
+
|\
|
3
|
+
| * e81d019a466d135ea37dba95284af15bb0e12ed0§1f2b8a4e3f61ffedf9908e28b280de8c6bf38a16 bbbd50287162c64401d610d26634767c8b6fbba2§Tue May 10 13:38:18 2011 +0200§christian@gitorious.org§§Merge commit 'refs/merge-requests/2222' of gitorious.org:gitorious/mainline into merge-requests/2222§
|
4
|
+
| |\
|
5
|
+
|/ /
|
6
|
+
| * bbbd50287162c64401d610d26634767c8b6fbba2§a28894f12d2dbb28b7e1ba9ed7b751200b4758e8§Thu Dec 16 13:28:23 2010 +0100§pkj@axis.com§§Allow raw blobs to be retrieved using a blob SHA-1§
|
7
|
+
* | 1f2b8a4e3f61ffedf9908e28b280de8c6bf38a16§ca2d07e0172565c9e0f18d41e49b70d7d75fced6 275932ab0995a11fcebeb0af7f19a7b8df5dea3f§Tue May 10 13:04:10 2011 +0200§christian@gitorious.org§§Merge branch 'merge-requests/147'§
|
8
|
+
|\ \
|
9
|
+
| * | 275932ab0995a11fcebeb0af7f19a7b8df5dea3f§74871838e08fc666e9006cae35cdc67a5dcea258§Tue May 10 13:03:58 2011 +0200§christian@gitorious.org§§Add test for redirect from openid creation to dashboard§
|
10
|
+
| * | 74871838e08fc666e9006cae35cdc67a5dcea258§a2f271b1aa55e52ba848779c62a6fa02cbc5ea0c§Tue May 10 13:01:00 2011 +0200§christian@gitorious.org§§Formatting§
|
11
|
+
| * | a2f271b1aa55e52ba848779c62a6fa02cbc5ea0c§ca2d07e0172565c9e0f18d41e49b70d7d75fced6 3ec0ec68ac9ae2db3f222dfe1842cd2c6812cf97§Tue May 10 12:50:35 2011 +0200§christian@gitorious.org§§Merge commit 'refs/merge-requests/147' of gitorious.org:gitorious/mainline into merge-requests/147§
|
12
|
+
| |\ \
|
13
|
+
|/ / /
|
14
|
+
| * | 3ec0ec68ac9ae2db3f222dfe1842cd2c6812cf97§0685c52dd27dba8eaa6ec6f6bfacf014d37a6a1b§Tue Apr 12 10:04:20 2011 +1000§openid@obfusc8.org§§Bug: Do not redirect_back_or_default on new OpenID§
|
15
|
+
* | | ca2d07e0172565c9e0f18d41e49b70d7d75fced6§3370cb3615b3368be97c0f39b86f5dc2f9fa3650 c4e7446e2a98f1bf28da51fc57bb42b532222942§Tue May 10 12:47:08 2011 +0200§christian@gitorious.org§§Merge branch 'merge-requests/2230'§
|
16
|
+
|\ \ \
|
17
|
+
| * \ \ c4e7446e2a98f1bf28da51fc57bb42b532222942§c3e1d675667939e64ced1bb5b541c9042a1d60f8 c1e52fba9e7c88f1146bb6df1f8b58dff006f45e§Tue May 10 12:41:19 2011 +0200§christian@gitorious.org§§Merge commit 'refs/merge-requests/2230' of gitorious.org:gitorious/mainline into merge-requests/2230§
|
18
|
+
| |\ \ \
|
@@ -0,0 +1,20 @@
|
|
1
|
+
0f5480086cb66c10759334aa4f2bb803a074dc99§5bdf304b3fb6ecddf89c855c7509c0e6bb2fd7fc§Mon Jul 11 13:44:29 2011 +0200§christian@gitorious.org§ (HEAD, master)§Readme noise§
|
2
|
+
5bdf304b3fb6ecddf89c855c7509c0e6bb2fd7fc§2477a17e05dedcc101bddd94d836a892a3b330c1§Fri May 27 14:23:48 2011 +0200§christian@gitorious.org§ (zero, whateverss, whatever, topic, retsamz, retsamFsdfks, retsamFsdfkj, retsamFsdfk, retsamF, retsam, ohfuck, noness, nones, none, newbie, mutt-baby2, mutt-baby, fuckyeah22131, fuckyeah2213, fuckyeah22, fuckyeah2, chomba5, authfuckup9, authfuckup8, authfuckup7, authfuckup6, authfuckup5, authfuckup4, authfuckup3, authfuckup2, authfuckup10, authfuckup, 00000)§Updated acts as taggable has renamed the tag class§
|
3
|
+
2477a17e05dedcc101bddd94d836a892a3b330c1§ea4d6ce31bff83a64f6c0f76def8f9431cc344ed 13c727b96b4040bc7932d1fbb8bc7d91497a6cc7§Fri May 27 10:45:35 2011 +0200§christian@gitorious.org§§Resolve merge conflict§
|
4
|
+
13c727b96b4040bc7932d1fbb8bc7d91497a6cc7§bd73540d175c48ab48311d88d52c63493faa33bd§Tue May 24 15:53:33 2011 +0200§marius@gitorious.org§§Prevent Messages#index from choking on senders being removed.§
|
5
|
+
bd73540d175c48ab48311d88d52c63493faa33bd§6fb3997a0385b015147f2d4a92caf78ccd22421e§Mon May 23 16:13:59 2011 +0200§marius@gitorious.org§§Revert "Fix a bug in Grit that causes rev_list to show commits in the wrong order."§
|
6
|
+
6fb3997a0385b015147f2d4a92caf78ccd22421e§9266f54dd9669eae5c18d24ec2edc5262d7e4896§Mon May 23 16:10:49 2011 +0200§marius@gitorious.org§§Fix a bug in Grit that causes rev_list to show commits in the wrong order.§
|
7
|
+
9266f54dd9669eae5c18d24ec2edc5262d7e4896§a5f9deb5cdc87e1e350a0e8a20b24b416bde1d3b§Thu May 19 15:33:23 2011 +0200§marius@gitorious.org§§Taking a stab at making a solr adapter for Gitorious::Search§
|
8
|
+
a5f9deb5cdc87e1e350a0e8a20b24b416bde1d3b§1551dfe855f6351c6d8376ea857a307c239e6c2c§Wed May 18 15:56:28 2011 +0200§marius@gitorious.org§§Moving search components into separate files/modules§
|
9
|
+
1551dfe855f6351c6d8376ea857a307c239e6c2c§16d2ac1cd6bedb231a4c0c85d313c8ffaac4debf§Wed May 18 15:04:28 2011 +0200§marius@gitorious.org§§Wrapped the various calls to the Sphinx wrapper§
|
10
|
+
16d2ac1cd6bedb231a4c0c85d313c8ffaac4debf§1e69972be452c595987e832e7b974647f58a9258§Wed May 18 09:14:02 2011 +0200§marius@gitorious.org§§Models that should be searchable should include Gitorious::Search§
|
11
|
+
1e69972be452c595987e832e7b974647f58a9258§fdc39f6f7af5961b1ca592dfbc5dff28dfe71d69§Mon May 16 17:27:17 2011 +0200§marius@gitorious.org§§Adding a wrapper around Ultrasphinx: Gitorious::Search§
|
12
|
+
ea4d6ce31bff83a64f6c0f76def8f9431cc344ed§fdc39f6f7af5961b1ca592dfbc5dff28dfe71d69 74510fd077bb0dd686fff77c239218c17bf00073§Mon May 16 08:22:19 2011 +0200§christian@gitorious.org§§Merge branch 'merge-requests/153'§
|
13
|
+
74510fd077bb0dd686fff77c239218c17bf00073§09b24865534f8e29d6cd1b0012852806b384a32f§Sun May 15 19:48:48 2011 -0300§rr.rosas@gmail.com§§Remove deprecation warnings from Paperclip usage§
|
14
|
+
09b24865534f8e29d6cd1b0012852806b384a32f§4f0eaf7a3e98a446574a6418dbb91c86fd74ae62§Sun May 15 19:48:08 2011 -0300§rr.rosas@gmail.com§§refactoring: remove vendored paperclip plugin as it was already in Gemfile§
|
15
|
+
4f0eaf7a3e98a446574a6418dbb91c86fd74ae62§fe57cfc4018635299f99bdf4fdd1976a2f7af40e§Sat May 14 11:13:41 2011 -0300§rr.rosas@gmail.com§§refactoring: Replaces vendored will_paginate plugin with its gem§
|
16
|
+
fe57cfc4018635299f99bdf4fdd1976a2f7af40e§cbdfa124bef64a45bfc0b4b2ba928ad2b9bf4030§Sat May 14 11:01:34 2011 -0300§rr.rosas@gmail.com§§refactoring: Replaces vendored ssl_requirement plugin with its gem§
|
17
|
+
cbdfa124bef64a45bfc0b4b2ba928ad2b9bf4030§81febec6cea77d5304f3b9efaf7bc7f53fda850a§Sat May 14 10:40:36 2011 -0300§rr.rosas@gmail.com§§refactoring: Replaces vendored exception_notifier plugin its gem§
|
18
|
+
81febec6cea77d5304f3b9efaf7bc7f53fda850a§fdc39f6f7af5961b1ca592dfbc5dff28dfe71d69§Sat May 14 09:45:00 2011 -0300§rr.rosas@gmail.com§§refactoring: Replaces vendored acts_as_taggable_on_steroids plugin with acts-as-taggable-on gem§
|
19
|
+
fdc39f6f7af5961b1ca592dfbc5dff28dfe71d69§9002b5b37bb5a56decb16bcf8b9079988669ac27§Thu May 12 22:08:09 2011 -0300§rr.rosas@gmail.com§§Remove deprecation warnings from Shoulda§
|
20
|
+
9002b5b37bb5a56decb16bcf8b9079988669ac27§5866405b13eee4a558c16b2e6feacf53982ff2f1§Thu May 12 21:57:23 2011 -0300§rr.rosas@gmail.com§§Fix indenting in unit/repository_test.rb§
|
@@ -0,0 +1,11 @@
|
|
1
|
+
* 0f5480086cb66c10759334aa4f2bb803a074dc99§5bdf304b3fb6ecddf89c855c7509c0e6bb2fd7fc§Mon Jul 11 13:44:29 2011 +0200§christian@gitorious.org§ (HEAD, master)§Readme noise§
|
2
|
+
* 5bdf304b3fb6ecddf89c855c7509c0e6bb2fd7fc§2477a17e05dedcc101bddd94d836a892a3b330c1§Fri May 27 14:23:48 2011 +0200§christian@gitorious.org§ (zero, topic, retsamz, newbie, mutt-baby2, mutt-baby, chomba5)§Updated acts as taggable has renamed the tag class§
|
3
|
+
* 2477a17e05dedcc101bddd94d836a892a3b330c1§ea4d6ce31bff83a64f6c0f76def8f9431cc344ed 13c727b96b4040bc7932d1fbb8bc7d91497a6cc7§Fri May 27 10:45:35 2011 +0200§christian@gitorious.org§§Resolve merge conflict§
|
4
|
+
|\
|
5
|
+
| * 13c727b96b4040bc7932d1fbb8bc7d91497a6cc7§bd73540d175c48ab48311d88d52c63493faa33bd§Tue May 24 15:53:33 2011 +0200§marius@gitorious.org§§Prevent Messages#index from choking on senders being removed.§
|
6
|
+
| * bd73540d175c48ab48311d88d52c63493faa33bd§6fb3997a0385b015147f2d4a92caf78ccd22421e§Mon May 23 16:13:59 2011 +0200§marius@gitorious.org§§Revert "Fix a bug in Grit that causes rev_list to show commits in the wrong order."§
|
7
|
+
| * 6fb3997a0385b015147f2d4a92caf78ccd22421e§9266f54dd9669eae5c18d24ec2edc5262d7e4896§Mon May 23 16:10:49 2011 +0200§marius@gitorious.org§§Fix a bug in Grit that causes rev_list to show commits in the wrong order.§
|
8
|
+
| * 9266f54dd9669eae5c18d24ec2edc5262d7e4896§a5f9deb5cdc87e1e350a0e8a20b24b416bde1d3b§Thu May 19 15:33:23 2011 +0200§marius@gitorious.org§§Taking a stab at making a solr adapter for Gitorious::Search§
|
9
|
+
| * a5f9deb5cdc87e1e350a0e8a20b24b416bde1d3b§1551dfe855f6351c6d8376ea857a307c239e6c2c§Wed May 18 15:56:28 2011 +0200§marius@gitorious.org§§Moving search components into separate files/modules§
|
10
|
+
| * 1551dfe855f6351c6d8376ea857a307c239e6c2c§16d2ac1cd6bedb231a4c0c85d313c8ffaac4debf§Wed May 18 15:04:28 2011 +0200§marius@gitorious.org§§Wrapped the various calls to the Sphinx wrapper§
|
11
|
+
| * 16d2ac1cd6bedb231a4c0c85d313c8ffaac4debf§1e69972be452c595987e832e7b974647f58a9258§Wed May 18 09:14:02 2011 +0200§marius@gitorious.org§§Models that should be searchable should include Gitorious::Search§
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capillary
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 2
|
10
|
+
version: 0.2.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Marius Mathiesen
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-08-
|
19
|
+
date: 2011-08-23 00:00:00 +02:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
@@ -89,9 +89,12 @@ files:
|
|
89
89
|
- lib/capillary/version.rb
|
90
90
|
- test/capillary/commit_test.rb
|
91
91
|
- test/capillary/log_parser_test.rb
|
92
|
+
- test/fixtures/4x_dangling_branches.txt
|
92
93
|
- test/fixtures/complex_graph.txt
|
93
94
|
- test/fixtures/complex_graph_no_ff.txt
|
95
|
+
- test/fixtures/double_fork.txt
|
94
96
|
- test/fixtures/first_commit.txt
|
97
|
+
- test/fixtures/log_graph.txt
|
95
98
|
- test/fixtures/parent_commit.txt
|
96
99
|
- test/fixtures/simple_graph_no_ff.txt
|
97
100
|
- test/fixtures/third_commit.txt
|