git_tree 0.2.3 → 1.0.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/.rubocop.yml +25 -6
- data/CHANGELOG.md +48 -13
- data/README.md +356 -68
- 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 +23 -13
- 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 +10 -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 +55 -19
- data/bindir/git-tree-evars +0 -5
- data/bindir/git-tree-replicate +0 -5
- data/lib/git_tree_evars.rb +0 -82
- data/lib/git_tree_replicate.rb +0 -86
data/README.md
CHANGED
@@ -1,100 +1,210 @@
|
|
1
|
-
`Git_tree`
|
2
|
-
[](https://badge.fury.io/rb/git_tree)
|
3
|
-
===========
|
1
|
+
# `Git_tree` [](https://badge.fury.io/rb/git_tree)
|
4
2
|
|
5
|
-
This Ruby gem installs
|
3
|
+
This Ruby gem installs commands that walk a git directory tree and act on each repository.
|
6
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.
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
- Any git repos that have already been cloned into the target directory tree are skipped.
|
11
|
-
This means you can rerun `git-tree-replicate` as many times as you want, without ill effects.
|
12
|
-
- 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.
|
13
10
|
|
14
|
-
|
11
|
+
- The `git-evars` command writes a script that defines environment variables pointing to each git repository.
|
15
12
|
|
13
|
+
- The `git-exec` command executes an arbitrary bash command for each repository.
|
16
14
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
15
|
+
- The `git-replicate` command writes a script that clones the repos in the tree,
|
16
|
+
and adds any defined remotes.
|
17
|
+
|
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.
|
20
|
+
|
21
|
+
- All remotes in each repo are replicated.
|
21
22
|
|
23
|
+
- The `git-update` command updates each repository in the tree.
|
24
|
+
|
25
|
+
You can list them by using the `gem specification` command, like this:
|
22
26
|
|
23
|
-
## `git-tree-replicate` Usage
|
24
|
-
The following creates a script in the current directory called `work.sh`,
|
25
|
-
that replicates the desired portions of the directory tree of git repos pointed to by `$work`:
|
26
27
|
```shell
|
27
|
-
$
|
28
|
+
$ gem specification git_tree executables
|
29
|
+
---
|
30
|
+
- git-commitAll
|
31
|
+
- git-evars
|
32
|
+
- git-exec
|
33
|
+
- git-replicate
|
34
|
+
- git-update
|
28
35
|
```
|
29
36
|
|
30
|
-
|
31
|
-
path pointed to by the expanded environment variable that you provided.
|
32
|
-
You will understand what this means once you look at the generated script.
|
37
|
+
## Installation
|
33
38
|
|
34
|
-
|
35
|
-
|
36
|
-
copy it to the target machine and run it.
|
37
|
-
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:
|
38
41
|
|
39
42
|
```shell
|
40
|
-
$
|
43
|
+
$ yes | sudo apt install cmake libgit2-dev libssh2-1-dev pkg-config
|
41
44
|
|
42
|
-
$
|
45
|
+
$ gem install git_tree
|
43
46
|
```
|
44
47
|
|
48
|
+
To register the new commands, either log out and log back in, or open a new console.
|
45
49
|
|
46
|
-
|
47
|
-
|
48
|
-
|
50
|
+
## Use Cases
|
51
|
+
|
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
|
+
```
|
49
143
|
|
50
144
|
```shell
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
popd > /dev/null
|
57
|
-
fi
|
145
|
+
$ git commitAll
|
146
|
+
Processing $sites $sitesUbuntu $work
|
147
|
+
Initializing 18 worker threads...
|
148
|
+
|
149
|
+
All work is complete.
|
58
150
|
```
|
59
151
|
|
60
|
-
|
61
|
-
|
62
|
-
|
152
|
+
|
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:
|
63
159
|
an environment variable reference, pointing to the top-level directory to replicate.
|
64
160
|
The environment variable reference must be contained within single quotes to prevent expansion by the shell.
|
65
161
|
|
66
162
|
The following appends to any script in the `$work` directory called `.evars`.
|
67
163
|
The script defines environment variables that point to each git repos pointed to by `$work`:
|
164
|
+
|
68
165
|
```shell
|
69
|
-
$ git-
|
166
|
+
$ git-evars '$work' >> $work/.evars
|
70
167
|
```
|
71
168
|
|
72
169
|
|
73
|
-
|
170
|
+
#### Generated Script from `git-evars`
|
171
|
+
|
74
172
|
Following is a sample of environment variable definitions.
|
75
|
-
|
173
|
+
The `-z`/`--zowee` option generates intermediate environment variable definitions,
|
174
|
+
making them much easier to work with.
|
76
175
|
|
77
176
|
```shell
|
78
|
-
|
79
|
-
export
|
80
|
-
export
|
81
|
-
export
|
82
|
-
export
|
83
|
-
export
|
84
|
-
export
|
85
|
-
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
|
86
194
|
```
|
87
195
|
|
88
196
|
The environment variable definitions are meant to be saved into a file that is `source`d upon boot.
|
89
197
|
While you could place them in a file like `~/.bashrc`,
|
90
198
|
the author's preference is to instead place them in `$work/.evars`,
|
91
199
|
and add the following to `~/.bashrc`:
|
200
|
+
|
92
201
|
```shell
|
93
202
|
source "$work/.evars"
|
94
203
|
```
|
95
204
|
|
96
205
|
Thus each time you log in, the environment variable definitions will have been re-established.
|
97
206
|
You can therefore change directory to any of the cloned projects, like this:
|
207
|
+
|
98
208
|
```shell
|
99
209
|
$ cd $git_root
|
100
210
|
|
@@ -102,69 +212,240 @@ $ cd $my_project
|
|
102
212
|
```
|
103
213
|
|
104
214
|
|
105
|
-
|
106
|
-
|
215
|
+
### `git-exec` Usage
|
216
|
+
|
217
|
+
The `git-exec` command can be run on any computer.
|
218
|
+
The command requires two parameters.
|
219
|
+
The first parameter indicates the directory or directories to process.
|
220
|
+
3 forms are accepted:
|
221
|
+
|
222
|
+
1. A directory name, which may be relative or absolute.
|
223
|
+
|
224
|
+
2. An environment variable reference,
|
225
|
+
which must be contained within single quotes to prevent expansion by the shell.
|
226
|
+
|
227
|
+
3. A list of directory names, which may be relative or absolute, and may contain environment variables.
|
228
|
+
|
229
|
+
|
230
|
+
#### Example 1
|
231
|
+
|
232
|
+
For all subdirectories of current directory,
|
233
|
+
update `Gemfile.lock` and install a local copy of the gem:
|
107
234
|
|
108
235
|
```shell
|
109
|
-
$
|
236
|
+
$ git-exec \
|
237
|
+
'$jekyll_plugin_logger
|
238
|
+
$jekyll_draft
|
239
|
+
$jekyll_plugin_support
|
240
|
+
$jekyll_all_collections
|
241
|
+
$jekyll_plugin_template
|
242
|
+
$jekyll_flexible_include_plugin
|
243
|
+
$jekyll_href
|
244
|
+
$jekyll_img
|
245
|
+
$jekyll_outline
|
246
|
+
$jekyll_plugin_template
|
247
|
+
$jekyll_pre
|
248
|
+
$jekyll_quote'
|
249
|
+
'bundle && bundle update && rake install'
|
250
|
+
```
|
110
251
|
|
111
|
-
|
252
|
+
#### Example 2
|
253
|
+
|
254
|
+
This example shows how to display the version of projects that
|
255
|
+
create gems under the directory pointed to by `$my_plugins`.
|
256
|
+
|
257
|
+
An executable script is required on the `PATH`, so `git-exec`
|
258
|
+
can invoke it as it loops through the subdirectories.
|
259
|
+
I call this script `version`, and it is written in `bash`,
|
260
|
+
although the language used is not significant:
|
261
|
+
|
262
|
+
```shell
|
263
|
+
#!/bin/bash
|
264
|
+
|
265
|
+
x="$( ls lib/**/version.rb 2> /dev/null )"
|
266
|
+
if [ -f "$x" ]; then
|
267
|
+
v="$( \
|
268
|
+
cat "$x" | \
|
269
|
+
grep '=' | \
|
270
|
+
sed -e s/.freeze// | \
|
271
|
+
tr -d 'VERSION ="' | \
|
272
|
+
tr -d \
|
273
|
+
)"
|
274
|
+
echo "$(basename $PWD) v$v"
|
275
|
+
fi
|
112
276
|
```
|
113
277
|
|
114
|
-
|
278
|
+
Call it like this:
|
279
|
+
|
280
|
+
```shell
|
281
|
+
$ git-exec '$my_plugins' version
|
282
|
+
jekyll_all_collections v0.3.3
|
283
|
+
jekyll_archive_create v1.0.2
|
284
|
+
jekyll_archive_display v1.0.1
|
285
|
+
jekyll_auto_redirect v0.1.0
|
286
|
+
jekyll_basename_dirname v1.0.3
|
287
|
+
jekyll_begin_end v1.0.1
|
288
|
+
jekyll_bootstrap5_tabs v1.1.2
|
289
|
+
jekyll_context_inspector v1.0.1
|
290
|
+
jekyll_download_link v1.0.1
|
291
|
+
jekyll_draft v1.1.2
|
292
|
+
jekyll_flexible_include_plugin v2.0.20
|
293
|
+
jekyll_from_to_until v1.0.3
|
294
|
+
jekyll_href v1.2.5
|
295
|
+
jekyll_img v0.1.5
|
296
|
+
jekyll_nth v1.1.0
|
297
|
+
jekyll_outline v1.2.0
|
298
|
+
jekyll_pdf v0.1.0
|
299
|
+
jekyll_plugin_logger v2.1.1
|
300
|
+
jekyll_plugin_support v0.7.0
|
301
|
+
jekyll_plugin_template v0.3.0
|
302
|
+
jekyll_pre v1.4.1
|
303
|
+
jekyll_quote v0.4.0
|
304
|
+
jekyll_random_hex v1.0.0
|
305
|
+
jekyll_reading_time v1.0.0
|
306
|
+
jekyll_revision v0.1.0
|
307
|
+
jekyll_run v1.0.1
|
308
|
+
jekyll_site_inspector v1.0.0
|
309
|
+
jekyll_sort_natural v1.0.0
|
310
|
+
jekyll_time_since v0.1.3
|
311
|
+
```
|
312
|
+
|
313
|
+
#### Example 3
|
314
|
+
|
315
|
+
List the projects under the directory pointed to by `$my_plugins`
|
316
|
+
that have a `demo/` subdirectory:
|
317
|
+
|
318
|
+
```shell
|
319
|
+
$ git-exec '$my_plugins' \
|
320
|
+
'if [ -d demo ]; then realpath demo; fi'
|
321
|
+
/mnt/c/work/jekyll/my_plugins/jekyll-hello/demo
|
322
|
+
/mnt/c/work/jekyll/my_plugins/jekyll_all_collections/demo
|
323
|
+
/mnt/c/work/jekyll/my_plugins/jekyll_archive_create/demo
|
324
|
+
/mnt/c/work/jekyll/my_plugins/jekyll_download_link/demo
|
325
|
+
/mnt/c/work/jekyll/my_plugins/jekyll_draft/demo
|
326
|
+
/mnt/c/work/jekyll/my_plugins/jekyll_flexible_include_plugin/demo
|
327
|
+
/mnt/c/work/jekyll/my_plugins/jekyll_from_to_until/demo
|
328
|
+
/mnt/c/work/jekyll/my_plugins/jekyll_href/demo
|
329
|
+
/mnt/c/work/jekyll/my_plugins/jekyll_img/demo
|
330
|
+
/mnt/c/work/jekyll/my_plugins/jekyll_outline/demo
|
331
|
+
/mnt/c/work/jekyll/my_plugins/jekyll_pdf/demo
|
332
|
+
/mnt/c/work/jekyll/my_plugins/jekyll_plugin_support/demo
|
333
|
+
/mnt/c/work/jekyll/my_plugins/jekyll_plugin_template/demo
|
334
|
+
/mnt/c/work/jekyll/my_plugins/jekyll_pre/demo
|
335
|
+
/mnt/c/work/jekyll/my_plugins/jekyll_quote/demo
|
336
|
+
/mnt/c/work/jekyll/my_plugins/jekyll_revision/demo
|
337
|
+
/mnt/c/work/jekyll/my_plugins/jekyll_time_since/demo
|
338
|
+
```
|
339
|
+
|
340
|
+
### `git-replicate` Usage
|
341
|
+
|
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.
|
345
|
+
|
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:
|
359
|
+
|
360
|
+
```shell
|
361
|
+
$ scp work.sh machine2:
|
362
|
+
|
363
|
+
$ ssh machine2 work.sh
|
364
|
+
```
|
365
|
+
|
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.
|
115
385
|
|
116
386
|
|
117
387
|
## Additional Information
|
388
|
+
|
118
389
|
More information is available on
|
119
|
-
[Mike Slinn
|
390
|
+
[Mike Slinn’s website](https://www.mslinn.com/git/1100-git-tree.html).
|
120
391
|
|
121
392
|
|
122
393
|
## Development
|
394
|
+
|
123
395
|
After checking out the repo, run `bin/setup` to install dependencies.
|
124
396
|
|
125
397
|
Run the following to create a directory tree for testing.
|
398
|
+
|
126
399
|
```shell
|
127
400
|
$ ruby bin/make_test_directory.rb
|
128
401
|
```
|
129
402
|
|
130
403
|
You can run `bin/console` for an interactive prompt that will allow you to experiment.
|
131
|
-
```
|
132
|
-
$ bin/console
|
133
|
-
irb(main):001:0> GitTree.command_replicate 'demo'
|
134
404
|
|
135
|
-
|
405
|
+
```shell
|
406
|
+
$ bin/console
|
407
|
+
irb(main):001:0> GitTree::ReplicateCommand.new('$work').run
|
136
408
|
```
|
137
409
|
|
138
410
|
|
139
411
|
### Build and Install Locally
|
412
|
+
|
140
413
|
To build and install this gem onto your local machine, run:
|
414
|
+
|
141
415
|
```shell
|
142
416
|
$ bundle exec rake install
|
143
417
|
```
|
144
418
|
|
145
419
|
Examine the newly built gem:
|
146
|
-
|
420
|
+
|
421
|
+
```shell
|
147
422
|
$ gem info git_tree
|
148
423
|
|
149
424
|
*** LOCAL GEMS ***
|
150
|
-
|
425
|
+
|
426
|
+
git_tree (0.3.0)
|
151
427
|
Author: Mike Slinn
|
152
|
-
Homepage:
|
153
|
-
https://github.com/mslinn/git_tree_replicate
|
428
|
+
Homepage: https://www.mslinn.com/git/1100-git-tree.html
|
154
429
|
License: MIT
|
155
|
-
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.
|
156
433
|
```
|
157
434
|
|
158
435
|
|
159
436
|
### Build and Push to RubyGems
|
160
|
-
|
437
|
+
|
438
|
+
To release a new version:
|
439
|
+
|
161
440
|
1. Update the version number in `version.rb`.
|
162
441
|
2. Commit all changes to git; if you don't the next step might fail with an
|
163
442
|
unexplainable error message.
|
164
443
|
3. Run the following:
|
444
|
+
|
165
445
|
```shell
|
166
446
|
$ bundle exec rake release
|
167
447
|
```
|
448
|
+
|
168
449
|
The above creates a git tag for the version, commits the created tag,
|
169
450
|
and pushes the new `.gem` file to [RubyGems.org](https://rubygems.org).
|
170
451
|
|
@@ -178,4 +459,11 @@ To release a new version,
|
|
178
459
|
|
179
460
|
|
180
461
|
## License
|
181
|
-
|
462
|
+
|
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
@@ -3,19 +3,27 @@ require_relative 'lib/git_tree/version'
|
|
3
3
|
Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
|
4
4
|
github = 'https://github.com/mslinn/git_tree'
|
5
5
|
|
6
|
-
spec.authors
|
7
|
-
spec.bindir
|
6
|
+
spec.authors = ['Mike Slinn']
|
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-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.
|
15
|
+
|
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,
|
12
19
|
and adds any defined remotes.
|
13
|
-
|
20
|
+
|
21
|
+
The git-update command updates each repository in the tree.
|
14
22
|
END_OF_DESC
|
15
|
-
spec.email
|
16
|
-
spec.executables = %w[git-
|
23
|
+
spec.email = ['mslinn@mslinn.com']
|
24
|
+
spec.executables = %w[git-commitAll git-evars git-exec git-replicate git-update]
|
17
25
|
spec.files = Dir[
|
18
|
-
'{
|
26
|
+
'{exe,lib}/**/*',
|
19
27
|
'.rubocop.yml',
|
20
28
|
'LICENSE.*',
|
21
29
|
'Rakefile',
|
@@ -23,7 +31,7 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
|
|
23
31
|
'*.md'
|
24
32
|
]
|
25
33
|
spec.homepage = 'https://www.mslinn.com/git/1100-git-tree.html'
|
26
|
-
spec.license
|
34
|
+
spec.license = 'MIT'
|
27
35
|
spec.metadata = {
|
28
36
|
'allowed_push_host' => 'https://rubygems.org',
|
29
37
|
'bug_tracker_uri' => "#{github}/issues",
|
@@ -31,16 +39,18 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
|
|
31
39
|
'homepage_uri' => spec.homepage,
|
32
40
|
'source_code_uri' => github,
|
33
41
|
}
|
34
|
-
spec.name
|
42
|
+
spec.name = 'git_tree'
|
43
|
+
spec.platform = Gem::Platform::RUBY
|
35
44
|
spec.post_install_message = <<~END_MESSAGE
|
36
45
|
|
37
46
|
Thanks for installing #{spec.name}!
|
38
47
|
|
39
48
|
END_MESSAGE
|
40
|
-
spec.required_ruby_version = '>= 2.
|
41
|
-
spec.summary
|
42
|
-
spec.version
|
49
|
+
spec.required_ruby_version = '>= 3.2.0'
|
50
|
+
spec.summary = 'Installs five commands that walk a git directory tree and perform tasks.'
|
51
|
+
spec.version = GitUrlsVersion::VERSION
|
43
52
|
|
53
|
+
spec.add_dependency 'gem_support'
|
44
54
|
spec.add_dependency 'rainbow'
|
45
55
|
spec.add_dependency 'rugged'
|
46
56
|
end
|