git-multirepo 1.0.0.beta9 → 1.0.0.beta10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +38 -38
  3. data/.rspec +2 -2
  4. data/Gemfile +4 -4
  5. data/Gemfile.lock +37 -37
  6. data/LICENSE +22 -22
  7. data/README.md +136 -136
  8. data/Rakefile +2 -2
  9. data/bin/multi +5 -5
  10. data/git-multirepo.gemspec +29 -29
  11. data/lib/commands.rb +11 -11
  12. data/lib/info.rb +4 -4
  13. data/lib/multirepo/commands/add-command.rb +40 -40
  14. data/lib/multirepo/commands/branch-command.rb +43 -50
  15. data/lib/multirepo/commands/checkout-command.rb +66 -66
  16. data/lib/multirepo/commands/command.rb +40 -40
  17. data/lib/multirepo/commands/edit-command.rb +21 -21
  18. data/lib/multirepo/commands/fetch-command.rb +23 -23
  19. data/lib/multirepo/commands/init-command.rb +53 -53
  20. data/lib/multirepo/commands/install-command.rb +64 -64
  21. data/lib/multirepo/commands/open-command.rb +25 -25
  22. data/lib/multirepo/commands/remove-command.rb +41 -41
  23. data/lib/multirepo/commands/uninit-command.rb +20 -20
  24. data/lib/multirepo/commands/update-command.rb +43 -33
  25. data/lib/multirepo/config.rb +12 -12
  26. data/lib/multirepo/files/config-entry.rb +37 -37
  27. data/lib/multirepo/files/config-file.rb +37 -37
  28. data/lib/multirepo/files/lock-entry.rb +25 -25
  29. data/lib/multirepo/files/lock-file.rb +38 -38
  30. data/lib/multirepo/git/branch.rb +27 -27
  31. data/lib/multirepo/git/change.rb +10 -10
  32. data/lib/multirepo/git/git.rb +38 -38
  33. data/lib/multirepo/git/remote.rb +15 -15
  34. data/lib/multirepo/git/repo.rb +66 -66
  35. data/lib/multirepo/hooks/pre-commit-hook.rb +23 -24
  36. data/lib/multirepo/multirepo-exception.rb +5 -5
  37. data/lib/multirepo/utility/console.rb +51 -51
  38. data/lib/multirepo/utility/runner.rb +20 -20
  39. data/lib/multirepo/utility/utils.rb +41 -36
  40. data/resources/pre-commit +5 -5
  41. data/spec/integration/init_spec.rb +22 -22
  42. data/spec/spec_helper.rb +89 -89
  43. metadata +23 -23
@@ -1,37 +1,42 @@
1
- require "fileutils"
2
-
3
- module MultiRepo
4
- class Utils
5
- def self.path_for_resource(resource_name)
6
- gem_path = Gem::Specification.find_by_name("git-multirepo").gem_dir
7
- File.join(gem_path, "resources/#{resource_name}")
8
- end
9
-
10
- def self.install_pre_commit_hook
11
- FileUtils.cp(path_for_resource("pre-commit"), ".git/hooks")
12
- end
13
-
14
- def self.sibling_repos
15
- sibling_directories = Dir['../*/']
16
- sibling_repos = sibling_directories.map{ |d| Repo.new(d) }.select{ |r| r.exists? }
17
- sibling_repos.delete_if{ |r| Pathname.new(r.path).realpath == Pathname.new(".").realpath }
18
- end
19
-
20
- def self.warn_of_uncommitted_changes(config_entries)
21
- uncommitted = false
22
- config_entries.each do |e|
23
- next unless e.repo.exists?
24
- unless e.repo.is_clean?
25
- Console.log_warning("Dependency '#{e.repo.path}' contains uncommitted changes")
26
- uncommitted = true
27
- end
28
- end
29
- return uncommitted
30
- end
31
-
32
- def self.convert_to_windows_path(unix_path)
33
- components = Pathname.new(unix_path).each_filename.to_a
34
- components.join(File::ALT_SEPARATOR)
35
- end
36
- end
1
+ require "fileutils"
2
+
3
+ module MultiRepo
4
+ class Utils
5
+ def self.path_for_resource(resource_name)
6
+ gem_path = Gem::Specification.find_by_name("git-multirepo").gem_dir
7
+ File.join(gem_path, "resources/#{resource_name}")
8
+ end
9
+
10
+ def self.install_pre_commit_hook
11
+ FileUtils.cp(path_for_resource("pre-commit"), ".git/hooks")
12
+ end
13
+
14
+ def self.sibling_repos
15
+ sibling_directories = Dir['../*/']
16
+ sibling_repos = sibling_directories.map{ |d| Repo.new(d) }.select{ |r| r.exists? }
17
+ sibling_repos.delete_if{ |r| Pathname.new(r.path).realpath == Pathname.new(".").realpath }
18
+ end
19
+
20
+ def self.ensure_dependencies_clean(config_entries)
21
+ config_entries.all? do |e|
22
+ return true unless e.repo.exists?
23
+ clean = e.repo.is_clean?
24
+ Console.log_warning("Dependency '#{e.repo.path}' contains uncommitted changes") unless clean
25
+ return clean
26
+ end
27
+ end
28
+
29
+ def self.ensure_working_copies_clean(repos)
30
+ repos.all? do |repo|
31
+ clean = repo.is_clean?
32
+ Console.log_warning("Repo #{repo.path} contains uncommitted changes") unless clean
33
+ return clean
34
+ end
35
+ end
36
+
37
+ def self.convert_to_windows_path(unix_path)
38
+ components = Pathname.new(unix_path).each_filename.to_a
39
+ components.join(File::ALT_SEPARATOR)
40
+ end
41
+ end
37
42
  end
