git_tree 0.3.0 → 1.0.1
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/.rubocop.yml +21 -4
- data/CHANGELOG.md +12 -2
- data/README.md +222 -81
- data/exe/git-commitAll +3 -0
- data/exe/git-evars +3 -0
- data/exe/git-exec +3 -0
- data/exe/git-replicate +3 -0
- data/exe/git-update +3 -0
- data/git_tree.gemspec +14 -10
- data/lib/commands/abstract_command.rb +88 -0
- data/lib/commands/git_commit_all.rb +155 -0
- data/lib/commands/git_evars.rb +159 -0
- data/lib/commands/git_exec.rb +104 -0
- data/lib/commands/git_exec_spec.rb +0 -0
- data/lib/commands/git_replicate.rb +91 -0
- data/lib/commands/git_update.rb +113 -0
- data/lib/git_tree/version.rb +1 -1
- data/lib/git_tree.rb +9 -26
- data/lib/util/command_runner.rb +12 -0
- data/lib/{util.rb → util/gem_support.rb} +16 -6
- data/lib/util/git_tree_walker.rb +75 -0
- data/lib/util/git_tree_walker_private.rb +60 -0
- data/lib/util/log.rb +49 -0
- data/lib/util/thread_pool_manager.rb +116 -0
- data/lib/util/zowee_optimizer.rb +136 -0
- metadata +38 -21
- data/bindir/git-tree-evars +0 -5
- data/bindir/git-tree-exec +0 -5
- data/bindir/git-tree-replicate +0 -5
- data/lib/git_tree_evars.rb +0 -82
- data/lib/git_tree_exec.rb +0 -94
- data/lib/git_tree_replicate.rb +0 -86
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3592f1261444da8733168030eebf398f6055fb5f53e2c5758b44fac69e9092fe
|
4
|
+
data.tar.gz: caae86a90d3acaf2267b58de6449625fbf23a010756539ee0fd9b65efe6a6678
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b02edfd02bbb8589f53bdafc76b4a298b8fff75fdeee4af016b7912e85220c35366bee1e83cf1a95deb923202cdb687c32e80610dccd8408b8918a5f4b09de6e
|
7
|
+
data.tar.gz: 9281499cf2057b365a6ac8e01de640fe457d7d1e463c7e10da8e25c203ff3917f3673333de618db645a70c5c1da47eb4058a4922b925e317ab2cbc3ebbc639db
|
data/.rubocop.yml
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
plugins:
|
2
2
|
- rubocop-md
|
3
3
|
- rubocop-performance
|
4
4
|
- rubocop-rake
|
@@ -29,6 +29,9 @@ Layout/HashAlignment:
|
|
29
29
|
Layout/InitialIndentation:
|
30
30
|
Exclude:
|
31
31
|
- README.md
|
32
|
+
- CHANGELOG.md
|
33
|
+
- Gemfile*
|
34
|
+
- git_tree.gemspec
|
32
35
|
|
33
36
|
Layout/LineLength:
|
34
37
|
Max: 150
|
@@ -40,6 +43,9 @@ Lint/RedundantCopDisableDirective:
|
|
40
43
|
Exclude:
|
41
44
|
- git_tree.gemspec
|
42
45
|
|
46
|
+
Lint/RedundantDirGlobSort:
|
47
|
+
Enabled: false
|
48
|
+
|
43
49
|
Metrics/AbcSize:
|
44
50
|
Max: 45
|
45
51
|
|
@@ -47,6 +53,7 @@ Metrics/BlockLength:
|
|
47
53
|
Exclude:
|
48
54
|
- git_tree.gemspec
|
49
55
|
- spec/**/*
|
56
|
+
Max: 35
|
50
57
|
|
51
58
|
Metrics/ClassLength:
|
52
59
|
Exclude:
|
@@ -64,16 +71,26 @@ Metrics/PerceivedComplexity:
|
|
64
71
|
Naming/FileName:
|
65
72
|
Exclude:
|
66
73
|
- Rakefile
|
74
|
+
- CHANGELOG.md
|
75
|
+
- README.md
|
76
|
+
- Gemfile*
|
77
|
+
- exe/*
|
67
78
|
|
68
79
|
RSpec/ExampleLength:
|
69
80
|
Max: 20
|
70
81
|
|
71
|
-
RSpec/FilePath:
|
72
|
-
Enabled: false
|
73
|
-
|
74
82
|
RSpec/MultipleExpectations:
|
75
83
|
Max: 15
|
76
84
|
|
85
|
+
RSpec/MultipleMemoizedHelpers:
|
86
|
+
Enabled: false
|
87
|
+
|
88
|
+
RSpec/SpecFilePathFormat:
|
89
|
+
IgnoreMethods: true
|
90
|
+
|
91
|
+
RSpec/SubjectStub:
|
92
|
+
Enabled: false
|
93
|
+
|
77
94
|
Style/CommandLiteral:
|
78
95
|
Enabled: false
|
79
96
|
|
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,18 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
-
## 0.
|
3
|
+
## 1.0.1 / 2025-10-04
|
4
4
|
|
5
|
-
*
|
5
|
+
* Removed unnecessary and problematic `gem_support` dependency.
|
6
|
+
|
7
|
+
|
8
|
+
## 1.0.0 / 2025-10-04
|
9
|
+
|
10
|
+
* Made the file search breadth-first instead of depth-first,
|
11
|
+
greatly increasing performance.
|
12
|
+
* Added `git-update` and `git-commitAll` commands.
|
13
|
+
* Renamed `git-tree-replicate`, `git-tree-evars` and `git-tree-exec` to
|
14
|
+
`git-replicate`, `git-evars` and `git-exec`.
|
15
|
+
* Added spec.platform to `.gemspec` because `RubyGems.org` now requires it.
|
6
16
|
|
7
17
|
|
8
18
|
## 0.3.0 / 2023-06-01
|
data/README.md
CHANGED
@@ -1,71 +1,161 @@
|
|
1
1
|
# `Git_tree` [](https://badge.fury.io/rb/git_tree)
|
2
2
|
|
3
|
-
This Ruby gem installs
|
4
|
-
2 of the commands write out scripts and the third executes an arbitrary bash command for each repository.
|
3
|
+
This Ruby gem installs commands that walk a git directory tree and act on each repository.
|
5
4
|
Directories containing a file called `.ignore` are ignored.
|
5
|
+
Ignoring a directory means all subdirectories are also ignored.
|
6
|
+
Multiple threads are used to dramatically boost performance.
|
6
7
|
|
7
|
-
- The `git-
|
8
|
-
|
9
|
-
- Any git repos that have already been cloned into the target directory tree are skipped.
|
10
|
-
This means you can rerun `git-tree-replicate` as many times as you want, without ill effects.
|
11
|
-
- All remotes in each repo are replicated.
|
8
|
+
- The `git-commitAll` command commits and pushes all changes to each repository in the tree.
|
9
|
+
Repositories in a detached `HEAD` state are skipped.
|
12
10
|
|
13
|
-
- The `git-
|
11
|
+
- The `git-evars` command writes a script that defines environment variables pointing to each git repository.
|
14
12
|
|
15
|
-
- The `git-
|
13
|
+
- The `git-exec` command executes an arbitrary bash command for each repository.
|
16
14
|
|
15
|
+
- The `git-replicate` command writes a script that clones the repos in the tree,
|
16
|
+
and adds any defined remotes.
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
All commands require one environment variable reference to be passed to them.
|
21
|
-
Enclose the name of the environment variable within single quotes,
|
22
|
-
which will prevent the shell from expanding it before invoking the command.
|
18
|
+
- Any git repos that have already been cloned into the target directory tree are skipped.
|
19
|
+
This means you can rerun `git-replicate` as many times as you want, without ill effects.
|
23
20
|
|
21
|
+
- All remotes in each repo are replicated.
|
24
22
|
|
25
|
-
|
23
|
+
- The `git-update` command updates each repository in the tree.
|
26
24
|
|
27
|
-
|
28
|
-
that replicates the desired portions of the directory tree of git repos pointed to by `$work`:
|
25
|
+
You can list them by using the `gem specification` command, like this:
|
29
26
|
|
30
27
|
```shell
|
31
|
-
$
|
28
|
+
$ gem specification git_tree executables
|
29
|
+
---
|
30
|
+
- git-commitAll
|
31
|
+
- git-evars
|
32
|
+
- git-exec
|
33
|
+
- git-replicate
|
34
|
+
- git-update
|
32
35
|
```
|
33
36
|
|
34
|
-
|
35
|
-
path pointed to by the expanded environment variable that you provided.
|
36
|
-
You will understand what this means once you look at the generated script.
|
37
|
+
## Installation
|
37
38
|
|
38
|
-
|
39
|
-
|
40
|
-
copy it to the target machine and run it.
|
41
|
-
The following example copies the script to `machine2` and runs it:
|
39
|
+
Type the following at a shell prompt on the machine you are copying the git tree from,
|
40
|
+
and on the machine that you are copying the git tree to:
|
42
41
|
|
43
42
|
```shell
|
44
|
-
$
|
43
|
+
$ yes | sudo apt install cmake libgit2-dev libssh2-1-dev pkg-config
|
45
44
|
|
46
|
-
$
|
45
|
+
$ gem install git_tree
|
47
46
|
```
|
48
47
|
|
48
|
+
To register the new commands, either log out and log back in, or open a new console.
|
49
49
|
|
50
|
-
|
50
|
+
## Use Cases
|
51
51
|
|
52
|
-
|
53
|
-
|
52
|
+
### Dependent Gem Maintenance
|
53
|
+
|
54
|
+
One of my directory trees holds Jekyll plugins, packaged as 25 gems.
|
55
|
+
They depend on one another, and must be built in a particular order.
|
56
|
+
Sometimes an operation must be performed on all of the plugins, and then rebuild them all.
|
57
|
+
|
58
|
+
Most operations do not require that the projects be processed in any particular order, however
|
59
|
+
the build process must be invoked on the dependencies first.
|
60
|
+
It is quite tedious to do this 25 times, over and over.
|
61
|
+
|
62
|
+
Several years ago I wrote a bash script to perform this task, but as its requirements became more complex,
|
63
|
+
the bash script proved difficult to maintain. This use case is now fulfilled by the `git-exec` command
|
64
|
+
provided by the `git_tree` gem.
|
65
|
+
See below for further details.
|
66
|
+
|
67
|
+
### Replicating Trees of Git Repositories
|
68
|
+
|
69
|
+
Whenever I set up an operating system for a new development computer,
|
70
|
+
one of the tedious tasks that must be performed is to replicate
|
71
|
+
the directory trees of Git repositories.
|
72
|
+
|
73
|
+
It is a bad idea to attempt to copy an entire Git repository between computers,
|
74
|
+
because the `.git` directories within them can quite large.
|
75
|
+
So large, in fact, that it might much more time to copy than re-cloning.
|
76
|
+
|
77
|
+
The reason is that copying the entire Git repository actually means copying the same information twice:
|
78
|
+
first the `.git` hidden directory, complete with all the history for the project,
|
79
|
+
and then again for the files in the currently checked out branch.
|
80
|
+
Git repos store the entire development history of the project in their `.git` directories,
|
81
|
+
so as they accumulate history they eventually become much larger than the
|
82
|
+
code that is checked out at any given time.
|
83
|
+
|
84
|
+
One morning I found myself facing the boring task of doing this manually once again.
|
85
|
+
Instead, I wrote a bash script that scanned a Git directory tree and
|
86
|
+
wrote out another bash script that clones the repos in the tree.
|
87
|
+
Any additional remote references are replicated.
|
88
|
+
|
89
|
+
Two years later, I decided to add new features to the script.
|
90
|
+
Bash is great for short scripts,
|
91
|
+
but it is not conducive to debugging or structured programming.
|
92
|
+
I rewrote the bash script in Ruby, using the `rugged` gem.
|
93
|
+
Much better!
|
94
|
+
|
95
|
+
Two years after that I used Google Gemini Code Assist to rewrite it again in Ruby,
|
96
|
+
this time as a multithreaded program.
|
97
|
+
Performance is now lightning-fast for most use cases.
|
98
|
+
I was also able to use the same core logic for several of the individual
|
99
|
+
Git-related scripts I had written over the years.
|
100
|
+
The result is this Ruby gem.
|
101
|
+
|
102
|
+
This use case is fulfilled by the
|
103
|
+
`git-replicate`
|
104
|
+
and `git-evars` commands
|
105
|
+
provided by this gem.
|
106
|
+
|
107
|
+
|
108
|
+
## Usage
|
109
|
+
|
110
|
+
### Single- And Multi-Threading
|
111
|
+
|
112
|
+
All of these commands are inherently multi-threaded.
|
113
|
+
They consume up to 75% of the threads that your CPU can provide.
|
114
|
+
You may notice that your computer's fan gets louder when your run these commands on large numbers of Git repositories.
|
115
|
+
|
116
|
+
For builds and other sequential tasks, however, parallelism is inappropriate.
|
117
|
+
Instead, it is necessary to build components in the proper order.
|
118
|
+
Doing all the work on a single thread is a straightforward way of ensuring proper task ordering.
|
119
|
+
|
120
|
+
Use the `-s/--serial` option when the order that Git projects are processed matters.
|
121
|
+
All of the commands support this option.
|
122
|
+
Execution will take much longer that without the option,
|
123
|
+
because performing most tasks take longer to perform in sequence than performing them in parallel.
|
124
|
+
Exceptions include old sayings like “Nine women cannot have a baby in one month.”
|
125
|
+
For those exceptions, use the `-s/--serial` option.
|
126
|
+
|
127
|
+
### `git-commitAll`
|
128
|
+
|
129
|
+
```text
|
130
|
+
git-commitAll - Recursively commits and pushes changes in all git repositories under the specified DIRECTORY roots.
|
131
|
+
If no directories are given, uses default environment variables ('sites', 'sitesUbuntu', 'work') as roots.
|
132
|
+
Skips directories containing a .ignore file.
|
133
|
+
Repositories in a detached HEAD state are skipped.
|
134
|
+
|
135
|
+
Options:
|
136
|
+
-h, --help Show this help message and exit.
|
137
|
+
-m, --message MESSAGE Use the given string as the commit message.
|
138
|
+
(default: "-")
|
139
|
+
-q, --quiet Suppress normal output, only show errors.
|
140
|
+
-s, --serial Run tasks serially in a single thread in the order specified.
|
141
|
+
-v, --verbose Increase verbosity. Can be used multiple times (e.g., -v, -vv).
|
142
|
+
```
|
54
143
|
|
55
144
|
```shell
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
popd > /dev/null
|
62
|
-
fi
|
145
|
+
$ git commitAll
|
146
|
+
Processing $sites $sitesUbuntu $work
|
147
|
+
Initializing 18 worker threads...
|
148
|
+
|
149
|
+
All work is complete.
|
63
150
|
```
|
64
151
|
|
65
|
-
## `git-tree-evars` Usage
|
66
152
|
|
67
|
-
|
68
|
-
|
153
|
+
### `git-evars`
|
154
|
+
|
155
|
+
The `git-evars` command writes a script that defines environment variables pointing to each git repository.
|
156
|
+
This command should be run on the target computer.
|
157
|
+
|
158
|
+
Only one parameter is required:
|
69
159
|
an environment variable reference, pointing to the top-level directory to replicate.
|
70
160
|
The environment variable reference must be contained within single quotes to prevent expansion by the shell.
|
71
161
|
|
@@ -73,24 +163,34 @@ The following appends to any script in the `$work` directory called `.evars`.
|
|
73
163
|
The script defines environment variables that point to each git repos pointed to by `$work`:
|
74
164
|
|
75
165
|
```shell
|
76
|
-
$ git-
|
166
|
+
$ git-evars '$work' >> $work/.evars
|
77
167
|
```
|
78
168
|
|
79
169
|
|
80
|
-
|
170
|
+
#### Generated Script from `git-evars`
|
81
171
|
|
82
172
|
Following is a sample of environment variable definitions.
|
83
|
-
|
173
|
+
The `-z`/`--zowee` option generates intermediate environment variable definitions,
|
174
|
+
making them much easier to work with.
|
84
175
|
|
85
176
|
```shell
|
86
|
-
|
87
|
-
export
|
88
|
-
export
|
89
|
-
export
|
90
|
-
export
|
91
|
-
export
|
92
|
-
export
|
93
|
-
export
|
177
|
+
$ git-evars -z '$sites'
|
178
|
+
export mnt=/mnt
|
179
|
+
export c=$mnt/c
|
180
|
+
export _6of26=$sites/6of26
|
181
|
+
export computers=$sites/computers.mslinn.com
|
182
|
+
export ebooks=$sites/ebooks
|
183
|
+
export expert=$sites/expert
|
184
|
+
export fonts=$sites/fonts
|
185
|
+
export intranet=$sites/intranet.ancientwarmth.com
|
186
|
+
export intranet_mslinn=$sites/intranet.mslinn.com
|
187
|
+
export jekyllTemplate=$sites/jekyllTemplate
|
188
|
+
export lyrics=$sites/lyrics
|
189
|
+
export metamusic=$sites/metamusic
|
190
|
+
export music=$sites/music.mslinn.com
|
191
|
+
export photos=$sites/photos
|
192
|
+
export supportingLiterature=$sites/supportingLiterature
|
193
|
+
export www=$sites/www.scalacourses.com
|
94
194
|
```
|
95
195
|
|
96
196
|
The environment variable definitions are meant to be saved into a file that is `source`d upon boot.
|
@@ -112,26 +212,29 @@ $ cd $my_project
|
|
112
212
|
```
|
113
213
|
|
114
214
|
|
115
|
-
|
215
|
+
### `git-exec` Usage
|
116
216
|
|
117
|
-
The `git-
|
217
|
+
The `git-exec` command can be run on any computer.
|
118
218
|
The command requires two parameters.
|
119
219
|
The first parameter indicates the directory or directories to process.
|
120
220
|
3 forms are accepted:
|
121
221
|
|
122
222
|
1. A directory name, which may be relative or absolute.
|
223
|
+
|
123
224
|
2. An environment variable reference,
|
124
225
|
which must be contained within single quotes to prevent expansion by the shell.
|
226
|
+
|
125
227
|
3. A list of directory names, which may be relative or absolute, and may contain environment variables.
|
126
228
|
|
127
|
-
|
229
|
+
|
230
|
+
#### Example 1
|
128
231
|
|
129
232
|
For all subdirectories of current directory,
|
130
233
|
update `Gemfile.lock` and install a local copy of the gem:
|
131
234
|
|
132
235
|
```shell
|
133
|
-
$ git-
|
134
|
-
$jekyll_plugin_logger
|
236
|
+
$ git-exec \
|
237
|
+
'$jekyll_plugin_logger
|
135
238
|
$jekyll_draft
|
136
239
|
$jekyll_plugin_support
|
137
240
|
$jekyll_all_collections
|
@@ -142,16 +245,16 @@ $ git-tree-exec '
|
|
142
245
|
$jekyll_outline
|
143
246
|
$jekyll_plugin_template
|
144
247
|
$jekyll_pre
|
145
|
-
$jekyll_quote
|
146
|
-
'
|
248
|
+
$jekyll_quote'
|
249
|
+
'bundle && bundle update && rake install'
|
147
250
|
```
|
148
251
|
|
149
|
-
|
252
|
+
#### Example 2
|
150
253
|
|
151
254
|
This example shows how to display the version of projects that
|
152
255
|
create gems under the directory pointed to by `$my_plugins`.
|
153
256
|
|
154
|
-
An executable script is required on the `PATH`, so `git-
|
257
|
+
An executable script is required on the `PATH`, so `git-exec`
|
155
258
|
can invoke it as it loops through the subdirectories.
|
156
259
|
I call this script `version`, and it is written in `bash`,
|
157
260
|
although the language used is not significant:
|
@@ -161,12 +264,12 @@ although the language used is not significant:
|
|
161
264
|
|
162
265
|
x="$( ls lib/**/version.rb 2> /dev/null )"
|
163
266
|
if [ -f "$x" ]; then
|
164
|
-
v="$(
|
267
|
+
v="$( \
|
165
268
|
cat "$x" | \
|
166
269
|
grep '=' | \
|
167
270
|
sed -e s/.freeze// | \
|
168
|
-
tr -d 'VERSION
|
169
|
-
tr -d \
|
271
|
+
tr -d 'VERSION ="' | \
|
272
|
+
tr -d \
|
170
273
|
)"
|
171
274
|
echo "$(basename $PWD) v$v"
|
172
275
|
fi
|
@@ -175,7 +278,7 @@ fi
|
|
175
278
|
Call it like this:
|
176
279
|
|
177
280
|
```shell
|
178
|
-
$ git-
|
281
|
+
$ git-exec '$my_plugins' version
|
179
282
|
jekyll_all_collections v0.3.3
|
180
283
|
jekyll_archive_create v1.0.2
|
181
284
|
jekyll_archive_display v1.0.1
|
@@ -207,13 +310,13 @@ jekyll_sort_natural v1.0.0
|
|
207
310
|
jekyll_time_since v0.1.3
|
208
311
|
```
|
209
312
|
|
210
|
-
|
313
|
+
#### Example 3
|
211
314
|
|
212
315
|
List the projects under the directory pointed to by `$my_plugins`
|
213
316
|
that have a `demo/` subdirectory:
|
214
317
|
|
215
318
|
```shell
|
216
|
-
$ git-
|
319
|
+
$ git-exec '$my_plugins' \
|
217
320
|
'if [ -d demo ]; then realpath demo; fi'
|
218
321
|
/mnt/c/work/jekyll/my_plugins/jekyll-hello/demo
|
219
322
|
/mnt/c/work/jekyll/my_plugins/jekyll_all_collections/demo
|
@@ -234,25 +337,57 @@ $ git-tree-exec '$my_plugins' \
|
|
234
337
|
/mnt/c/work/jekyll/my_plugins/jekyll_time_since/demo
|
235
338
|
```
|
236
339
|
|
340
|
+
### `git-replicate` Usage
|
237
341
|
|
238
|
-
|
342
|
+
This command generates a shell script to replicate a tree of git repositories.
|
343
|
+
ROOTS can be directory names or environment variable references (e.g., '$work').
|
344
|
+
Multiple roots can be specified in a single quoted string.
|
239
345
|
|
240
|
-
|
241
|
-
|
346
|
+
```shell
|
347
|
+
$ git-replicate '$work' > work.sh # Replicate repos under $work
|
348
|
+
$ git-replicate '$work $sites' > replicate.sh # Replicate repos under $work and $sites
|
349
|
+
```
|
350
|
+
|
351
|
+
The generated environment variables will all be relative to the
|
352
|
+
path pointed to by the expanded environment variable that you provided.
|
353
|
+
You will understand what this means once you look at the generated script.
|
354
|
+
|
355
|
+
When `git-replicate` completes,
|
356
|
+
edit the generated script to suit, then
|
357
|
+
copy it to the target machine and run it.
|
358
|
+
The following example copies the script to `machine2` and runs it:
|
242
359
|
|
243
360
|
```shell
|
244
|
-
$
|
361
|
+
$ scp work.sh machine2:
|
245
362
|
|
246
|
-
$
|
363
|
+
$ ssh machine2 work.sh
|
247
364
|
```
|
248
365
|
|
249
|
-
|
366
|
+
|
367
|
+
#### Generated Script from `git-replicate`
|
368
|
+
|
369
|
+
Following is a sample of one section, which is repeated for every git repo that is processed:
|
370
|
+
You can edit them to suit.
|
371
|
+
|
372
|
+
```shell
|
373
|
+
if [ ! -d "sinatra/sinatras-skeleton/.git" ]; then
|
374
|
+
mkdir -p 'sinatra'
|
375
|
+
pushd 'sinatra' > /dev/null
|
376
|
+
git clone git@github.com:mslinn/sinatras-skeleton.git
|
377
|
+
git remote add upstream 'https://github.com/simonneutert/sinatras-skeleton.git'
|
378
|
+
popd > /dev/null
|
379
|
+
fi
|
380
|
+
```
|
381
|
+
|
382
|
+
### `git-update`
|
383
|
+
|
384
|
+
The `git-update` command updates each repository in the tree.
|
250
385
|
|
251
386
|
|
252
387
|
## Additional Information
|
253
388
|
|
254
389
|
More information is available on
|
255
|
-
[Mike Slinn
|
390
|
+
[Mike Slinn’s website](https://www.mslinn.com/git/1100-git-tree.html).
|
256
391
|
|
257
392
|
|
258
393
|
## Development
|
@@ -269,9 +404,7 @@ You can run `bin/console` for an interactive prompt that will allow you to exper
|
|
269
404
|
|
270
405
|
```shell
|
271
406
|
$ bin/console
|
272
|
-
irb(main):001:0> GitTree.
|
273
|
-
|
274
|
-
irb(main):002:0> GitTree.command_evars 'demo'
|
407
|
+
irb(main):001:0> GitTree::ReplicateCommand.new('$work').run
|
275
408
|
```
|
276
409
|
|
277
410
|
|
@@ -289,12 +422,14 @@ Examine the newly built gem:
|
|
289
422
|
$ gem info git_tree
|
290
423
|
|
291
424
|
*** LOCAL GEMS ***
|
292
|
-
|
425
|
+
|
426
|
+
git_tree (0.3.0)
|
293
427
|
Author: Mike Slinn
|
294
|
-
Homepage:
|
295
|
-
https://github.com/mslinn/git_tree_replicate
|
428
|
+
Homepage: https://www.mslinn.com/git/1100-git-tree.html
|
296
429
|
License: MIT
|
297
|
-
Installed at: /home/mslinn/.gems
|
430
|
+
Installed at: /home/mslinn/.rbenv/versions/3.4.6/lib/ruby/gems/3.4.0
|
431
|
+
|
432
|
+
Installs five commands that walk a git directory tree and perform tasks.
|
298
433
|
```
|
299
434
|
|
300
435
|
|
@@ -325,4 +460,10 @@ To release a new version:
|
|
325
460
|
|
326
461
|
## License
|
327
462
|
|
328
|
-
The gem is available as open source under the terms of the
|
463
|
+
The gem is available as open source under the terms of the
|
464
|
+
[MIT License](https://opensource.org/licenses/MIT).
|
465
|
+
|
466
|
+
## Additional Information
|
467
|
+
|
468
|
+
More information is available on
|
469
|
+
[Mike Slinn’s website](https://www.mslinn.com/git/1100-git-tree.html)
|
data/exe/git-commitAll
ADDED
data/exe/git-evars
ADDED
data/exe/git-exec
ADDED
data/exe/git-replicate
ADDED
data/exe/git-update
ADDED
data/git_tree.gemspec
CHANGED
@@ -4,22 +4,26 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
|
|
4
4
|
github = 'https://github.com/mslinn/git_tree'
|
5
5
|
|
6
6
|
spec.authors = ['Mike Slinn']
|
7
|
-
spec.bindir = '
|
7
|
+
spec.bindir = 'exe'
|
8
8
|
spec.description = <<~END_OF_DESC
|
9
|
-
Installs
|
9
|
+
Installs 5 commands that process a git directory tree.
|
10
10
|
Directories containing a file called .ignore are ignored.
|
11
11
|
|
12
|
-
The git-
|
13
|
-
|
12
|
+
The git-commitAll command commits all changes to each repository in the tree.
|
13
|
+
|
14
|
+
The git-evars command writes a script that defines environment variables pointing to git repos.
|
14
15
|
|
15
|
-
The git-
|
16
|
+
The git-exec command executes a bash expression on children of a directory, or a list of directories.
|
17
|
+
|
18
|
+
The git-replicate command writes a script that clones the repos in the tree,
|
19
|
+
and adds any defined remotes.
|
16
20
|
|
17
|
-
The git-
|
21
|
+
The git-update command updates each repository in the tree.
|
18
22
|
END_OF_DESC
|
19
23
|
spec.email = ['mslinn@mslinn.com']
|
20
|
-
spec.executables = %w[git-
|
24
|
+
spec.executables = %w[git-commitAll git-evars git-exec git-replicate git-update]
|
21
25
|
spec.files = Dir[
|
22
|
-
'{
|
26
|
+
'{exe,lib}/**/*',
|
23
27
|
'.rubocop.yml',
|
24
28
|
'LICENSE.*',
|
25
29
|
'Rakefile',
|
@@ -42,8 +46,8 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
|
|
42
46
|
Thanks for installing #{spec.name}!
|
43
47
|
|
44
48
|
END_MESSAGE
|
45
|
-
spec.required_ruby_version = '>= 2.
|
46
|
-
spec.summary = 'Installs
|
49
|
+
spec.required_ruby_version = '>= 3.2.0'
|
50
|
+
spec.summary = 'Installs five commands that walk a git directory tree and perform tasks.'
|
47
51
|
spec.version = GitUrlsVersion::VERSION
|
48
52
|
|
49
53
|
spec.add_dependency 'rainbow'
|