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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 82a8991a155fb87064da3cbf35952da5516392981acde5a8fc7f4e5bbdcbbcea
4
- data.tar.gz: 760428524f20498f763d60a4a0076dfe85d92c28f4cb9be8666723de38b310d2
2
+ SHA1:
3
+ metadata.gz: db61bc191ce455fe997f70dfe859fcbfbc614347
4
+ data.tar.gz: 1f5e07cc0742300653acdcfcf6b1a82f21b1c3b5
5
5
  SHA512:
6
- metadata.gz: 90a655f0ce2b090ce362a5947515abf97aee54017128dfc1fe638b8ee9ca6b6fa0abe7327cca279c980d8d84f273d382438b2a34566d47d49f2b84b90519259d
7
- data.tar.gz: 3d3d93282bf15939d9bc1e786a776558f742385c9d6a6e637817c525c75bd1b49ce0b2a1d64b9312043745e317aa7d18c9bfc04fe445668bd706bc81264363be
6
+ metadata.gz: 9f6f54e409d55f2aed322279449e03b2fbb81f710e24d6523dfcf6b0d3cc9180307489786e4f82f41e140b4680f49ddd058c3082a5a167494cd0ef8ee1eb1549
7
+ data.tar.gz: b803a0946087f366706b991d42f4bffcaf34398436b8984f050d72ac5346b538673c40580e2d5655b50079bffa163ad69b608baa28f48a6c44cf3acdbea5b863
@@ -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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- git-multirepo (1.0.0.beta73)
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.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.4.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.1
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. It can thus be installed as follows (provided Ruby is installed on your machine):
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
- MyAwesomeProject
71
- |-- AwesomeApp
72
- |-- Dependency1
73
- |-- Dependency2
74
- ```
75
+ ```
76
+ MyAwesomeProject
77
+ |-- AwesomeApp
78
+ |-- Dependency1
79
+ |-- Dependency2
80
+ ```
75
81
 
76
- 2. `cd` into the *AwesomeApp* directory (aka the "main repo").
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 *Dependency1* and *Dependency2* to multirepo; do so.
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... | git-multirepo | git submodules | git subtrees |
104
- |----------------------------------|:----------------:|:--------------:|:------------:|
105
- | Working Copy | beside main repo | in main repo | in main repo |
106
- | Constantly Evolving Dependencies | easy | hard | passable |
107
- | Merging Changes to Dependencies | easy | hard | passable |
108
- | Contributing Upstream | easy | easy | passable |
109
- | Continuous Integration | medium | medium | easy |
110
- | Branch-Based Workflows | easy* | hard | easy |
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
- (*) The `multi branch` and `multi merge` commands faciliate branching and merging the main repo and its dependencies as a whole.
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 *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.
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
- MyAwesomeProject
126
- |-- AwesomeApp
127
- |-- AppDependency1
128
- |-- AppDependency1-Dependency
129
- |-- AppDependency2
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 | Description |
152
- |---------|-------------|
153
- | init | Initialize the current repository as a multirepo project. |
154
- | add | Track an additional dependency with multirepo. |
155
- | branch | Create and/or checkout a new branch for all repos. |
156
- | checkout | Checks out the specified commit or branch of the main repo and checks out matching versions of all dependencies. |
157
- | clone | Clones the specified repository in a subfolder, then installs it. |
158
- | do | Perform an arbitrary Git operation in the main repository, dependency repositories or all repositories. |
159
- | inspect | Outputs various information about multirepo-enabled repos. For use in scripting and CI scenarios. |
160
- | 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. |
161
- | merge | Performs a git merge on all dependencies and the main repo, in the proper order. |
162
- | open | Opens repositories in the OS's file explorer. |
163
- | remove | Removes the specified dependency from multirepo. |
164
- | update | Force-updates the multirepo tracking files. |
165
- | uninit | Removes all traces of multirepo in the current multirepo repository. |
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 | Format | Updated | Contents |
174
- |------|--------|---------|----------|
175
- | .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.
176
- | .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. |
177
- | .multirepo.meta | YAML | before each commit | Various git-multirepo metadata, such as the **git-multirepo version** that the last commit was performed with. |
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
@@ -70,8 +70,9 @@ module MultiRepo
70
70
  GitRunner.last_command_succeeded
71
71
  end
72
72
 
73
- def checkout(ref_name)
74
- GitRunner.run(@path, "checkout #{ref_name}", Verbosity::OUTPUT_ON_ERROR)
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
 
@@ -1,5 +1,5 @@
1
1
  module MultiRepo
2
2
  NAME = "git-multirepo"
3
- VERSION = "1.0.0.beta74"
3
+ VERSION = "1.0.0.beta75"
4
4
  DESCRIPTION = "Track multiple Git repositories side-by-side."
5
5
  end
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.beta74
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-01-31 00:00:00.000000000 Z
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
- rubygems_version: 3.0.2
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