data/resources/pre-commit CHANGED
@@ -1,6 +1,6 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "rubygems"
4
- require "git-multirepo"
5
-
1
+ #!/usr/bin/env ruby
2
+
3
+ require "rubygems"
4
+ require "git-multirepo"
5
+
6
6
  MultiRepo::PreCommitHook.run
@@ -1,23 +1,23 @@
1
- require "multirepo/commands/init"
2
-
3
- RSpec.describe("Init") do
4
- it "creates the config file" do
5
- pending
6
- end
7
-
8
- it "adds only specified repos to the config file" do
9
- pending
10
- end
11
-
12
- it "stages the config file" do
13
- pending
14
- end
15
-
16
- it "installs the pre-commit hook" do
17
- pending
18
- end
19
-
20
- it "fails when there are uncommitted changes in dependencies" do
21
- pending
22
- end
1
+ require "multirepo/commands/init"
2
+
3
+ RSpec.describe("Init") do
4
+ it "creates the config file" do
5
+ pending
6
+ end
7
+
8
+ it "adds only specified repos to the config file" do
9
+ pending
10
+ end
11
+
12
+ it "stages the config file" do
13
+ pending
14
+ end
15
+
16
+ it "installs the pre-commit hook" do
17
+ pending
18
+ end
19
+
20
+ it "fails when there are uncommitted changes in dependencies" do
21
+ pending
22
+ end
23
23
  end
