sugarjar 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2e9576a717ef65aa68a0a7f46e883245fc7e288a9884924658484f68e5d78470
4
- data.tar.gz: 420299217d7e184c8129634351f5b9dc3ee336207d9c4a5ee3dd3d5ea64b0c31
3
+ metadata.gz: 22bcfbf2376fe2665d068e42a3a2263c13602ac0a534fc958efbedd959e89862
4
+ data.tar.gz: c817adecadb1c3886cc8b8cfb105a1f844e5cfb90f32f351c17647d28ab21e68
5
5
  SHA512:
6
- metadata.gz: 0d68dfb58e071f078ac63e3781db4dbea649a95ddbf0d9afce7b1361d74baa6ea0264df426260d3124f6a23a89cddeafc3efd83bc52670fb5210d388f2c28adb
7
- data.tar.gz: c226c00b7332803a686d82cd2a916212f09c476c50afbe7ae7f0a95e510d59ba2ae2bd553fbaa0af3601f01e90ef5c63e6b56fde13b38ff180553a3c1f48e0a0
6
+ metadata.gz: 1e2d3c3cc050f9da5432333559e8338fcb9312fd42be1b254f31a9e553440f0c2f4b86da8d93ccc6c58f6647bed931808ba714a893a8e868e6d439b2e29e74b0
7
+ data.tar.gz: d74d2118706f4c3386b27a6a23bd594301c3c5621e2da72fd08c6dcd3e6c59917f0cef11cb9fad2c93f99e942ff175c512766510c8c510d7158240bd4d6ea3bc
data/bin/sj CHANGED
@@ -144,6 +144,9 @@ end
144
144
  # we parse later. We also need a pristine copy in case we want to
145
145
  # run git as we were called.
146
146
  argv_copy = ARGV.dup
147
+
148
+ # We don't have options yet, but we need an instance of SJ in order
149
+ # to list public methods. We will recreate it
147
150
  sj = SugarJar::Commands.new(options)
148
151
  extra_opts = []
149
152
 
@@ -204,6 +207,9 @@ if ARGV.empty?
204
207
  end
205
208
 
206
209
  options = config.merge(options)
210
+
211
+ # Recreate SJ with all of our options
212
+ sj = SugarJar::Commands.new(options)
207
213
  SugarJar::Log.level = options['log_level'].to_sym if options['log_level']
208
214
 
209
215
  subcommand = argv_copy.reject { |x| x.start_with?('-') }.first
@@ -11,6 +11,7 @@ class SugarJar
11
11
  include SugarJar::Util
12
12
 
13
13
  def initialize(options)
14
+ SugarJar::Log.debug("Commands.initialize options: #{options}")
14
15
  @ghuser = options['github_user']
15
16
  @ghhost = options['github_host']
16
17
  @repo_config = SugarJar::RepoConfig.config
@@ -231,10 +232,14 @@ class SugarJar
231
232
  return false
232
233
  end
233
234
  s = Mixlib::ShellOut.new(check).run_command
234
- if s.error?
235
- SugarJar::Log.info("#{type} #{check} failed\n#{s.stdout}")
236
- return false
237
- end
235
+ next unless s.error?
236
+
237
+ SugarJar::Log.info(
238
+ "#{type} #{check} failed, output follows (use debug for more)\n" +
239
+ s.stdout.to_s,
240
+ )
241
+ SugarJar::Log.debug(s.format_for_exception)
242
+ return false
238
243
  end
239
244
  end
240
245
  end
@@ -353,8 +358,18 @@ class SugarJar
353
358
  def gitup
354
359
  SugarJar::Log.debug('Fetching upstream')
355
360
  fetch_upstream
361
+ curr = current_branch
356
362
  SugarJar::Log.debug('Rebasing')
357
363
  base = tracked_branch
364
+ if curr != 'master' && base == "origin/#{curr}"
365
+ SugarJar::Log.warn(
366
+ "This branch is tracking origin/#{curr}, which is probably your " +
367
+ 'downstream (where you push _to_) as opposed to your upstream ' +
368
+ '(where you pull _from_). This means that "sj up" is probably ' +
369
+ 'rebasing on the wrong thing and doing nothing. You probably want ' +
370
+ 'to do a "git branch -u upstream".',
371
+ )
372
+ end
358
373
  s = hub_nofail('rebase', base)
359
374
  s.error? ? nil : base
360
375
  end
@@ -6,7 +6,7 @@ class SugarJar
6
6
  # This is stuff like log level, github-user, etc.
7
7
  class Config
8
8
  DEFAULTS = {
9
- 'ghuser' => ENV['USER'],
9
+ 'github_user' => ENV['USER'],
10
10
  'fallthru' => true,
11
11
  }.freeze
12
12
 
@@ -1,3 +1,3 @@
1
1
  class SugarJar
2
- VERSION = '0.0.4'.freeze
2
+ VERSION = '0.0.5'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sugarjar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Phil Dibowitz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-17 00:00:00.000000000 Z
11
+ date: 2020-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-log