gitmore 0.3.0 → 0.3.3

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: 3188a31d34b489877eb8f9f915b66d0640e4ec892c5f9c621433b919b0c198bf
4
- data.tar.gz: 89a78a8a0f2e620874a0f882df434a440fbeac39e5747b177dbf9bfc22989114
3
+ metadata.gz: 51b345feba69b6c47a6ed425ca53d2e65696a833e1b14b9de21e62f6328002fc
4
+ data.tar.gz: 482e79ece97515165c0b90d32e575f0da4f52377922acf84dcedf2df4189c2e9
5
5
  SHA512:
6
- metadata.gz: e323ecb6b553f18d7ed18002c8ae31c54a2505fc27cfe5b9a78256853b2c7632bdf7cba1b2babc0d21b2a0a664b0ab9fc33ca38ffc5a2bff2880926c3d3c21ef
7
- data.tar.gz: 13363cfba31561449e4ecefbde910e6fcead74d0f12e80ea697975637cc18f933e8cc33caeacc2fa4474b42102725df099450de2fbcd96a48ecabfb10cb21e28
6
+ metadata.gz: 10fd42d6a534ba209e4f0e95032d97589349a04600187e1ee1cbd0fab63432782d3ead6ede39899666844a143c1081e4bbcc6c7b23cb8c48ee03051a7b68e4f8
7
+ data.tar.gz: c1325385834d21fc26451f3c2058788dffededa626cbbf10406abc7dce44864e4067fa157727a66c6d090e2d8fab11a5266a007ac4e6a8f9caa1e13a82f78012
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gitmore (0.3.0.pre.rc)
4
+ gitmore (0.3.3)
5
5
  colorize
6
6
 
7
7
  GEM
@@ -0,0 +1,65 @@
1
+ * Gitmore
2
+
3
+ Get more out of git! This library provides extra git commands that make
4
+ handling multiple repositories at one time much easier. Let's say you
5
+ have a microservice architecture, organized locally as multiple git
6
+ repositories in a single directory. The feature you are currently working
7
+ on requires changes in a handful of them. You have created branches by the
8
+ same name in the associated repositories. You have finished your work and
9
+ need to switch back to master for the entire system. Instead of trying to
10
+ remember the 5 (or was it 6?) different services you made changes in...
11
+
12
+ Try ~git branches feature/my-cool-feature~ to print out all repos in the current
13
+ directory that are checked out to the branch.
14
+
15
+ #+BEGIN_SRC text
16
+ my-cool-service-repo
17
+ bug/thing-was-broken
18
+ feature/cool-new-thing
19
+ * feature/my-cool-feature
20
+ some-other-branch
21
+
22
+ another-cool-service-repo
23
+ some-branch
24
+ some-other-branch
25
+ * feature/my-cool-feature
26
+ #+END_SRC
27
+
28
+ Other gitmore commands to try:
29
+
30
+ ~git checkouts <branch-name>~ (default: master) - Check out all branches that have a branch
31
+ by the given name. Warns and prints unstashed changes when applicable, does not check out branch
32
+ on that repo.
33
+
34
+ ~git diffs~ - Print diffs on all repos in current directory
35
+
36
+ ~git fetches~ - Run ~git fetch~ on all repos in current directory
37
+
38
+ ~git pulls~ - Pulls changes on all repos in current directory
39
+
40
+ ~git gems~ - Print names of repos that are ruby gem projects
41
+
42
+ ~git logf~ - Alias for ~git log --name-status --graph~
43
+
44
+ ~git rollback~ - Alias for ~git reset HEAD~1~
45
+
46
+ ~git save <name>~ - Alias for ~git stash save <name>~
47
+
48
+ ~git sstash <filename>~ - Stash a single file
49
+
50
+ ~git statuses~ - Print ~git status~ for each repo in directory
51
+
52
+ ~git versions ruby~ - Print version of ruby being used on each repo in the
53
+ current directory containing ~.ruby-version~
54
+
55
+ More features documentation forthcoming! I whipped these up when working
56
+ on a project with at least 30 repositories that I found I needed an easier
57
+ way to manage. Much work is yet to be done, so please create an issue
58
+ for problems, suggestions, or feature requests. And of course, feel free
59
+ to contribute! Fork, play and create a pull request!
60
+
61
+ * Install
62
+
63
+ ~gem install gitmore~
64
+
65
+
@@ -10,5 +10,7 @@ require "gitmore"
10
10
  # require "pry"
