git-multirepo 1.0.0.beta77 → 79.0
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.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +20 -2
- data/Gemfile.lock +49 -29
- data/README.md +35 -22
- data/git-multirepo.gemspec +8 -8
- data/lib/multirepo/commands/add-command.rb +2 -1
- data/lib/multirepo/commands/checkout-command.rb +6 -6
- data/lib/multirepo/commands/install-command.rb +2 -1
- data/lib/multirepo/commands/merge-command.rb +9 -7
- data/lib/multirepo/commands/update-command.rb +5 -4
- data/lib/multirepo/files/config-file.rb +4 -2
- data/lib/multirepo/files/lock-file.rb +3 -2
- data/lib/multirepo/files/meta-file.rb +3 -2
- data/lib/multirepo/info.rb +1 -1
- data/lib/multirepo/logic/node.rb +2 -1
- data/lib/multirepo/logic/revision-selector.rb +4 -4
- data/lib/multirepo/utility/utils.rb +1 -5
- metadata +44 -23
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2607f2a89a9e99220e469a8154c62e2e61b64d47c0c080568a002441a22b369f
|
|
4
|
+
data.tar.gz: 025b94d91a07f7bb469a119c4eca8212eaf49cc76efe6dd884b22f6077050378
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 86ee665305437643c2ba1931b76673bde8c40cb0f3c43f1a2229ff9543d9e9e3a18d03fe42c16c14e2408a2b919e35f44bbb598a243406b96815efc624d817b8
|
|
7
|
+
data.tar.gz: 942cccca638f978126046f539e43c698b4273a3c7bcc48a7b40cdf7d51f8e95233e93f712b873e3e22ec35b8e773dc9b963ca94026f9329522bd4314675f57a2
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
# Releases
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## 79.0
|
|
4
|
+
|
|
5
|
+
- **Breaking Change:** Require Ruby 3.4 or newer within Ruby 3. Install the gem into the Ruby 3 environment used by your terminal, Git GUI, and CI.
|
|
6
|
+
- **Enhancement:** Update dependencies and development tooling for Ruby 3.
|
|
7
|
+
- **Bug Fix:** Replace removed Ruby APIs and load existing YAML tracking files with explicitly permitted classes, preserving object tags and aliases.
|
|
8
|
+
- **Bug Fix:** Show `multi add --help` and report missing paths without crashing.
|
|
9
|
+
- **Bug Fix:** Support Unicode repository paths during dependency traversal.
|
|
10
|
+
- **Bug Fix:** Populate the revision table printed by `multi install --ci`.
|
|
11
|
+
- **Bug Fix:** Process shared dependencies before their dependents so tracking-file commits record the final dependency revisions.
|
|
12
|
+
- **Bug Fix:** Discover dependencies from the current configuration during `multi update`, allowing stale lockfiles to be regenerated after adding, removing, or re-adding dependencies.
|
|
13
|
+
|
|
14
|
+
## 78.0
|
|
15
|
+
|
|
16
|
+
The first official release! 🎉
|
|
17
|
+
|
|
18
|
+
Most kinks have been ironed out by now. There are no major known issues.
|
|
19
|
+
|
|
20
|
+
- **Enhancement:** Use the (removed) `--exact` flag's behaviour by default for `merge` and `checkout`. To get the old default behaviour (checking out exact commits as stored in the lock file), use `--as-lock`.
|
|
21
|
+
- **Enhancement:** The `merge` command merges without opening an editor by default. Use `--edit` to open an editor for each merge operation as before.
|
|
4
22
|
|
|
5
23
|
## 1.0.0.beta77
|
|
6
24
|
|
data/Gemfile.lock
CHANGED
|
@@ -1,48 +1,68 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
git-multirepo (
|
|
5
|
-
claide (~> 1.
|
|
4
|
+
git-multirepo (79.0)
|
|
5
|
+
claide (~> 1.1)
|
|
6
6
|
colored (~> 1.2)
|
|
7
|
-
naturally (~> 2.
|
|
8
|
-
os (~> 1.
|
|
9
|
-
terminal-table (~>
|
|
7
|
+
naturally (~> 2.3)
|
|
8
|
+
os (~> 1.1, >= 1.1.4)
|
|
9
|
+
terminal-table (~> 4.0)
|
|
10
10
|
|
|
11
11
|
GEM
|
|
12
12
|
remote: https://rubygems.org/
|
|
13
13
|
specs:
|
|
14
|
-
claide (1.0
|
|
14
|
+
claide (1.1.0)
|
|
15
15
|
colored (1.2)
|
|
16
|
-
diff-lcs (1.
|
|
17
|
-
naturally (2.
|
|
18
|
-
os (1.
|
|
19
|
-
rake (
|
|
20
|
-
rspec (3.
|
|
21
|
-
rspec-core (~> 3.
|
|
22
|
-
rspec-expectations (~> 3.
|
|
23
|
-
rspec-mocks (~> 3.
|
|
24
|
-
rspec-core (3.
|
|
25
|
-
rspec-support (~> 3.
|
|
26
|
-
rspec-expectations (3.
|
|
16
|
+
diff-lcs (1.6.2)
|
|
17
|
+
naturally (2.3.0)
|
|
18
|
+
os (1.1.4)
|
|
19
|
+
rake (13.4.2)
|
|
20
|
+
rspec (3.13.2)
|
|
21
|
+
rspec-core (~> 3.13.0)
|
|
22
|
+
rspec-expectations (~> 3.13.0)
|
|
23
|
+
rspec-mocks (~> 3.13.0)
|
|
24
|
+
rspec-core (3.13.7)
|
|
25
|
+
rspec-support (~> 3.13.0)
|
|
26
|
+
rspec-expectations (3.13.6)
|
|
27
27
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
28
|
-
rspec-support (~> 3.
|
|
29
|
-
rspec-mocks (3.
|
|
28
|
+
rspec-support (~> 3.13.0)
|
|
29
|
+
rspec-mocks (3.13.9)
|
|
30
30
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
31
|
-
rspec-support (~> 3.
|
|
32
|
-
rspec-support (3.8
|
|
33
|
-
terminal-table (
|
|
34
|
-
unicode-display_width (
|
|
35
|
-
unicode-display_width (
|
|
31
|
+
rspec-support (~> 3.13.0)
|
|
32
|
+
rspec-support (3.13.8)
|
|
33
|
+
terminal-table (4.0.0)
|
|
34
|
+
unicode-display_width (>= 1.1.1, < 4)
|
|
35
|
+
unicode-display_width (3.3.0)
|
|
36
|
+
unicode-emoji (~> 4.3)
|
|
37
|
+
unicode-emoji (4.3.0)
|
|
36
38
|
|
|
37
39
|
PLATFORMS
|
|
38
40
|
ruby
|
|
39
|
-
x64-
|
|
41
|
+
x64-mingw-ucrt
|
|
40
42
|
|
|
41
43
|
DEPENDENCIES
|
|
42
|
-
bundler (~>
|
|
44
|
+
bundler (~> 4.0, >= 4.0.24)
|
|
43
45
|
git-multirepo!
|
|
44
|
-
rake (~>
|
|
45
|
-
rspec (~> 3.
|
|
46
|
+
rake (~> 13.4, >= 13.4.2)
|
|
47
|
+
rspec (~> 3.13, >= 3.13.2)
|
|
48
|
+
|
|
49
|
+
CHECKSUMS
|
|
50
|
+
bundler (4.0.24) sha256=16ca64e20816a0cf151a948fb141d788602996d2b4d73577b74388fe84fa98bc
|
|
51
|
+
claide (1.1.0) sha256=6d3c5c089dde904d96aa30e73306d0d4bd444b1accb9b3125ce14a3c0183f82e
|
|
52
|
+
colored (1.2) sha256=9d82b47ac589ce7f6cab64b1f194a2009e9fd00c326a5357321f44afab2c1d2c
|
|
53
|
+
diff-lcs (1.6.2) sha256=9ae0d2cba7d4df3075fe8cd8602a8604993efc0dfa934cff568969efb1909962
|
|
54
|
+
git-multirepo (79.0)
|
|
55
|
+
naturally (2.3.0) sha256=459923cf76c2e6613048301742363200c3c7e4904c324097d54a67401e179e01
|
|
56
|
+
os (1.1.4) sha256=57816d6a334e7bd6aed048f4b0308226c5fb027433b67d90a9ab435f35108d3f
|
|
57
|
+
rake (13.4.2) sha256=cb825b2bd5f1f8e91ca37bddb4b9aaf345551b4731da62949be002fa89283701
|
|
58
|
+
rspec (3.13.2) sha256=206284a08ad798e61f86d7ca3e376718d52c0bc944626b2349266f239f820587
|
|
59
|
+
rspec-core (3.13.7) sha256=c64ff16d9788119805cbc6a3f4b6d87cc22417c2d25976a3330de136896b5469
|
|
60
|
+
rspec-expectations (3.13.6) sha256=bf538ca6d367ff5b0d85a87fdb5c0c6038f2cd1308a0eeba07476caa02d22f35
|
|
61
|
+
rspec-mocks (3.13.9) sha256=ea5c7ff3054a6098ca6039aacef80aec69d5a8a3ef80be8fc88337359b672a30
|
|
62
|
+
rspec-support (3.13.8) sha256=e4160030309b7e3e9d9863dfe720a35dfcc577162f5402cd68fc8c5258a0ffd6
|
|
63
|
+
terminal-table (4.0.0) sha256=f504793203f8251b2ea7c7068333053f0beeea26093ec9962e62ea79f94301d2
|
|
64
|
+
unicode-display_width (3.3.0) sha256=4b7aa66a4b11db50f6f7e98411215cd0dd10eaecb665d36eec5bcacb3fa0b613
|
|
65
|
+
unicode-emoji (4.3.0) sha256=11c02fa73290378c066bb0562cd4c87d8e1b706fbbe0059ca12746a4244de8ce
|
|
46
66
|
|
|
47
67
|
BUNDLED WITH
|
|
48
|
-
|
|
68
|
+
4.0.24
|
data/README.md
CHANGED
|
@@ -8,35 +8,44 @@ Track multiple Git repositories side-by-side.
|
|
|
8
8
|
|
|
9
9
|
An alternative approach to manage constantly evolving dependencies.
|
|
10
10
|
|
|
11
|
-
Check out [the project's to-do list](https://www.pivotaltracker.com/n/projects/1256156) to get an idea of upcoming enhancements and read the [change log](https://github.com/fortinmike/git-multirepo/blob/master/CHANGELOG.md) for detailed information on
|
|
11
|
+
Check out [the project's to-do list](https://www.pivotaltracker.com/n/projects/1256156) to get an idea of upcoming enhancements and read the [change log](https://github.com/fortinmike/git-multirepo/blob/master/CHANGELOG.md) for detailed information on releases.
|
|
12
12
|
|
|
13
13
|
You can download a handy cheat sheet [here](https://github.com/fortinmike/git-multirepo/raw/master/docs/git-multirepo-cheatsheet.docx).
|
|
14
14
|
|
|
15
15
|
## Installation
|
|
16
16
|
|
|
17
|
-
git-multirepo is distributed as a Ruby Gem.
|
|
17
|
+
git-multirepo is distributed as a Ruby Gem and requires Ruby 3.4 or newer within Ruby 3.
|
|
18
18
|
|
|
19
|
-
$ gem install git-multirepo
|
|
19
|
+
$ gem install git-multirepo
|
|
20
20
|
|
|
21
21
|
The `--pre` flag is necessary to install beta releases.
|
|
22
22
|
|
|
23
|
+
Install the gem into the Ruby environment used by your terminal, Git GUI, and CI.
|
|
24
|
+
The command and Git hooks select Ruby through `#!/usr/bin/env ruby`, so an installation
|
|
25
|
+
under Ruby 2 is not available to Ruby 3. Existing hooks can keep using the same scripts,
|
|
26
|
+
but their environment must select Ruby 3 with the gem installed.
|
|
27
|
+
|
|
23
28
|
## Development
|
|
24
29
|
|
|
25
|
-
1.
|
|
26
|
-
2.
|
|
27
|
-
3. Run
|
|
30
|
+
1. Select Ruby 3.4 and install Bundler 4 with `gem install bundler` if necessary
|
|
31
|
+
2. Install dependencies with `bundle install`
|
|
32
|
+
3. Run `bundle exec rake install` to build and install the tool into that Ruby environment
|
|
33
|
+
4. Run it using the command `multi`
|
|
34
|
+
|
|
35
|
+
If you use Mise without making Ruby 3.4 your default, prefix these commands with
|
|
36
|
+
`mise exec ruby@3.4 --`.
|
|
28
37
|
|
|
29
38
|
## Motivation
|
|
30
39
|
|
|
31
|
-
|
|
40
|
+
The
|
|
32
41
|
[pitfalls](http://somethingsinistral.net/blog/git-submodules-are-probably-not-the-answer/)
|
|
33
42
|
of git submodules are
|
|
34
43
|
[pretty](https://codingkilledthecat.wordpress.com/2012/04/28/why-your-company-shouldnt-use-git-submodules/)
|
|
35
44
|
[well](http://slopjong.de/2013/06/04/git-why-submodules-are-evil/)
|
|
36
45
|
[known](http://stackoverflow.com/questions/12075809/git-submodules-workflow-issues).
|
|
37
|
-
They work when your dependencies are linearly-evolving third-party libraries that you seldom update but they fall apart when it comes to managing your own, constantly evolving dependencies.
|
|
46
|
+
They work when your dependencies are linearly-evolving third-party libraries that you seldom update but they fall apart when it comes to managing your own, constantly evolving dependencies. To solve this, many tools have been created. Among the most popular is [Lerna](https://lerna.js.org) but that only works for JavaScript projets and requires projects to migrate to a monorepo. `git-multirepo` works with separate repos and is language-agnostic.
|
|
38
47
|
|
|
39
|
-
Git subtrees are
|
|
48
|
+
Git subtrees are a recommended approach, but they have pitfalls of their own:
|
|
40
49
|
|
|
41
50
|
- They require verbose and error-prone command-line operations. This can become quite tedious when managing more than one or two dependencies.
|
|
42
51
|
- They change the rules of the game when it comes to merges.
|
|
@@ -48,7 +57,7 @@ Etc.
|
|
|
48
57
|
|
|
49
58
|
## Overview
|
|
50
59
|
|
|
51
|
-
Using git-multirepo, you can manage your main project and its dependencies as completely independent repositories while still maintaining the ability to checkout a previous revision in a single step and have the project build properly.
|
|
60
|
+
Using git-multirepo, you can manage your main project and its dependencies as completely independent repositories while still maintaining the ability to checkout a previous revision (or another branch) in a single step and have the project build properly.
|
|
52
61
|
|
|
53
62
|
A git-multirepo setup looks like this:
|
|
54
63
|
|
|
@@ -62,9 +71,9 @@ MyAwesomeProject
|
|
|
62
71
|
In essence:
|
|
63
72
|
|
|
64
73
|
1. You tell git-multirepo what your dependencies are.
|
|
65
|
-
2. Each time you commit the main repo, git-multirepo tracks what revision of each dependency is required by the project (
|
|
74
|
+
2. Each time you commit the main repo, git-multirepo tracks what revision of each dependency is required by the project (and it ensures that you don't forget to commit changes to dependencies beforehand; more on that later).
|
|
66
75
|
3. If you ever want to go back to a previous version of your project, git-multirepo handles checking out the main repo and appropriate revisions of all of its dependencies in a single, seamless operation.
|
|
67
|
-
4. Setting up the project on a new machine is only a single `multi clone` away.
|
|
76
|
+
4. Setting up the project on a new machine is only a single `multi clone` away. Checking out source for continuous integration is similarly easy.
|
|
68
77
|
|
|
69
78
|
## Example
|
|
70
79
|
|
|
@@ -106,16 +115,18 @@ If you want to stop using git-multirepo, run `multi uninit`. This will remove al
|
|
|
106
115
|
- Low possibility of human error (such as forgetting to contribute changes to dependencies back to the appropriate remotes, forgetting to commit dependencies in the proper order, etc.)
|
|
107
116
|
- You're not stuck with git-multirepo. It stores its metadata as [YAML](http://www.yaml.org) in the main repo. You can clone and checkout appropriate revisions of your dependencies by hand without git-multirepo if you need to. The information is there, in human-readable form.
|
|
108
117
|
|
|
109
|
-
| How It Handles... |
|
|
110
|
-
| -------------------------------- |
|
|
111
|
-
| Working Copy |
|
|
112
|
-
| Constantly Evolving Dependencies |
|
|
113
|
-
| Merging Changes to Dependencies |
|
|
114
|
-
| Contributing Upstream |
|
|
115
|
-
| Continuous Integration |
|
|
116
|
-
| Branch-Based Workflows |
|
|
118
|
+
| How It Handles... | git-multirepo | git submodules | git subtrees |
|
|
119
|
+
| -------------------------------- | :----------------: | :------------: | :----------: |
|
|
120
|
+
| Working Copy | beside main repo | in main repo | in main repo |
|
|
121
|
+
| Constantly Evolving Dependencies | easy | hard | passable |
|
|
122
|
+
| Merging Changes to Dependencies | easy | hard | passable |
|
|
123
|
+
| Contributing Upstream | easy | easy | passable |
|
|
124
|
+
| Continuous Integration | medium<sup>1</sup> | medium | easy |
|
|
125
|
+
| Branch-Based Workflows | easy<sup>2</sup> | hard | easy |
|
|
117
126
|
|
|
118
|
-
(
|
|
127
|
+
(1) For simplified checkouts, you must install and use `git-multirepo` in your CI pipeline, otherwise you forgo the benefits it provides for CI. See [Continuous Integration](#continuous-integration) for details.
|
|
128
|
+
|
|
129
|
+
(2) The `multi branch` and `multi merge` commands faciliate branching and merging the main repo and its dependencies as a whole.
|
|
119
130
|
|
|
120
131
|
## Limitations
|
|
121
132
|
|
|
@@ -141,10 +152,12 @@ After repositories are initialized this way, git-multirepo handles the rest and
|
|
|
141
152
|
|
|
142
153
|
## Continuous Integration
|
|
143
154
|
|
|
155
|
+
<a href="#continuous-integration"></a>
|
|
156
|
+
|
|
144
157
|
git-multirepo supports continuous integration in a couple of ways:
|
|
145
158
|
|
|
146
159
|
- The `install` command has a special `--ci` flag, which:
|
|
147
|
-
- Installs exact revisions of dependencies in-place
|
|
160
|
+
- Installs exact revisions of dependencies in-place (as read from the lock file)
|
|
148
161
|
- Skips local hooks installation
|
|
149
162
|
- Logs additional information that's useful in a CI context
|
|
150
163
|
- The `inspect` command offers plumbing-style output that can be used to inspect repositories to conditionally perform multirepo operations on them afterwards.
|
data/git-multirepo.gemspec
CHANGED
|
@@ -13,19 +13,19 @@ Gem::Specification.new do |spec|
|
|
|
13
13
|
spec.homepage = "https://github.com/fortinmike/git-multirepo"
|
|
14
14
|
spec.license = "MIT"
|
|
15
15
|
|
|
16
|
-
spec.required_ruby_version = '~>
|
|
16
|
+
spec.required_ruby_version = '~> 3.4'
|
|
17
17
|
spec.files = `git ls-files -z`.split("\x0")
|
|
18
18
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
19
19
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
|
20
20
|
spec.require_paths = ["lib"]
|
|
21
21
|
|
|
22
|
-
spec.add_development_dependency "bundler", "~>
|
|
23
|
-
spec.add_development_dependency "rake", "~>
|
|
24
|
-
spec.add_development_dependency "rspec", "~> 3.
|
|
22
|
+
spec.add_development_dependency "bundler", "~> 4.0", ">= 4.0.24"
|
|
23
|
+
spec.add_development_dependency "rake", "~> 13.4", ">= 13.4.2"
|
|
24
|
+
spec.add_development_dependency "rspec", "~> 3.13", ">= 3.13.2"
|
|
25
25
|
|
|
26
|
-
spec.add_runtime_dependency "claide", "~> 1.
|
|
26
|
+
spec.add_runtime_dependency "claide", "~> 1.1"
|
|
27
27
|
spec.add_runtime_dependency "colored", "~> 1.2"
|
|
28
|
-
spec.add_runtime_dependency "os", "~> 1.
|
|
29
|
-
spec.add_runtime_dependency "terminal-table", "~>
|
|
30
|
-
spec.add_runtime_dependency "naturally", "~> 2.
|
|
28
|
+
spec.add_runtime_dependency "os", "~> 1.1", ">= 1.1.4"
|
|
29
|
+
spec.add_runtime_dependency "terminal-table", "~> 4.0"
|
|
30
|
+
spec.add_runtime_dependency "naturally", "~> 2.3"
|
|
31
31
|
end
|
|
@@ -12,8 +12,8 @@ module MultiRepo
|
|
|
12
12
|
def self.options
|
|
13
13
|
[
|
|
14
14
|
['<refname>', 'The main repo tag, branch or commit id to checkout.'],
|
|
15
|
-
['[--latest]', 'Checkout the HEAD of each dependency branch (as recorded in the lock file) instead of the exact
|
|
16
|
-
['[--
|
|
15
|
+
['[--latest]', 'Checkout the HEAD of each dependency branch (as recorded in the lock file) instead of the exact stored commits.'],
|
|
16
|
+
['[--as-lock]', 'Checkout the exact commits for each repo based on the lock file, in detached head state.'],
|
|
17
17
|
['[--force]', 'Force checkout even if there are uncommmitted changes.']
|
|
18
18
|
].concat(super)
|
|
19
19
|
end
|
|
@@ -21,7 +21,7 @@ module MultiRepo
|
|
|
21
21
|
def initialize(argv)
|
|
22
22
|
@ref_name = argv.shift_argument
|
|
23
23
|
@checkout_latest = argv.flag?("latest")
|
|
24
|
-
@
|
|
24
|
+
@checkout_lock = argv.flag?("as-lock")
|
|
25
25
|
@force = argv.flag?("force")
|
|
26
26
|
super
|
|
27
27
|
end
|
|
@@ -29,8 +29,8 @@ module MultiRepo
|
|
|
29
29
|
def validate!
|
|
30
30
|
super
|
|
31
31
|
help! "You must specify a branch or commit id to checkout" unless @ref_name
|
|
32
|
-
unless Utils.only_one_true?(@checkout_latest, @
|
|
33
|
-
help! "You can't provide more than one operation modifier (--latest, --
|
|
32
|
+
unless Utils.only_one_true?(@checkout_latest, @checkout_lock)
|
|
33
|
+
help! "You can't provide more than one operation modifier (--latest, --as-lock, etc.)"
|
|
34
34
|
end
|
|
35
35
|
end
|
|
36
36
|
|
|
@@ -38,7 +38,7 @@ module MultiRepo
|
|
|
38
38
|
ensure_in_work_tree
|
|
39
39
|
|
|
40
40
|
# Find out the checkout mode based on command-line options
|
|
41
|
-
mode = RevisionSelector.mode_for_args(@checkout_latest, @
|
|
41
|
+
mode = RevisionSelector.mode_for_args(@checkout_latest, @checkout_lock)
|
|
42
42
|
|
|
43
43
|
strategy_name = RevisionSelection.name_for_mode(mode)
|
|
44
44
|
Console.log_step("Checking out #{@ref_name} and its dependencies using the '#{strategy_name}' strategy...")
|
|
@@ -150,7 +150,7 @@ module MultiRepo
|
|
|
150
150
|
meta_file = MetaFile.new(".").load
|
|
151
151
|
main_repo_branch = main_repo.current_branch
|
|
152
152
|
|
|
153
|
-
|
|
153
|
+
table = Terminal::Table.new do |t|
|
|
154
154
|
t.title = "Revision Info"
|
|
155
155
|
t.add_row ["Tracked Using", "git-multirepo #{meta_file.version}"]
|
|
156
156
|
t.add_separator
|
|
@@ -161,6 +161,7 @@ module MultiRepo
|
|
|
161
161
|
t.add_row [lock_entry.name, commit_info(lock_entry.head, branch_name)]
|
|
162
162
|
end
|
|
163
163
|
end
|
|
164
|
+
puts table
|
|
164
165
|
end
|
|
165
166
|
|
|
166
167
|
def commit_info(commit_id, branch_name)
|
|
@@ -28,15 +28,17 @@ module MultiRepo
|
|
|
28
28
|
[
|
|
29
29
|
['<refname>', 'The main repo tag, branch or commit id to merge.'],
|
|
30
30
|
['[--latest]', 'Merge the HEAD of each stored dependency branch instead of the commits recorded in the lock file.'],
|
|
31
|
-
['[--
|
|
32
|
-
['[--
|
|
31
|
+
['[--as-lock]', 'Merge the exact specified commits for each repo, as stored in the lock file.'],
|
|
32
|
+
['[--edit]', 'Open an editor to edit the commit message for each merge operation.'],
|
|
33
|
+
['[--ff]', 'Perform a fast-forward if possible.']
|
|
33
34
|
].concat(super)
|
|
34
35
|
end
|
|
35
36
|
|
|
36
37
|
def initialize(argv)
|
|
37
38
|
@ref_name = argv.shift_argument
|
|
38
39
|
@checkout_latest = argv.flag?("latest")
|
|
39
|
-
@
|
|
40
|
+
@checkout_lock = argv.flag?("as-lock")
|
|
41
|
+
@edit = argv.flag?("edit")
|
|
40
42
|
@fast_forward = argv.flag?("ff")
|
|
41
43
|
super
|
|
42
44
|
end
|
|
@@ -44,8 +46,8 @@ module MultiRepo
|
|
|
44
46
|
def validate!
|
|
45
47
|
super
|
|
46
48
|
help! "You must specify a ref to merge" unless @ref_name
|
|
47
|
-
unless Utils.only_one_true?(@checkout_latest, @
|
|
48
|
-
help! "You can't provide more than one operation modifier (--latest, --
|
|
49
|
+
unless Utils.only_one_true?(@checkout_latest, @checkout_lock)
|
|
50
|
+
help! "You can't provide more than one operation modifier (--latest, --as-lock, etc.)"
|
|
49
51
|
end
|
|
50
52
|
end
|
|
51
53
|
|
|
@@ -54,7 +56,7 @@ module MultiRepo
|
|
|
54
56
|
ensure_multirepo_enabled
|
|
55
57
|
|
|
56
58
|
# Find out the checkout mode based on command-line options
|
|
57
|
-
mode = RevisionSelector.mode_for_args(@checkout_latest, @
|
|
59
|
+
mode = RevisionSelector.mode_for_args(@checkout_latest, @checkout_lock)
|
|
58
60
|
|
|
59
61
|
strategy_name = RevisionSelection.name_for_mode(mode)
|
|
60
62
|
Console.log_step("Merging #{@ref_name} with '#{strategy_name}' strategy...")
|
|
@@ -212,7 +214,7 @@ module MultiRepo
|
|
|
212
214
|
success = true
|
|
213
215
|
descriptors.each do |descriptor|
|
|
214
216
|
Console.log_substep("#{descriptor.name} : Merging #{descriptor.their_revision} into #{descriptor.our_revision}...")
|
|
215
|
-
GitRunner.run_as_system(descriptor.repo.path, "merge #{descriptor.their_revision}#{@fast_forward ? '' : ' --no-ff'}")
|
|
217
|
+
GitRunner.run_as_system(descriptor.repo.path, "merge #{descriptor.their_revision}#{@edit ? '' : ' --no-edit'}#{@fast_forward ? '' : ' --no-ff'}")
|
|
216
218
|
success &= GitRunner.last_command_succeeded
|
|
217
219
|
end
|
|
218
220
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
require "multirepo/utility/console"
|
|
2
2
|
require "multirepo/utility/utils"
|
|
3
|
-
require "multirepo/logic/
|
|
3
|
+
require "multirepo/logic/node"
|
|
4
4
|
require "multirepo/logic/repo-selection"
|
|
5
5
|
require "multirepo/files/tracking-files"
|
|
6
6
|
require "multirepo/git/git-runner"
|
|
@@ -68,9 +68,10 @@ module MultiRepo
|
|
|
68
68
|
|
|
69
69
|
def update_dependencies
|
|
70
70
|
any_changed = false
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
# Discover dependencies from config while regenerating potentially stale locks
|
|
72
|
+
Node.new(".").ordered_descendants.each do |node|
|
|
73
|
+
path = node.path
|
|
74
|
+
name = node.name
|
|
74
75
|
any_changed |= update_one(path, name) if Utils.multirepo_enabled?(path)
|
|
75
76
|
end
|
|
76
77
|
return any_changed
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
require "fileutils"
|
|
2
2
|
require "pathname"
|
|
3
|
+
require "psych"
|
|
3
4
|
|
|
4
5
|
require_relative "config-entry"
|
|
5
6
|
|
|
@@ -25,7 +26,8 @@ module MultiRepo
|
|
|
25
26
|
|
|
26
27
|
def load_entries
|
|
27
28
|
ensure_access(file, "Can't read config file (permissions)") { |stat| stat.readable? }
|
|
28
|
-
Psych.
|
|
29
|
+
# Preserve the object tags and aliases emitted by Psych.dump in existing files
|
|
30
|
+
Psych.safe_load(File.read(file), permitted_classes: [ConfigEntry], aliases: true)
|
|
29
31
|
end
|
|
30
32
|
|
|
31
33
|
def save_entries(entries)
|
|
@@ -46,7 +48,7 @@ module MultiRepo
|
|
|
46
48
|
end
|
|
47
49
|
|
|
48
50
|
def ensure_access(file, error_message, &check)
|
|
49
|
-
fail MultiRepoException, error_message if File.
|
|
51
|
+
fail MultiRepoException, error_message if File.exist?(file) && !check.call(File.stat(file))
|
|
50
52
|
end
|
|
51
53
|
end
|
|
52
54
|
end
|
|
@@ -27,7 +27,8 @@ module MultiRepo
|
|
|
27
27
|
|
|
28
28
|
def load_entries
|
|
29
29
|
ensure_access(file, "Can't read lock file (permissions)") { |stat| stat.readable? }
|
|
30
|
-
Psych.
|
|
30
|
+
# Preserve the object tags and aliases emitted by Psych.dump in existing files
|
|
31
|
+
Psych.safe_load(File.read(file), permitted_classes: [LockEntry], aliases: true)
|
|
31
32
|
end
|
|
32
33
|
|
|
33
34
|
def update
|
|
@@ -56,7 +57,7 @@ module MultiRepo
|
|
|
56
57
|
end
|
|
57
58
|
|
|
58
59
|
def ensure_access(file, error_message, &check)
|
|
59
|
-
fail MultiRepoException, error_message if File.
|
|
60
|
+
fail MultiRepoException, error_message if File.exist?(file) && !check.call(File.stat(file))
|
|
60
61
|
end
|
|
61
62
|
end
|
|
62
63
|
end
|
|
@@ -35,7 +35,8 @@ module MultiRepo
|
|
|
35
35
|
|
|
36
36
|
def load
|
|
37
37
|
ensure_access(file, "Can't read meta file (permissions)") { |stat| stat.readable? }
|
|
38
|
-
Psych.
|
|
38
|
+
# Preserve the object tags and aliases emitted by Psych.dump in existing files
|
|
39
|
+
Psych.safe_load(File.read(file), permitted_classes: [MetaFile], aliases: true)
|
|
39
40
|
end
|
|
40
41
|
|
|
41
42
|
def update
|
|
@@ -45,7 +46,7 @@ module MultiRepo
|
|
|
45
46
|
end
|
|
46
47
|
|
|
47
48
|
def ensure_access(file, error_message, &check)
|
|
48
|
-
fail MultiRepoException, error_message if File.
|
|
49
|
+
fail MultiRepoException, error_message if File.exist?(file) && !check.call(File.stat(file))
|
|
49
50
|
end
|
|
50
51
|
end
|
|
51
52
|
end
|
data/lib/multirepo/info.rb
CHANGED
data/lib/multirepo/logic/node.rb
CHANGED
|
@@ -33,7 +33,8 @@ module MultiRepo
|
|
|
33
33
|
unique_paths = descendants.map(&:path).uniq
|
|
34
34
|
unique_nodes = unique_paths.collect do |path|
|
|
35
35
|
nodes_for_path = descendants.select { |d| d.path == path }
|
|
36
|
-
|
|
36
|
+
# Keep the deepest occurrence so shared dependencies precede every dependent
|
|
37
|
+
next nodes_for_path.max_by(&:depth)
|
|
37
38
|
end
|
|
38
39
|
|
|
39
40
|
return unique_nodes.sort_by(&:depth).reverse
|
|
@@ -2,13 +2,13 @@ require_relative "revision-selection"
|
|
|
2
2
|
|
|
3
3
|
module MultiRepo
|
|
4
4
|
class RevisionSelector
|
|
5
|
-
def self.mode_for_args(checkout_latest,
|
|
5
|
+
def self.mode_for_args(checkout_latest, checkout_lock)
|
|
6
6
|
if checkout_latest
|
|
7
7
|
RevisionSelection::LATEST
|
|
8
|
-
elsif
|
|
9
|
-
RevisionSelection::EXACT
|
|
10
|
-
else
|
|
8
|
+
elsif checkout_lock
|
|
11
9
|
RevisionSelection::AS_LOCK
|
|
10
|
+
else
|
|
11
|
+
RevisionSelection::EXACT
|
|
12
12
|
end
|
|
13
13
|
end
|
|
14
14
|
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
require "multirepo/multirepo-exception"
|
|
2
2
|
require "fileutils"
|
|
3
|
-
require "uri"
|
|
4
3
|
|
|
5
4
|
module MultiRepo
|
|
6
5
|
class Utils
|
|
7
6
|
def self.standard_path(p)
|
|
8
|
-
|
|
9
|
-
path.insert(0, '/') if (path[0] != '/')
|
|
10
|
-
path.chomp!('/') if (path > '/')
|
|
11
|
-
path
|
|
7
|
+
File.expand_path(p)
|
|
12
8
|
end
|
|
13
9
|
|
|
14
10
|
def self.only_one_true?(*flags)
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: git-multirepo
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: '79.0'
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Michaël Fortin
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: bundler
|
|
@@ -16,56 +15,74 @@ dependencies:
|
|
|
16
15
|
requirements:
|
|
17
16
|
- - "~>"
|
|
18
17
|
- !ruby/object:Gem::Version
|
|
19
|
-
version:
|
|
18
|
+
version: '4.0'
|
|
19
|
+
- - ">="
|
|
20
|
+
- !ruby/object:Gem::Version
|
|
21
|
+
version: 4.0.24
|
|
20
22
|
type: :development
|
|
21
23
|
prerelease: false
|
|
22
24
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
25
|
requirements:
|
|
24
26
|
- - "~>"
|
|
25
27
|
- !ruby/object:Gem::Version
|
|
26
|
-
version:
|
|
28
|
+
version: '4.0'
|
|
29
|
+
- - ">="
|
|
30
|
+
- !ruby/object:Gem::Version
|
|
31
|
+
version: 4.0.24
|
|
27
32
|
- !ruby/object:Gem::Dependency
|
|
28
33
|
name: rake
|
|
29
34
|
requirement: !ruby/object:Gem::Requirement
|
|
30
35
|
requirements:
|
|
31
36
|
- - "~>"
|
|
32
37
|
- !ruby/object:Gem::Version
|
|
33
|
-
version:
|
|
38
|
+
version: '13.4'
|
|
39
|
+
- - ">="
|
|
40
|
+
- !ruby/object:Gem::Version
|
|
41
|
+
version: 13.4.2
|
|
34
42
|
type: :development
|
|
35
43
|
prerelease: false
|
|
36
44
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
45
|
requirements:
|
|
38
46
|
- - "~>"
|
|
39
47
|
- !ruby/object:Gem::Version
|
|
40
|
-
version:
|
|
48
|
+
version: '13.4'
|
|
49
|
+
- - ">="
|
|
50
|
+
- !ruby/object:Gem::Version
|
|
51
|
+
version: 13.4.2
|
|
41
52
|
- !ruby/object:Gem::Dependency
|
|
42
53
|
name: rspec
|
|
43
54
|
requirement: !ruby/object:Gem::Requirement
|
|
44
55
|
requirements:
|
|
45
56
|
- - "~>"
|
|
46
57
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: 3.
|
|
58
|
+
version: '3.13'
|
|
59
|
+
- - ">="
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: 3.13.2
|
|
48
62
|
type: :development
|
|
49
63
|
prerelease: false
|
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
65
|
requirements:
|
|
52
66
|
- - "~>"
|
|
53
67
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: 3.
|
|
68
|
+
version: '3.13'
|
|
69
|
+
- - ">="
|
|
70
|
+
- !ruby/object:Gem::Version
|
|
71
|
+
version: 3.13.2
|
|
55
72
|
- !ruby/object:Gem::Dependency
|
|
56
73
|
name: claide
|
|
57
74
|
requirement: !ruby/object:Gem::Requirement
|
|
58
75
|
requirements:
|
|
59
76
|
- - "~>"
|
|
60
77
|
- !ruby/object:Gem::Version
|
|
61
|
-
version: 1.
|
|
78
|
+
version: '1.1'
|
|
62
79
|
type: :runtime
|
|
63
80
|
prerelease: false
|
|
64
81
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
82
|
requirements:
|
|
66
83
|
- - "~>"
|
|
67
84
|
- !ruby/object:Gem::Version
|
|
68
|
-
version: 1.
|
|
85
|
+
version: '1.1'
|
|
69
86
|
- !ruby/object:Gem::Dependency
|
|
70
87
|
name: colored
|
|
71
88
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -86,42 +103,48 @@ dependencies:
|
|
|
86
103
|
requirements:
|
|
87
104
|
- - "~>"
|
|
88
105
|
- !ruby/object:Gem::Version
|
|
89
|
-
version: 1.
|
|
106
|
+
version: '1.1'
|
|
107
|
+
- - ">="
|
|
108
|
+
- !ruby/object:Gem::Version
|
|
109
|
+
version: 1.1.4
|
|
90
110
|
type: :runtime
|
|
91
111
|
prerelease: false
|
|
92
112
|
version_requirements: !ruby/object:Gem::Requirement
|
|
93
113
|
requirements:
|
|
94
114
|
- - "~>"
|
|
95
115
|
- !ruby/object:Gem::Version
|
|
96
|
-
version: 1.
|
|
116
|
+
version: '1.1'
|
|
117
|
+
- - ">="
|
|
118
|
+
- !ruby/object:Gem::Version
|
|
119
|
+
version: 1.1.4
|
|
97
120
|
- !ruby/object:Gem::Dependency
|
|
98
121
|
name: terminal-table
|
|
99
122
|
requirement: !ruby/object:Gem::Requirement
|
|
100
123
|
requirements:
|
|
101
124
|
- - "~>"
|
|
102
125
|
- !ruby/object:Gem::Version
|
|
103
|
-
version:
|
|
126
|
+
version: '4.0'
|
|
104
127
|
type: :runtime
|
|
105
128
|
prerelease: false
|
|
106
129
|
version_requirements: !ruby/object:Gem::Requirement
|
|
107
130
|
requirements:
|
|
108
131
|
- - "~>"
|
|
109
132
|
- !ruby/object:Gem::Version
|
|
110
|
-
version:
|
|
133
|
+
version: '4.0'
|
|
111
134
|
- !ruby/object:Gem::Dependency
|
|
112
135
|
name: naturally
|
|
113
136
|
requirement: !ruby/object:Gem::Requirement
|
|
114
137
|
requirements:
|
|
115
138
|
- - "~>"
|
|
116
139
|
- !ruby/object:Gem::Version
|
|
117
|
-
version: 2.
|
|
140
|
+
version: '2.3'
|
|
118
141
|
type: :runtime
|
|
119
142
|
prerelease: false
|
|
120
143
|
version_requirements: !ruby/object:Gem::Requirement
|
|
121
144
|
requirements:
|
|
122
145
|
- - "~>"
|
|
123
146
|
- !ruby/object:Gem::Version
|
|
124
|
-
version: 2.
|
|
147
|
+
version: '2.3'
|
|
125
148
|
description: Track multiple Git repositories side-by-side.
|
|
126
149
|
email:
|
|
127
150
|
- fortinmike@irradiated.net
|
|
@@ -208,7 +231,6 @@ homepage: https://github.com/fortinmike/git-multirepo
|
|
|
208
231
|
licenses:
|
|
209
232
|
- MIT
|
|
210
233
|
metadata: {}
|
|
211
|
-
post_install_message:
|
|
212
234
|
rdoc_options: []
|
|
213
235
|
require_paths:
|
|
214
236
|
- lib
|
|
@@ -216,15 +238,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
216
238
|
requirements:
|
|
217
239
|
- - "~>"
|
|
218
240
|
- !ruby/object:Gem::Version
|
|
219
|
-
version: '
|
|
241
|
+
version: '3.4'
|
|
220
242
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
221
243
|
requirements:
|
|
222
|
-
- - "
|
|
244
|
+
- - ">="
|
|
223
245
|
- !ruby/object:Gem::Version
|
|
224
|
-
version:
|
|
246
|
+
version: '0'
|
|
225
247
|
requirements: []
|
|
226
|
-
rubygems_version: 3.
|
|
227
|
-
signing_key:
|
|
248
|
+
rubygems_version: 3.6.9
|
|
228
249
|
specification_version: 4
|
|
229
250
|
summary: Track multiple Git repositories side-by-side
|
|
230
251
|
test_files:
|