git-multirepo 1.0.0.beta74 → 1.0.0.beta75
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +4 -4
- data/README.md +53 -47
- data/lib/multirepo/commands/checkout-command.rb +4 -4
- data/lib/multirepo/commands/install-command.rb +1 -1
- data/lib/multirepo/git/repo.rb +3 -2
- data/lib/multirepo/info.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: db61bc191ce455fe997f70dfe859fcbfbc614347
|
4
|
+
data.tar.gz: 1f5e07cc0742300653acdcfcf6b1a82f21b1c3b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f6f54e409d55f2aed322279449e03b2fbb81f710e24d6523dfcf6b0d3cc9180307489786e4f82f41e140b4680f49ddd058c3082a5a167494cd0ef8ee1eb1549
|
7
|
+
data.tar.gz: b803a0946087f366706b991d42f4bffcaf34398436b8984f050d72ac5346b538673c40580e2d5655b50079bffa163ad69b608baa28f48a6c44cf3acdbea5b863
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
To install betas run `gem install git-multirepo --pre`
|
4
4
|
|
5
|
+
## 1.0.0.beta75
|
6
|
+
|
7
|
+
- **Enhancement:** Force checkout dependencies on install in CI mode (discards any local changes)
|
8
|
+
|
5
9
|
## 1.0.0.beta74
|
6
10
|
|
7
11
|
- **Enhancement:** Bump all dependencies to avoid `Gunzip` warnings at launch
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
git-multirepo (1.0.0.
|
4
|
+
git-multirepo (1.0.0.beta74)
|
5
5
|
claide (~> 1.0.2)
|
6
6
|
colored (~> 1.2)
|
7
7
|
naturally (~> 2.2.0)
|
@@ -15,7 +15,7 @@ GEM
|
|
15
15
|
colored (1.2)
|
16
16
|
diff-lcs (1.3)
|
17
17
|
naturally (2.2.0)
|
18
|
-
os (1.0.
|
18
|
+
os (1.0.1)
|
19
19
|
rake (12.3.2)
|
20
20
|
rspec (3.8.0)
|
21
21
|
rspec-core (~> 3.8.0)
|
@@ -32,7 +32,7 @@ GEM
|
|
32
32
|
rspec-support (3.8.0)
|
33
33
|
terminal-table (1.8.0)
|
34
34
|
unicode-display_width (~> 1.1, >= 1.1.1)
|
35
|
-
unicode-display_width (1.
|
35
|
+
unicode-display_width (1.6.0)
|
36
36
|
|
37
37
|
PLATFORMS
|
38
38
|
ruby
|
@@ -45,4 +45,4 @@ DEPENDENCIES
|
|
45
45
|
rspec (~> 3.8.0)
|
46
46
|
|
47
47
|
BUNDLED WITH
|
48
|
-
2.0.
|
48
|
+
2.0.2
|
data/README.md
CHANGED
@@ -14,12 +14,18 @@ You can download a handy cheat sheet [here](https://github.com/fortinmike/git-mu
|
|
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.
|
18
18
|
|
19
19
|
$ gem install git-multirepo --pre
|
20
20
|
|
21
21
|
The `--pre` flag is necessary to install beta releases.
|
22
22
|
|
23
|
+
## Development
|
24
|
+
|
25
|
+
1. Install dependencies with `bundle install` (install the `bundler` gem beforehand if necessary)
|
26
|
+
2. Run `rake install` to build and install the tool locally
|
27
|
+
3. Run it using the command `multi`
|
28
|
+
|
23
29
|
## Motivation
|
24
30
|
|
25
31
|
By now the
|
@@ -66,16 +72,16 @@ Say you want to track an existing project with git-multirepo:
|
|
66
72
|
|
67
73
|
1. Organize repos on disk in the following manner:
|
68
74
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
+
```
|
76
|
+
MyAwesomeProject
|
77
|
+
|-- AwesomeApp
|
78
|
+
|-- Dependency1
|
79
|
+
|-- Dependency2
|
80
|
+
```
|
75
81
|
|
76
|
-
2. `cd` into the
|
82
|
+
2. `cd` into the _AwesomeApp_ directory (aka the "main repo").
|
77
83
|
3. Run `multi init`.
|
78
|
-
4. You will get prompted to add
|
84
|
+
4. You will get prompted to add _Dependency1_ and _Dependency2_ to multirepo; do so.
|
79
85
|
5. git-multirepo reads all required information from dependency repos and initializes itself, storing its metadata in the main repo, under version control.
|
80
86
|
|
81
87
|
From now on, each time you commit the main repo git-multirepo tracks — using local git hooks — which revision of each dependency is required for that main repo revision, and where to get them. The hooks also ensure that you won't commit the main repo before its dependencies so that you always get a valid state stored under version control.
|
@@ -100,16 +106,16 @@ If you want to stop using git-multirepo, run `multi uninit`. This will remove al
|
|
100
106
|
- 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.)
|
101
107
|
- 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.
|
102
108
|
|
103
|
-
| How It Handles...
|
104
|
-
|
105
|
-
| Working Copy
|
106
|
-
| Constantly Evolving Dependencies |
|
107
|
-
| Merging Changes to Dependencies
|
108
|
-
| Contributing Upstream
|
109
|
-
| Continuous Integration
|
110
|
-
| Branch-Based Workflows
|
109
|
+
| How It Handles... | git-multirepo | git submodules | git subtrees |
|
110
|
+
| -------------------------------- | :--------------: | :------------: | :----------: |
|
111
|
+
| Working Copy | beside main repo | in main repo | in main repo |
|
112
|
+
| Constantly Evolving Dependencies | easy | hard | passable |
|
113
|
+
| Merging Changes to Dependencies | easy | hard | passable |
|
114
|
+
| Contributing Upstream | easy | easy | passable |
|
115
|
+
| Continuous Integration | medium | medium | easy |
|
116
|
+
| Branch-Based Workflows | easy\* | hard | easy |
|
111
117
|
|
112
|
-
(
|
118
|
+
(\*) The `multi branch` and `multi merge` commands faciliate branching and merging the main repo and its dependencies as a whole.
|
113
119
|
|
114
120
|
## Limitations
|
115
121
|
|
@@ -119,15 +125,15 @@ If you want to stop using git-multirepo, run `multi uninit`. This will remove al
|
|
119
125
|
|
120
126
|
## Subdependencies
|
121
127
|
|
122
|
-
Dependencies can be initialized and have their own dependencies. However, git-multirepo currently supports only
|
128
|
+
Dependencies can be initialized and have their own dependencies. However, git-multirepo currently supports only _direct_ dependencies (which is a minor inconvenience in practice). This means that every git-multirepo-enabled repository must have its direct and indirect dependencies listed in its `.multirepo file`. Take for example the following directory listing.
|
123
129
|
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
130
|
+
```
|
131
|
+
MyAwesomeProject
|
132
|
+
|-- AwesomeApp
|
133
|
+
|-- AppDependency1
|
134
|
+
|-- AppDependency1-Dependency
|
135
|
+
|-- AppDependency2
|
136
|
+
```
|
131
137
|
|
132
138
|
To properly track those repositories with git-multirepo, `AppDependency1` would be initialized with `AppDependency1-Dependency` as a dependency. Then, `AwesomeApp` would be initialized with `AppDependency1`, `AppDependency1-Dependency` and `AppDependency2` as dependencies, even though `MyAwesomeApp` does not directly depend on `AppDependency1-Dependency`. `AppDependency1-Dependency` and `AppDependency2` do not need to be initialized because they have no dependencies of their own.
|
133
139
|
|
@@ -148,21 +154,21 @@ git-multirepo supports continuous integration in a couple of ways:
|
|
148
154
|
|
149
155
|
Here is a quick rundown of commands available to you in git-multirepo:
|
150
156
|
|
151
|
-
| Command
|
152
|
-
|
153
|
-
| init
|
154
|
-
| add
|
155
|
-
| branch
|
156
|
-
| checkout | Checks out the specified commit or branch of the main repo and checks out matching versions of all dependencies.
|
157
|
-
| clone
|
158
|
-
| do
|
159
|
-
| inspect
|
160
|
-
| install
|
161
|
-
| merge
|
162
|
-
| open
|
163
|
-
| remove
|
164
|
-
| update
|
165
|
-
| uninit
|
157
|
+
| Command | Description |
|
158
|
+
| -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
159
|
+
| init | Initialize the current repository as a multirepo project. |
|
160
|
+
| add | Track an additional dependency with multirepo. |
|
161
|
+
| branch | Create and/or checkout a new branch for all repos. |
|
162
|
+
| checkout | Checks out the specified commit or branch of the main repo and checks out matching versions of all dependencies. |
|
163
|
+
| clone | Clones the specified repository in a subfolder, then installs it. |
|
164
|
+
| do | Perform an arbitrary Git operation in the main repository, dependency repositories or all repositories. |
|
165
|
+
| inspect | Outputs various information about multirepo-enabled repos. For use in scripting and CI scenarios. |
|
166
|
+
| install | Clones and checks out dependencies as defined in the version-controlled multirepo metadata files and installs git-multirepo's local git hooks. Idempotent for a given main repo checkout. |
|
167
|
+
| merge | Performs a git merge on all dependencies and the main repo, in the proper order. |
|
168
|
+
| open | Opens repositories in the OS's file explorer. |
|
169
|
+
| remove | Removes the specified dependency from multirepo. |
|
170
|
+
| update | Force-updates the multirepo tracking files. |
|
171
|
+
| uninit | Removes all traces of multirepo in the current multirepo repository. |
|
166
172
|
|
167
173
|
To read more about each command, use the `--help` flag (e.g. `$ multi clone --help`).
|
168
174
|
|
@@ -170,10 +176,10 @@ To read more about each command, use the `--help` flag (e.g. `$ multi clone --he
|
|
170
176
|
|
171
177
|
git-multirepo stores all of its metadata in three files:
|
172
178
|
|
173
|
-
| File
|
174
|
-
|
175
|
-
| .multirepo
|
176
|
-
| .multirepo.lock | YAML
|
177
|
-
| .multirepo.meta | YAML
|
179
|
+
| File | Format | Updated | Contents |
|
180
|
+
| --------------- | ------ | ----------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
181
|
+
| .multirepo | YAML | at _initialization_, on _add_ on _remove_ | A collection of your project's dependencies. For each dependency, stores its **local path** relative to the main repo and the **remote URL** your project depends upon. |
|
182
|
+
| .multirepo.lock | YAML | before each commit | For each dependency, stores the **commit id** and **branch** on which the dependency was when the main repo was committed. The dependency's **name** is also included but only serves as a reference to make inspecting the lock file easier. |
|
183
|
+
| .multirepo.meta | YAML | before each commit | Various git-multirepo metadata, such as the **git-multirepo version** that the last commit was performed with. |
|
178
184
|
|
179
|
-
The information contained in .multirepo and .multirepo.lock allow one-step cloning of a project and all its dependencies, and checking out any prior revision of the main project with appropriate revisions of all of its dependencies, respectively.
|
185
|
+
The information contained in .multirepo and .multirepo.lock allow one-step cloning of a project and all its dependencies, and checking out any prior revision of the main project with appropriate revisions of all of its dependencies, respectively.
|
@@ -79,11 +79,11 @@ module MultiRepo
|
|
79
79
|
end
|
80
80
|
end
|
81
81
|
|
82
|
-
def dependencies_checkout_step(mode, ref_name = nil)
|
82
|
+
def dependencies_checkout_step(mode, ref_name = nil, force = false)
|
83
83
|
Performer.depth_ordered_dependencies.each do |dependency|
|
84
84
|
# Find out the required dependency revision based on the checkout mode
|
85
85
|
revision = RevisionSelector.revision_for_mode(mode, ref_name, dependency.lock_entry)
|
86
|
-
perform_dependency_checkout(dependency.config_entry, revision)
|
86
|
+
perform_dependency_checkout(dependency.config_entry, revision, force)
|
87
87
|
end
|
88
88
|
end
|
89
89
|
|
@@ -103,7 +103,7 @@ module MultiRepo
|
|
103
103
|
return true
|
104
104
|
end
|
105
105
|
|
106
|
-
def perform_dependency_checkout(config_entry, revision)
|
106
|
+
def perform_dependency_checkout(config_entry, revision, force)
|
107
107
|
dependency_name = config_entry.repo.basename
|
108
108
|
|
109
109
|
# Make sure the repo exists on disk, and clone it if it doesn't
|
@@ -116,7 +116,7 @@ module MultiRepo
|
|
116
116
|
|
117
117
|
# Checkout!
|
118
118
|
ExtraOutput.progress("Checking out #{dependency_name} #{revision}")
|
119
|
-
if config_entry.repo.checkout(revision)
|
119
|
+
if config_entry.repo.checkout(revision, force)
|
120
120
|
Console.log_substep("Checked out #{dependency_name} '#{revision}'")
|
121
121
|
else
|
122
122
|
ExtraOutput.error("Couldn|'t check out dependency #{dependency_name}")
|
@@ -66,7 +66,7 @@ module MultiRepo
|
|
66
66
|
ExtraOutput.progress("Checking out appropriate dependency revisions") if @ci
|
67
67
|
checkout_command = CheckoutCommand.new(CLAide::ARGV.new([]))
|
68
68
|
mode = @ci ? RevisionSelection::AS_LOCK : RevisionSelection::LATEST
|
69
|
-
checkout_command.dependencies_checkout_step(mode)
|
69
|
+
checkout_command.dependencies_checkout_step(mode, nil, @ci) # Force in CI environment
|
70
70
|
end
|
71
71
|
|
72
72
|
def install_hooks_step
|
data/lib/multirepo/git/repo.rb
CHANGED
@@ -70,8 +70,9 @@ module MultiRepo
|
|
70
70
|
GitRunner.last_command_succeeded
|
71
71
|
end
|
72
72
|
|
73
|
-
def checkout(ref_name)
|
74
|
-
|
73
|
+
def checkout(ref_name, force = false)
|
74
|
+
forceFlag = force ? " -f" : ""
|
75
|
+
GitRunner.run(@path, "checkout#{forceFlag} #{ref_name}", Verbosity::OUTPUT_ON_ERROR)
|
75
76
|
GitRunner.last_command_succeeded
|
76
77
|
end
|
77
78
|
|
data/lib/multirepo/info.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git-multirepo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.beta75
|
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: 2019-
|
11
|
+
date: 2019-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -223,7 +223,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
223
223
|
- !ruby/object:Gem::Version
|
224
224
|
version: 1.3.1
|
225
225
|
requirements: []
|
226
|
-
|
226
|
+
rubyforge_project:
|
227
|
+
rubygems_version: 2.5.2.3
|
227
228
|
signing_key:
|
228
229
|
specification_version: 4
|
229
230
|
summary: Track multiple Git repositories side-by-side
|