data/spec/spec_helper.rb CHANGED
@@ -1,89 +1,89 @@
1
- # This file was generated by the `rspec --init` command. Conventionally, all
2
- # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
3
- # The generated `.rspec` file contains `--require spec_helper` which will cause this
4
- # file to always be loaded, without a need to explicitly require it in any files.
5
- #
6
- # Given that it is always loaded, you are encouraged to keep this file as
7
- # light-weight as possible. Requiring heavyweight dependencies from this file
8
- # will add to the boot time of your test suite on EVERY test run, even for an
9
- # individual file that may not need all of that loaded. Instead, consider making
10
- # a separate helper file that requires the additional dependencies and performs
11
- # the additional setup, and require it from the spec files that actually need it.
12
- #
13
- # The `.rspec` file also contains a few flags that are not defaults but that
14
- # users commonly want.
15
- #
16
- # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
17
- RSpec.configure do |config|
18
- # rspec-expectations config goes here. You can use an alternate
19
- # assertion/expectation library such as wrong or the stdlib/minitest
20
- # assertions if you prefer.
21
- config.expect_with :rspec do |expectations|
22
- # This option will default to `true` in RSpec 4. It makes the `description`
23
- # and `failure_message` of custom matchers include text for helper methods
24
- # defined using `chain`, e.g.:
25
- # be_bigger_than(2).and_smaller_than(4).description
26
- # # => "be bigger than 2 and smaller than 4"
27
- # ...rather than:
28
- # # => "be bigger than 2"
29
- expectations.include_chain_clauses_in_custom_matcher_descriptions = true
30
- end
31
-
32
- # rspec-mocks config goes here. You can use an alternate test double
33
- # library (such as bogus or mocha) by changing the `mock_with` option here.
34
- config.mock_with :rspec do |mocks|
35
- # Prevents you from mocking or stubbing a method that does not exist on
36
- # a real object. This is generally recommended, and will default to
37
- # `true` in RSpec 4.
38
- mocks.verify_partial_doubles = true
39
- end
40
-
41
- # The settings below are suggested to provide a good initial experience
42
- # with RSpec, but feel free to customize to your heart's content.
43
- =begin
44
- # These two settings work together to allow you to limit a spec run
45
- # to individual examples or groups you care about by tagging them with
46
- # `:focus` metadata. When nothing is tagged with `:focus`, all examples
47
- # get run.
48
- config.filter_run :focus
49
- config.run_all_when_everything_filtered = true
50
-
51
- # Limits the available syntax to the non-monkey patched syntax that is recommended.
52
- # For more details, see:
53
- # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
54
- # - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
55
- # - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
56
- config.disable_monkey_patching!
57
-
58
- # This setting enables warnings. It's recommended, but in some cases may
59
- # be too noisy due to issues in dependencies.
60
- config.warnings = true
61
-
62
- # Many RSpec users commonly either run the entire suite or an individual
63
- # file, and it's useful to allow more verbose output when running an
64
- # individual spec file.
65
- if config.files_to_run.one?
66
- # Use the documentation formatter for detailed output,
67
- # unless a formatter has already been configured
68
- # (e.g. via a command-line flag).
69
- config.default_formatter = 'doc'
70
- end
71
-
72
- # Print the 10 slowest examples and example groups at the
73
- # end of the spec run, to help surface which specs are running
74
- # particularly slow.
75
- config.profile_examples = 10
76
-
77
- # Run specs in random order to surface order dependencies. If you find an
78
- # order dependency and want to debug it, you can fix the order by providing
79
- # the seed, which is printed after each run.
80
- # --seed 1234
81
- config.order = :random
82
-
83
- # Seed global randomization in this process using the `--seed` CLI option.
84
- # Setting this allows you to use `--seed` to deterministically reproduce
85
- # test failures related to randomization by passing the same `--seed` value
86
- # as the one that triggered the failure.
87
- Kernel.srand config.seed
88
- =end
89
- end
1
+ # This file was generated by the `rspec --init` command. Conventionally, all
2
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
3
+ # The generated `.rspec` file contains `--require spec_helper` which will cause this
4
+ # file to always be loaded, without a need to explicitly require it in any files.
5
+ #
6
+ # Given that it is always loaded, you are encouraged to keep this file as
7
+ # light-weight as possible. Requiring heavyweight dependencies from this file
8
+ # will add to the boot time of your test suite on EVERY test run, even for an
9
+ # individual file that may not need all of that loaded. Instead, consider making
10
+ # a separate helper file that requires the additional dependencies and performs
11
+ # the additional setup, and require it from the spec files that actually need it.
12
+ #
13
+ # The `.rspec` file also contains a few flags that are not defaults but that
14
+ # users commonly want.
15
+ #
16
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
17
+ RSpec.configure do |config|
18
+ # rspec-expectations config goes here. You can use an alternate
19
+ # assertion/expectation library such as wrong or the stdlib/minitest
20
+ # assertions if you prefer.
21
+ config.expect_with :rspec do |expectations|
22
+ # This option will default to `true` in RSpec 4. It makes the `description`
23
+ # and `failure_message` of custom matchers include text for helper methods
24
+ # defined using `chain`, e.g.:
25
+ # be_bigger_than(2).and_smaller_than(4).description
26
+ # # => "be bigger than 2 and smaller than 4"
27
+ # ...rather than:
28
+ # # => "be bigger than 2"
29
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
30
+ end
31
+
32
+ # rspec-mocks config goes here. You can use an alternate test double
33
+ # library (such as bogus or mocha) by changing the `mock_with` option here.
34
+ config.mock_with :rspec do |mocks|
35
+ # Prevents you from mocking or stubbing a method that does not exist on
36
+ # a real object. This is generally recommended, and will default to
37
+ # `true` in RSpec 4.
38
+ mocks.verify_partial_doubles = true
39
+ end
40
+
41
+ # The settings below are suggested to provide a good initial experience
42
+ # with RSpec, but feel free to customize to your heart's content.
43
+ =begin
44
+ # These two settings work together to allow you to limit a spec run
45
+ # to individual examples or groups you care about by tagging them with
46
+ # `:focus` metadata. When nothing is tagged with `:focus`, all examples
47
+ # get run.
48
+ config.filter_run :focus
49
+ config.run_all_when_everything_filtered = true
50
+
51
+ # Limits the available syntax to the non-monkey patched syntax that is recommended.
52
+ # For more details, see:
53
+ # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
54
+ # - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
55
+ # - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
56
+ config.disable_monkey_patching!
57
+
58
+ # This setting enables warnings. It's recommended, but in some cases may
59
+ # be too noisy due to issues in dependencies.
60
+ config.warnings = true
61
+
62
+ # Many RSpec users commonly either run the entire suite or an individual
63
+ # file, and it's useful to allow more verbose output when running an
64
+ # individual spec file.
65
+ if config.files_to_run.one?
66
+ # Use the documentation formatter for detailed output,
67
+ # unless a formatter has already been configured
68
+ # (e.g. via a command-line flag).
69
+ config.default_formatter = 'doc'
70
+ end
71
+
72
+ # Print the 10 slowest examples and example groups at the
73
+ # end of the spec run, to help surface which specs are running
74
+ # particularly slow.
75
+ config.profile_examples = 10
76
+
77
+ # Run specs in random order to surface order dependencies. If you find an
78
+ # order dependency and want to debug it, you can fix the order by providing
79
+ # the seed, which is printed after each run.
80
+ # --seed 1234
81
+ config.order = :random
82
+
83
+ # Seed global randomization in this process using the `--seed` CLI option.
84
+ # Setting this allows you to use `--seed` to deterministically reproduce
85
+ # test failures related to randomization by passing the same `--seed` value
86
+ # as the one that triggered the failure.
87
+ Kernel.srand config.seed
88
+ =end
89
+ end
metadata CHANGED
@@ -1,103 +1,103 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-multirepo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.beta9
4
+ version: 1.0.0.beta10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michaël Fortin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-19 00:00:00.000000000 Z
11
+ date: 2015-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.7'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.7'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: '10.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ~>
46
46
  - !ruby/object:Gem::Version
