mgit 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/mgit/commands/ffmerge.rb +8 -1
- data/lib/mgit/commands/log.rb +1 -16
- data/lib/mgit/repository.rb +15 -0
- data/lib/mgit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZjNmMTI1NTJjZWIzMjNhNGUzODNhYTZjZThlZGU3N2M5NTI1NDQ1Mw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MjMyZTNiYjBlMTgyMzg5ZWRmYzQ5YjQzYzAyY2VlZmYwZGRmODgxZA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
M2EyYjBkYzg5ZDdiZjIwZWJjZDIyYzNkMTM0MTJlNzNjMjgxYTA0ZTcxZWIw
|
10
|
+
OTJhYWU2NDIzNjlmYzEzOGQ2NmY0M2UxN2Y3ZGMwZmEyMDViN2I4M2QxM2U1
|
11
|
+
ZTYxZWJmZGFiOGMyMjI2ZWNmMTFiMWMwZGFkNWI1ZThlYjUzN2U=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
Y2RjNTlmMGYzMmI2MGU3YzMzYmMwZGYxNTljYTMxNjNkNTc0OTdiY2U5YWU4
|
14
|
+
NjJiZmMwMTc0ZDkxOWQzY2M0MGRkN2NiYmI5NmE2NDNiYTg2ZDdhN2VlN2Jh
|
15
|
+
ZDYyOTNjMDcxNWZlNmRjYTlkMmExZDQxODgwZGZhODBiNWUwNTU=
|
@@ -2,6 +2,13 @@ module MGit
|
|
2
2
|
class FFMergeCommand < Command
|
3
3
|
def execute(args)
|
4
4
|
Registry.chdir_each do |repo|
|
5
|
+
|
6
|
+
bs = repo.remote_tracking_branches.select do |branch, upstream|
|
7
|
+
!repo.unmerged_commits(branch, upstream).empty?
|
8
|
+
end.map { |b, u| b }
|
9
|
+
|
10
|
+
next if bs.empty?
|
11
|
+
|
5
12
|
if repo.dirty?
|
6
13
|
pwarn "Skipping repository #{repo.name} since it's dirty."
|
7
14
|
next
|
@@ -10,7 +17,7 @@ module MGit
|
|
10
17
|
pinfo "Fast-forward merging branches in repository #{repo.name}..."
|
11
18
|
|
12
19
|
cb = repo.current_branch
|
13
|
-
|
20
|
+
bs.each do |b|
|
14
21
|
`git checkout -q #{b}`
|
15
22
|
`git merge --ff-only @{u}`
|
16
23
|
end
|
data/lib/mgit/commands/log.rb
CHANGED
@@ -3,7 +3,7 @@ module MGit
|
|
3
3
|
def execute(args)
|
4
4
|
Registry.chdir_each do |repo|
|
5
5
|
repo.remote_tracking_branches.each do |branch, upstream|
|
6
|
-
uc = unmerged_commits(branch, upstream)
|
6
|
+
uc = repo.unmerged_commits(branch, upstream)
|
7
7
|
next if uc.empty?
|
8
8
|
|
9
9
|
pinfo "In repository #{repo.name}, branch #{upstream} the following commits were made:"
|
@@ -28,20 +28,5 @@ module MGit
|
|
28
28
|
end
|
29
29
|
|
30
30
|
register_command :log
|
31
|
-
|
32
|
-
private
|
33
|
-
|
34
|
-
def unmerged_commits(branch, upstream)
|
35
|
-
`git log --pretty=format:"%h#%an#%s" --reverse --relative-date #{branch}..#{upstream}`.
|
36
|
-
split("\n").
|
37
|
-
map { |line| line.split('#') }.
|
38
|
-
map do |words|
|
39
|
-
{
|
40
|
-
:commit => words[0],
|
41
|
-
:author => words[1],
|
42
|
-
:subject => words[2..-1].join('#')
|
43
|
-
}
|
44
|
-
end
|
45
|
-
end
|
46
31
|
end
|
47
32
|
end
|
data/lib/mgit/repository.rb
CHANGED
@@ -36,6 +36,21 @@ module MGit
|
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
|
+
def unmerged_commits(branch, upstream)
|
40
|
+
in_repo do
|
41
|
+
`git log --pretty=format:"%h#%an#%s" --reverse --relative-date #{branch}..#{upstream}`.
|
42
|
+
split("\n").
|
43
|
+
map { |line| line.split('#') }.
|
44
|
+
map do |words|
|
45
|
+
{
|
46
|
+
:commit => words[0],
|
47
|
+
:author => words[1],
|
48
|
+
:subject => words[2..-1].join('#')
|
49
|
+
}
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
39
54
|
def flags
|
40
55
|
flags = Set.new
|
41
56
|
status_lines do |s|
|
data/lib/mgit/version.rb
CHANGED