git-maintain 0.2.2.pre.17.g20dc612 → 0.2.2.pre.20.g5532fb0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -1
  3. data/lib/branch.rb +3 -3
  4. data/lib/repo.rb +11 -12
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 240b6bd240fc20b4e3341f843f06c45fd55f03140498e5bffb8cbeebebbb6256
4
- data.tar.gz: c2e6cd3928921c2b85fad72a5b82e22184cb2cc8d0b731056d5ae9dd473bc4f3
3
+ metadata.gz: 544badee7e7e98d99bce948243a45eec5ad001d18e68d827188c171d7bd138b5
4
+ data.tar.gz: e878c8f846377d1abc3778bbff1c55410dae0de8b841d7402a6567c94566525f
5
5
  SHA512:
6
- metadata.gz: ed2bf140560ceec97931c80a866c4feea698081a4769922c28a48915c88ecfdb20a2626b962d50d9ee53b931358b1008ba9d976698a58966c42d4077d0c57059
7
- data.tar.gz: 75116df9f34d345dad6e894c3dddecf791c32a4d68cd3309050c40e6240290459a1420ad29211ec9a54b72e7b10f86591ab30f59bc3427e09b6ee18327bda3e2
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.getStableRepo()}/#{@remote_branch}"
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.getValidRepo()} #{@local_branch}")
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.getStableRepo()} #{@local_branch}:#{@remote_branch}")
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
- @remote_valid=runGit("remote -v | egrep '^#{@@VALID_REPO}' | grep fetch |
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 '^#{@@STABLE_REPO}' | grep fetch |
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 #{@@STABLE_REPO}")
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 #{@@STABLE_REPO} |
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
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-maintain
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2.pre.17.g20dc612
4
+ version: 0.2.2.pre.20.g5532fb0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicolas Morey-Chaisemartin