gitmore 0.3.0.pre.rc → 0.3.5.pre.alpha
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/Gemfile.lock +1 -1
- data/README.org +65 -0
- data/bin/console +2 -0
- data/exe/git-branches +3 -2
- data/exe/git-checkouts +2 -1
- data/exe/git-diffs +1 -1
- data/exe/git-fetches +1 -1
- data/exe/git-gems +1 -1
- data/exe/git-pulls +1 -1
- data/exe/git-statuses +1 -1
- data/exe/git-updates +3 -0
- data/exe/git-versions +1 -1
- data/lib/gitmore.rb +40 -36
- data/lib/gitmore/helpers.rb +3 -0
- data/lib/{helpers → gitmore/helpers}/branch_helper.rb +3 -2
- data/lib/{helpers → gitmore/helpers}/ruby_helper.rb +0 -0
- data/lib/gitmore/utils.rb +6 -0
- data/lib/{branch_matcher.rb → gitmore/utils/branch_matcher.rb} +0 -6
- data/lib/{branches.rb → gitmore/utils/branches.rb} +8 -0
- data/lib/{repositories.rb → gitmore/utils/repositories.rb} +4 -0
- data/lib/{statustician.rb → gitmore/utils/statustician.rb} +0 -0
- data/lib/gitmore/version.rb +1 -1
- metadata +13 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 865fa4252f0a284fbc1b73b4d8b64621d328b0e3bbfe332de9ee126454d54e9f
|
4
|
+
data.tar.gz: 6d06b59216b74d3c6881f9fb3edcdb3ce23f372a219979538e74b74587028a76
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d232f4c37078cb3a7190f4791caecd02d16c0237fdb0fab4231b3ac323a8afe149f8c72f8a63b41fc83acbb4a77a40f6faf64c48fbf54fa55a91989661e0883f
|
7
|
+
data.tar.gz: fc67acb0c39f8fc12b3a8fdd83db7de9a77f5e5a255a031057fd632b27bb0afa4e08b54517250e0f6b6cce92f3d408e4369d3ddc3be1ae03aaa9f7c92e2a4888
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
data/README.org
ADDED
@@ -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 unstaged 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
|
+
|
data/bin/console
CHANGED
data/exe/git-branches
CHANGED
data/exe/git-checkouts
CHANGED
data/exe/git-diffs
CHANGED
data/exe/git-fetches
CHANGED
data/exe/git-gems
CHANGED
data/exe/git-pulls
CHANGED
data/exe/git-statuses
CHANGED
data/exe/git-updates
ADDED
data/exe/git-versions
CHANGED
data/lib/gitmore.rb
CHANGED
@@ -1,49 +1,53 @@
|
|
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
|
-
|
16
|
-
|
17
|
-
repositories.checkout
|
18
|
-
end
|
7
|
+
class Matcher
|
8
|
+
attr_reader :branch_string, :option
|
19
9
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
10
|
+
def initialize(branch_string=nil, option=nil)
|
11
|
+
@branch_string = branch_string
|
12
|
+
@option = option
|
13
|
+
end
|
24
14
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
end
|
15
|
+
def branches
|
16
|
+
repositories.branches
|
17
|
+
end
|
29
18
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
end
|
19
|
+
def checkouts
|
20
|
+
repositories.checkout
|
21
|
+
end
|
34
22
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
end
|
23
|
+
def statuses
|
24
|
+
repositories.status
|
25
|
+
end
|
39
26
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
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
|
46
|
+
|
47
|
+
private
|
44
48
|
|
45
|
-
|
46
|
-
|
47
|
-
|
49
|
+
def repositories
|
50
|
+
Gitmore::Repositories.get_for(branch_string, option)
|
51
|
+
end
|
48
52
|
end
|
49
53
|
end
|
@@ -6,9 +6,10 @@ module Gitmore
|
|
6
6
|
!`git rev-parse --verify --quiet #{matcher}`.to_s.empty?
|
7
7
|
end
|
8
8
|
|
9
|
-
def format_branch_info(repository, result)
|
9
|
+
def format_branch_info(repository, result, color=:on_green)
|
10
10
|
return unless result
|
11
|
-
puts repository.colorize(:black).on_green
|
11
|
+
# puts repository.colorize(:black).on_green
|
12
|
+
puts repository.colorize(:black).send(color)
|
12
13
|
puts puts result
|
13
14
|
end
|
14
15
|
|
File without changes
|
@@ -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
|
@@ -28,6 +28,14 @@ module Gitmore
|
|
28
28
|
non_matching_repositories.each do |name|
|
29
29
|
puts name.colorize(:red)
|
30
30
|
end
|
31
|
+
|
32
|
+
puts puts
|
33
|
+
|
34
|
+
non_matching_repositories.each do |repository|
|
35
|
+
Dir.chdir(repository) do
|
36
|
+
format_branch_info(repository, `git branch --color`, :on_red)
|
37
|
+
end
|
38
|
+
end
|
31
39
|
end
|
32
40
|
end
|
33
41
|
|
File without changes
|
data/lib/gitmore/version.rb
CHANGED
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.
|
4
|
+
version: 0.3.5.pre.alpha
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- son1112
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -95,6 +95,7 @@ executables:
|
|
95
95
|
- git-save
|
96
96
|
- git-sstash
|
97
97
|
- git-statuses
|
98
|
+
- git-updates
|
98
99
|
- git-versions
|
99
100
|
extensions: []
|
100
101
|
extra_rdoc_files: []
|
@@ -107,6 +108,7 @@ files:
|
|
107
108
|
- Gemfile
|
108
109
|
- Gemfile.lock
|
109
110
|
- LICENSE.txt
|
111
|
+
- README.org
|
110
112
|
- Rakefile
|
111
113
|
- bin/console
|
112
114
|
- bin/setup
|
@@ -121,16 +123,19 @@ files:
|
|
121
123
|
- exe/git-save
|
122
124
|
- exe/git-sstash
|
123
125
|
- exe/git-statuses
|
126
|
+
- exe/git-updates
|
124
127
|
- exe/git-versions
|
125
128
|
- gitmore.gemspec
|
126
|
-
- lib/branch_matcher.rb
|
127
|
-
- lib/branches.rb
|
128
129
|
- lib/gitmore.rb
|
130
|
+
- lib/gitmore/helpers.rb
|
131
|
+
- lib/gitmore/helpers/branch_helper.rb
|
132
|
+
- lib/gitmore/helpers/ruby_helper.rb
|
133
|
+
- lib/gitmore/utils.rb
|
134
|
+
- lib/gitmore/utils/branch_matcher.rb
|
135
|
+
- lib/gitmore/utils/branches.rb
|
136
|
+
- lib/gitmore/utils/repositories.rb
|
137
|
+
- lib/gitmore/utils/statustician.rb
|
129
138
|
- 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
139
|
homepage: https://github.com/son1112/gitmore
|
135
140
|
licenses:
|
136
141
|
- MIT
|