11
11
  # Pry.start
12
12
 
13
+ require 'byebug'
14
+
13
15
  require "irb"
14
16
  IRB.start(__FILE__)
@@ -2,7 +2,8 @@
2
2
 
3
3
  require 'gitmore'
4
4
 
5
- branch_matcher = ARGV[0]
5
+ branch_string = ARGV[0]
6
6
  option = ARGV[1]
7
+ matcher = Gitmore::Matcher.new(branch_string, option)
7
8
 
8
- Gitmore.branches(branch_matcher, option)
9
+ matcher.branches
@@ -3,5 +3,6 @@
3
3
  require 'gitmore'
4
4
 
5
5
  branch_matcher = ARGV[0]
6
+ matcher = Gitmore::Matcher.new(branch_string)
6
7
 
7
- Gitmore.checkouts(branch_matcher)
8
+ matcher.checkouts
@@ -2,4 +2,4 @@
2
2
 
3
3
  require 'gitmore'
4
4
 
5
- Gitmore.diffs
5
+ Gitmore::Matcher.new.diffs
@@ -2,4 +2,4 @@
2
2
 
3
3
  require 'gitmore'
4
4
 
5
- Gitmore.fetches
5
+ Gitmore::Matcher.new.fetches
@@ -2,4 +2,4 @@
2
2
 
3
3
  require 'gitmore'
4
4
 
5
- Gitmore.gems
5
+ Gitmore::Matcher.new.gems
@@ -2,4 +2,4 @@
2
2
 
3
3
  require 'gitmore'
4
4
 
5
- Gitmore.pulls
5
+ Gitmore::Matcher.new.pulls
@@ -2,4 +2,4 @@
2
2
 
3
3
  require 'gitmore'
4
4
 
5
- Gitmore.statuses
5
+ Gitmore::Matcher.new.statuses
@@ -3,4 +3,4 @@
3
3
  require 'gitmore'
4
4
 
5
5
  language = ARGV[0]
6
- Gitmore.versions(language)
6
+ Gitmore::Matcher.new.versions(language)
@@ -1,49 +1,51 @@
1
1
  require 'gitmore/version'
2
-
3
- require 'helpers/branch_helper.rb'
4
- require 'helpers/ruby_helper.rb'
5
- require 'branch_matcher.rb'
6
- require 'statustician.rb'
2
+ require 'gitmore/utils'
7
3
 
8
4
  module Gitmore
9
5
  class Error < StandardError; end
10
- def self.branches(branch_string, option=nil)
11
- repositories = Gitmore::BranchMatcher.new(branch_string, option)
12
- repositories.branches
13
- end
14
6
 
15
- def self.checkouts(branch_string=nil)
16
- repositories = Gitmore::BranchMatcher.new(branch_string)
17
- repositories.checkout
18
- end
7
+ class Matcher
8
+ attr_reader :branch_string, :option
19
9
 
20
- def self.statuses(branch_string=nil)
21
- repositories = Gitmore::BranchMatcher.new(branch_string)
22
- repositories.status
23
- end
10
+ def initialize(branch_string=nil, option=nil)
11
+ @branch_string = branch_string
12
+ @option = option
13
+ end
24
14
 
25
- def self.diffs(branch_string=nil)
26
- repositories = Gitmore::BranchMatcher.new(branch_string)
27
- repositories.diffs
28
- end
15
+ def branches
16
+ repositories.branches
17
+ end
29
18
 