47
47
  version: 3.1.0
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ~>
53
53
  - !ruby/object:Gem::Version
54
54
  version: 3.1.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: claide
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ~>
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0.8'
62
- - - ">="
62
+ - - '>='
63
63
  - !ruby/object:Gem::Version
64
64
  version: 0.8.0
65
65
  type: :runtime
66
66
  prerelease: false
67
67
  version_requirements: !ruby/object:Gem::Requirement
68
68
  requirements:
69
- - - "~>"
69
+ - - ~>
70
70
  - !ruby/object:Gem::Version
71
71
  version: '0.8'
72
- - - ">="
72
+ - - '>='
73
73
  - !ruby/object:Gem::Version
74
74
  version: 0.8.0
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: colored
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
- - - "~>"
79
+ - - ~>
80
80
  - !ruby/object:Gem::Version
81
81
  version: '1.2'
82
82
  type: :runtime
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
- - - "~>"
86
+ - - ~>
87
87
  - !ruby/object:Gem::Version
88
88
  version: '1.2'
89
89
  - !ruby/object:Gem::Dependency
90
90
  name: os
91
91
  requirement: !ruby/object:Gem::Requirement
92
92
  requirements:
93
- - - "~>"
93
+ - - ~>
94
94
  - !ruby/object:Gem::Version
95
95
  version: 0.9.6
96
96
  type: :runtime
97
97
  prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
- - - "~>"
100
+ - - ~>
101
101
  - !ruby/object:Gem::Version
102
102
  version: 0.9.6
103
103
  description: Track multiple Git repositories side-by-side.
@@ -108,10 +108,10 @@ executables:
108
108
  extensions: []
109
109
  extra_rdoc_files: []
110
110
  files:
111
- - ".gitignore"
112
- - ".multirepo"
113
- - ".multirepo.lock"
114
- - ".rspec"
111
+ - .gitignore
112
+ - .multirepo
113
+ - .multirepo.lock
114
+ - .rspec
115
115
  - Gemfile
116
116
  - Gemfile.lock
117
117
  - LICENSE
@@ -163,17 +163,17 @@ require_paths:
163
163
  - lib
164
164
  required_ruby_version: !ruby/object:Gem::Requirement
165
165
  requirements:
166
- - - "~>"
166
+ - - ~>
167
167
  - !ruby/object:Gem::Version
168
168
  version: '2.0'
169
169
  required_rubygems_version: !ruby/object:Gem::Requirement
170
170
  requirements:
171
- - - ">"
171
+ - - '>'
172
172
  - !ruby/object:Gem::Version
173
173
  version: 1.3.1
174
174
  requirements: []
175
175
  rubyforge_project:
176
- rubygems_version: 2.4.1
176
+ rubygems_version: 2.4.5
177
177
  signing_key:
178
178
  specification_version: 4
179
179
  summary: Track multiple Git repositories side-by-side