git-maintain 0.2.2.pre.17.g20dc612 → 0.2.2.pre.20.g5532fb0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -1
- data/lib/branch.rb +3 -3
- data/lib/repo.rb +11 -12
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 544badee7e7e98d99bce948243a45eec5ad001d18e68d827188c171d7bd138b5
|
4
|
+
data.tar.gz: e878c8f846377d1abc3778bbff1c55410dae0de8b841d7402a6567c94566525f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b17ac2069b9c7c193f94ae7a72649693adf2cb661db65788373d59be1d46de0cdcc5cbccca67a9e99dcc4e6512168419020335c1a41c3c2c9b97d2f9606721b
|
7
|
+
data.tar.gz: b719766f18390b104953db995c8a6a0278a8a47d735ce728d3f60ee3dc6f6224dd626daefa10c3ab22b769aeffc43acd2baaeac5ed8800f7b84dee12b262fd2a
|
data/README.md
CHANGED
@@ -27,9 +27,11 @@ The idea is to script most of the maintenance tasks so the maintainer can focus
|
|
27
27
|
- Load git-maintain-completion.sh for shell completion
|
28
28
|
|
29
29
|
## Remote setup
|
30
|
-
- the 'github' remote should be your own WIP github to test out branches before submitting to the official repo
|
30
|
+
- the 'github' remote should be your own WIP github to test out branches before submitting to the official repo.
|
31
|
+
Also know as the 'Validation' repo. It can be switched to another remote by setting maintain.valid-repo=xxx in your gitconfig
|
31
32
|
- the 'origin' remote should be the official repo in read-only mode to avoid any accidental pushes
|
32
33
|
- the 'stable' remote should be the official repo in RW mode
|
34
|
+
Also know as the 'Stable' repo. It can be switched to another remote by setting maintain.stable-repo=xxx in your gitconfig
|
33
35
|
|
34
36
|
## Stealing commits
|
35
37
|
|
data/lib/branch.rb
CHANGED
@@ -135,7 +135,7 @@ module GitMaintain
|
|
135
135
|
end
|
136
136
|
|
137
137
|
@head = @repo.runGit("rev-parse #{@local_branch}")
|
138
|
-
@remote_ref = "#{@repo.
|
138
|
+
@remote_ref = "#{@repo.stable_repo}/#{@remote_branch}"
|
139
139
|
@stable_head = @repo.runGit("rev-parse #{@remote_ref}")
|
140
140
|
@stable_base = @repo.findStableBase(@local_branch)
|
141
141
|
|
@@ -202,7 +202,7 @@ module GitMaintain
|
|
202
202
|
|
203
203
|
# Push the branch to the validation repo
|
204
204
|
def push(opts)
|
205
|
-
@repo.runGit("push #{opts[:push_force] == true ? "-f" : ""} #{@repo.
|
205
|
+
@repo.runGit("push #{opts[:push_force] == true ? "-f" : ""} #{@repo.valid_repo} #{@local_branch}")
|
206
206
|
end
|
207
207
|
|
208
208
|
# Monitor the build status on Travis
|
@@ -237,7 +237,7 @@ module GitMaintain
|
|
237
237
|
end
|
238
238
|
rep = GitMaintain::checkLog(opts, @local_branch, @remote_ref, "submit")
|
239
239
|
if rep == "y" then
|
240
|
-
@repo.runGit("push #{@repo.
|
240
|
+
@repo.runGit("push #{@repo.stable_repo} #{@local_branch}:#{@remote_branch}")
|
241
241
|
else
|
242
242
|
puts "Skipping push to stable"
|
243
243
|
return
|
data/lib/repo.rb
CHANGED
@@ -36,13 +36,6 @@ module GitMaintain
|
|
36
36
|
repo.send(action, opts)
|
37
37
|
end
|
38
38
|
|
39
|
-
def getValidRepo()
|
40
|
-
return @@VALID_REPO
|
41
|
-
end
|
42
|
-
def getStableRepo()
|
43
|
-
return @@STABLE_REPO
|
44
|
-
end
|
45
|
-
|
46
39
|
def initialize(path=nil)
|
47
40
|
GitMaintain::checkDirectConstructor(self.class)
|
48
41
|
|
@@ -54,9 +47,15 @@ module GitMaintain
|
|
54
47
|
if path == nil
|
55
48
|
@path = Dir.pwd()
|
56
49
|
end
|
57
|
-
|
50
|
+
|
51
|
+
@valid_repo = runGit("config maintain.valid-repo 2> /dev/null").chomp()
|
52
|
+
@valid_repo = @@VALID_REPO if @valid_repo == ""
|
53
|
+
@stable_repo = runGit("config maintain.stable-repo 2>/dev/null").chomp()
|
54
|
+
@stable_repo = @@STABLE_REPO if @stable_repo == ""
|
55
|
+
|
56
|
+
@remote_valid=runGit("remote -v | egrep '^#{@valid_repo}' | grep fetch |
|
58
57
|
awk '{ print $2}' | sed -e 's/.*://' -e 's/\.git//'")
|
59
|
-
@remote_stable=runGit("remote -v | egrep '^#{
|
58
|
+
@remote_stable=runGit("remote -v | egrep '^#{@stable_repo}' | grep fetch |
|
60
59
|
awk '{ print $2}' | sed -e 's/.*://' -e 's/\.git//'")
|
61
60
|
@stable_base_patterns=
|
62
61
|
runGit("config --get-regexp stable-base | egrep '^stable-base\.' | "+
|
@@ -66,7 +65,7 @@ module GitMaintain
|
|
66
65
|
m
|
67
66
|
}
|
68
67
|
end
|
69
|
-
attr_reader :path, :remote_valid, :remote_stable
|
68
|
+
attr_reader :path, :remote_valid, :remote_stable, :valid_repo, :stable_repo
|
70
69
|
|
71
70
|
def run(cmd)
|
72
71
|
return `cd #{@path} && #{cmd}`
|
@@ -93,7 +92,7 @@ module GitMaintain
|
|
93
92
|
|
94
93
|
def stableUpdate()
|
95
94
|
puts "# Fetching stable updates..."
|
96
|
-
runGit("fetch #{
|
95
|
+
runGit("fetch #{@stable_repo}")
|
97
96
|
end
|
98
97
|
def getStableList(br_suff)
|
99
98
|
return @stable_list if @stable_list != nil
|
@@ -118,7 +117,7 @@ module GitMaintain
|
|
118
117
|
end
|
119
118
|
|
120
119
|
def submitReleases(opts)
|
121
|
-
remote_tags=runGit("ls-remote --tags #{
|
120
|
+
remote_tags=runGit("ls-remote --tags #{@stable_repo} |
|
122
121
|
egrep 'refs/tags/v[0-9.]*$'").split("\n").map(){
|
123
122
|
|x| x.gsub(/.*refs\/tags\//, '')
|
124
123
|
}
|