30
- def self.gems(branch_string=nil)
31
- repositories = Gitmore::BranchMatcher.new(branch_string)
32
- repositories.gems
33
- end
19
+ def checkouts
20
+ repositories.checkout
21
+ end
34
22
 
35
- def self.versions( language)
36
- repositories = Gitmore::BranchMatcher.new
37
- repositories.versions(language)
38
- end
23
+ def statuses
24
+ repositories.status
25
+ end
39
26
 
40
- def self.fetches
41
- repositories = Gitmore::BranchMatcher.new
42
- repositories.fetches
43
- end
27
+ def diffs
28
+ repositories.diffs
29
+ end
30
+
31
+ def gems
32
+ repositories.gems
33
+ end
34
+
35
+ def versions(language)
36
+ repositories.versions(language)
37
+ end
38
+
39
+ def fetches
40
+ repositories.fetches
41
+ end
42
+
43
+ def pulls
44
+ repositories.pulls
45
+ end
44
46
 
45
- def self.pulls
46
- repositories = Gitmore::BranchMatcher.new
47
- repositories.pulls
47
+ def repositories
48
+ Gitmore::Repositories.get_for(branch_string, option)
49
+ end
48
50
  end
49
51
  end
@@ -0,0 +1,3 @@
1
+ require_relative './helpers/branch_helper'
2
+ require_relative './helpers/ruby_helper'
3
+
@@ -0,0 +1,6 @@
1
+ require_relative './helpers'
2
+
3
+ require_relative './utils/repositories'
4
+ require_relative './utils/branches'
5
+ require_relative './utils/statustician'
6
+ require_relative './utils/branch_matcher'
@@ -1,9 +1,3 @@
1
- require_relative 'helpers/branch_helper.rb'
2
- require_relative 'helpers/ruby_helper.rb'
3
- require_relative 'repositories.rb'
4
- require_relative 'branches.rb'
5
- require_relative 'statustician.rb'
6
-
7
1
  module Gitmore
8
2
  class BranchMatcher
9
3
  attr_accessor :matcher, :option, :repositories
@@ -1,5 +1,9 @@
1
1
  module Gitmore
2
2
  module Repositories
3
+ def self.get_for(branch_string, option)
4
+ Gitmore::BranchMatcher.new(branch_string, option)
5
+ end
6
+
3
7
  def self.get
4
8
  directories.select { |dir| Dir.entries(dir).include?('.git') }
5
9
  end
@@ -1,3 +1,3 @@
1
1
  module Gitmore
2
- VERSION = '0.3.0'
2
+ VERSION = '0.3.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitmore
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - son1112
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-12-28 00:00:00.000000000 Z
11
+ date: 2019-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -107,6 +107,7 @@ files:
107
107
  - Gemfile
108
108
  - Gemfile.lock
109
109
  - LICENSE.txt
110
+ - README.org
110
111
  - Rakefile
111
112
  - bin/console
112
113
  - bin/setup
@@ -123,14 +124,16 @@ files:
123
124
  - exe/git-statuses
124
125
  - exe/git-versions
125
126
  - gitmore.gemspec
126
- - lib/branch_matcher.rb
127
- - lib/branches.rb
128
127
  - lib/gitmore.rb
128
+ - lib/gitmore/helpers.rb
129
+ - lib/gitmore/helpers/branch_helper.rb
130
+ - lib/gitmore/helpers/ruby_helper.rb
131
+ - lib/gitmore/utils.rb
132
+ - lib/gitmore/utils/branch_matcher.rb
133
+ - lib/gitmore/utils/branches.rb
134
+ - lib/gitmore/utils/repositories.rb
135
+ - lib/gitmore/utils/statustician.rb
129
136
  - lib/gitmore/version.rb
130
- - lib/helpers/branch_helper.rb
131
- - lib/helpers/ruby_helper.rb
132
- - lib/repositories.rb
133
- - lib/statustician.rb
134
137
  homepage: https://github.com/son1112/gitmore
135
138
  licenses:
136
139
  - MIT