eac_git 0.18.1 → 0.19.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/lib/eac_git/local/changed_file.rb +2 -2
- data/lib/eac_git/local/commit/diff_tree_line.rb +1 -1
- data/lib/eac_git/local/remote.rb +32 -8
- data/lib/eac_git/local/subrepo/config.rb +2 -0
- data/lib/eac_git/local.rb +2 -2
- data/lib/eac_git/remote_like/ls_result.rb +1 -1
- data/lib/eac_git/remote_like.rb +0 -1
- data/lib/eac_git/rspec/stubbed_git_local_repo.rb +0 -2
- data/lib/eac_git/rspec.rb +0 -1
- data/lib/eac_git/version.rb +1 -1
- data/lib/eac_git.rb +0 -2
- data/vendor/git-subrepo/.fish.rc +20 -0
- data/vendor/git-subrepo/.gitattributes +1 -0
- data/vendor/git-subrepo/.github/workflows/test.yml +29 -0
- data/vendor/git-subrepo/.gitignore +1 -0
- data/vendor/git-subrepo/.gitrepo +7 -0
- data/vendor/git-subrepo/.rc +32 -0
- data/vendor/git-subrepo/Changes +66 -0
- data/vendor/git-subrepo/Intro.pod +2 -5
- data/vendor/git-subrepo/Makefile +45 -5
- data/vendor/git-subrepo/Meta +2 -2
- data/vendor/git-subrepo/ReadMe.pod +26 -31
- data/vendor/git-subrepo/doc/git-subrepo.swim +22 -18
- data/vendor/git-subrepo/doc/intro-to-subrepo.swim +2 -4
- data/vendor/git-subrepo/ext/bashplus/.gitrepo +12 -0
- data/vendor/git-subrepo/ext/bashplus/.travis.yml +6 -0
- data/vendor/git-subrepo/ext/bashplus/Changes +19 -0
- data/vendor/git-subrepo/ext/bashplus/License +1 -1
- data/vendor/git-subrepo/ext/bashplus/Makefile +25 -0
- data/vendor/git-subrepo/ext/bashplus/Meta +4 -4
- data/vendor/git-subrepo/ext/bashplus/ReadMe.pod +2 -2
- data/vendor/git-subrepo/ext/bashplus/bin/bash+ +8 -7
- data/vendor/git-subrepo/ext/bashplus/doc/bash+.swim +1 -1
- data/vendor/git-subrepo/ext/bashplus/lib/bash+.bash +85 -38
- data/vendor/git-subrepo/ext/bashplus/man/man1/bash+.1 +8 -8
- data/vendor/git-subrepo/ext/bashplus/man/man3/bash+.3 +8 -8
- data/vendor/git-subrepo/ext/bashplus/test/base.t +4 -5
- data/vendor/git-subrepo/ext/bashplus/test/die.t +16 -0
- data/vendor/git-subrepo/ext/bashplus/test/fcopy.t +2 -3
- data/vendor/git-subrepo/ext/bashplus/test/{test.bash → setup} +18 -8
- data/vendor/git-subrepo/ext/bashplus/test/shellcheck.t +37 -0
- data/vendor/git-subrepo/ext/bashplus/test/source-bash+-std.t +10 -11
- data/vendor/git-subrepo/ext/bashplus/test/source-bash+.t +10 -11
- data/vendor/git-subrepo/ext/bashplus/test/use.t +8 -5
- data/vendor/git-subrepo/ext/bashplus/test/version-check.t +23 -0
- data/vendor/git-subrepo/ext/test-more-bash/.gitrepo +12 -0
- data/vendor/git-subrepo/ext/test-more-bash/.travis.yml +6 -0
- data/vendor/git-subrepo/ext/test-more-bash/Changes +11 -0
- data/vendor/git-subrepo/ext/test-more-bash/License +1 -1
- data/vendor/git-subrepo/ext/test-more-bash/Makefile +25 -0
- data/vendor/git-subrepo/ext/test-more-bash/Meta +5 -5
- data/vendor/git-subrepo/ext/test-more-bash/ReadMe.pod +9 -3
- data/vendor/git-subrepo/ext/test-more-bash/doc/test-more.swim +7 -2
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/.gitrepo +12 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/.travis.yml +6 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/Changes +11 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/License +1 -1
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/Makefile +25 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/Meta +3 -3
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/ReadMe.pod +2 -2
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/bin/bash+ +8 -7
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/doc/bash+.swim +1 -1
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/lib/bash+.bash +85 -38
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/man/man1/bash+.1 +8 -8
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/man/man3/bash+.3 +8 -8
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/base.t +4 -4
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/die.t +17 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/fcopy.t +2 -2
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/{test.bash → setup} +17 -8
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/shellcheck.t +38 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/source-bash+-std.t +10 -10
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/source-bash+.t +10 -10
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/use.t +8 -4
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/.gitrepo +12 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/.travis.yml +5 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/Changes +11 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/License +1 -1
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/Makefile +30 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/Meta +3 -3
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/ReadMe.pod +2 -2
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/doc/test-tap.swim +1 -1
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/lib/test/tap.bash +46 -42
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/man/man3/test-tap.3 +8 -8
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/bail_out.t +1 -1
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/fail.t +1 -1
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/fail_fast.t +1 -1
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/helper.bash +1 -1
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/shellcheck.t +42 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/tap.t +11 -5
- data/vendor/git-subrepo/ext/test-more-bash/lib/test/more.bash +35 -15
- data/vendor/git-subrepo/ext/test-more-bash/man/man3/test-more.3 +16 -10
- data/vendor/git-subrepo/ext/test-more-bash/test/fail.t +15 -1
- data/vendor/git-subrepo/ext/test-more-bash/test/more.t +12 -4
- data/vendor/git-subrepo/ext/test-more-bash/test/setup +3 -3
- data/vendor/git-subrepo/ext/test-more-bash/test/shellcheck.t +35 -0
- data/vendor/git-subrepo/ext/test-more-bash/test/test/fail1.t +14 -1
- data/vendor/git-subrepo/lib/git-subrepo +375 -260
- data/vendor/git-subrepo/lib/git-subrepo.d/help-functions.bash +21 -22
- data/vendor/git-subrepo/man/man1/git-subrepo.1 +125 -141
- data/vendor/git-subrepo/pkg/bin/generate-completion.pl +0 -7
- data/vendor/git-subrepo/pkg/bin/generate-help-functions.pl +0 -2
- data/vendor/git-subrepo/share/completion.bash +1 -3
- data/vendor/git-subrepo/share/enable-completion.sh +3 -3
- data/vendor/git-subrepo/share/zsh-completion/_git-subrepo +2 -7
- data/vendor/git-subrepo/test/Dockerfile +112 -0
- data/vendor/git-subrepo/test/branch-all.t +6 -6
- data/vendor/git-subrepo/test/branch-rev-list-one-path.t +7 -8
- data/vendor/git-subrepo/test/branch-rev-list.t +7 -8
- data/vendor/git-subrepo/test/branch.t +9 -9
- data/vendor/git-subrepo/test/clean.t +3 -3
- data/vendor/git-subrepo/test/clone-annotated-tag.t +7 -7
- data/vendor/git-subrepo/test/clone.t +20 -25
- data/vendor/git-subrepo/test/config.t +7 -6
- data/vendor/git-subrepo/test/encode.t +17 -17
- data/vendor/git-subrepo/test/error.t +18 -18
- data/vendor/git-subrepo/test/fetch.t +4 -4
- data/vendor/git-subrepo/test/gitignore.t +8 -8
- data/vendor/git-subrepo/test/init.t +6 -7
- data/vendor/git-subrepo/test/issue29.t +3 -3
- data/vendor/git-subrepo/test/issue95.t +2 -2
- data/vendor/git-subrepo/test/issue96.t +3 -3
- data/vendor/git-subrepo/test/pull-all.t +5 -5
- data/vendor/git-subrepo/test/pull-merge.t +16 -15
- data/vendor/git-subrepo/test/pull-message.t +12 -12
- data/vendor/git-subrepo/test/pull-new-branch.t +8 -7
- data/vendor/git-subrepo/test/pull-ours.t +10 -10
- data/vendor/git-subrepo/test/pull-theirs.t +8 -8
- data/vendor/git-subrepo/test/pull-twice.t +4 -4
- data/vendor/git-subrepo/test/pull-worktree.t +5 -5
- data/vendor/git-subrepo/test/pull.t +14 -14
- data/vendor/git-subrepo/test/push-after-init.t +7 -6
- data/vendor/git-subrepo/test/push-after-push-no-changes.t +27 -0
- data/vendor/git-subrepo/test/push-force.t +7 -6
- data/vendor/git-subrepo/test/push-new-branch.t +10 -10
- data/vendor/git-subrepo/test/push-no-changes.t +3 -3
- data/vendor/git-subrepo/test/push-squash.t +7 -7
- data/vendor/git-subrepo/test/push.t +35 -34
- data/vendor/git-subrepo/test/rebase.t +63 -0
- data/vendor/git-subrepo/test/reclone.t +15 -8
- data/vendor/git-subrepo/test/setup +62 -55
- data/vendor/git-subrepo/test/shellcheck.t +37 -0
- data/vendor/git-subrepo/test/status.t +47 -27
- data/vendor/git-subrepo/test/submodule.t +4 -4
- data/vendor/git-subrepo/test/zsh.t +27 -0
- metadata +42 -22
|
@@ -3,8 +3,6 @@ git-subrepo
|
|
|
3
3
|
|
|
4
4
|
Git Submodule Alternative
|
|
5
5
|
|
|
6
|
-
<badge travis ingydotnet/git-subrepo>
|
|
7
|
-
|
|
8
6
|
= Synopsis
|
|
9
7
|
|
|
10
8
|
git subrepo -h # Help Overview
|
|
@@ -90,7 +88,7 @@ experienced Git users.
|
|
|
90
88
|
Please note that the commands are /not/ exact equivalents, and do not take all
|
|
91
89
|
the same arguments. Keep reading…
|
|
92
90
|
|
|
93
|
-
- `git subrepo clone <repository> [<subdir>] [-b <branch>] [-f] [-m <msg>] [-e] [--method <merge|rebase>]`
|
|
91
|
+
- `git subrepo clone <repository> [<subdir>] [-b <branch>] [-f] [-m <msg>] [--file=<msg file>] [-e] [--method <merge|rebase>]`
|
|
94
92
|
|
|
95
93
|
Add a repository as a subrepo in a subdir of your repository.
|
|
96
94
|
|
|
@@ -112,8 +110,8 @@ the same arguments. Keep reading…
|
|
|
112
110
|
The `--method` option will decide how the join process between branches are
|
|
113
111
|
performed. The default option is merge.
|
|
114
112
|
|
|
115
|
-
The `clone` command accepts the `--branch=` `--edit`, `--force`
|
|
116
|
-
`--message=` options.
|
|
113
|
+
The `clone` command accepts the `--branch=` `--edit`, `--file`, `--force`
|
|
114
|
+
and `--message=` options.
|
|
117
115
|
|
|
118
116
|
- `git subrepo init <subdir> [-r <remote>] [-b <branch>] [--method <merge|rebase>]`
|
|
119
117
|
|
|
@@ -128,7 +126,7 @@ the same arguments. Keep reading…
|
|
|
128
126
|
If you specify the `--remote` (and optionally the `--branch`) option, the
|
|
129
127
|
values will be added to the `<subdir>/.gitrepo` file. The `--remote` option
|
|
130
128
|
is the upstream URL, and the `--branch` option is the upstream branch to push
|
|
131
|
-
to. These values will be needed to do a `git subrepo push` command,
|
|
129
|
+
to. These values will be needed to do a `git subrepo push` command, but they
|
|
132
130
|
can be provided later on the `push` command (and saved to `<subdir>/.gitrepo`
|
|
133
131
|
if you also specify the `--update` option).
|
|
134
132
|
|
|
@@ -140,7 +138,7 @@ the same arguments. Keep reading…
|
|
|
140
138
|
|
|
141
139
|
The `init` command accepts the `--branch=` and `--remote=` options.
|
|
142
140
|
|
|
143
|
-
- `git subrepo pull <subdir>|--all [-M|-R|-f] [-m <msg>] [-e] [-b <branch>] [-r <remote>] [-u]`
|
|
141
|
+
- `git subrepo pull <subdir>|--all [-M|-R|-f] [-m <msg>] [--file=<msg file>] [-e] [-b <branch>] [-r <remote>] [-u]`
|
|
144
142
|
|
|
145
143
|
Update the subrepo subdir with the latest upstream changes.
|
|
146
144
|
|
|
@@ -185,10 +183,10 @@ the same arguments. Keep reading…
|
|
|
185
183
|
|
|
186
184
|
The set of commands used above are described in detail below.
|
|
187
185
|
|
|
188
|
-
The `pull` command accepts the `--all`, `--branch=`, `--edit`, `--
|
|
189
|
-
`--message=`, `--remote=` and `--update` options.
|
|
186
|
+
The `pull` command accepts the `--all`, `--branch=`, `--edit`, `--file`,
|
|
187
|
+
`--force`, `--message=`, `--remote=` and `--update` options.
|
|
190
188
|
|
|
191
|
-
- `git subrepo push <subdir>|--all [<branch>] [-r <remote>] [-b <branch>] [-M|-R] [-u] [-f] [-s] [-N]`
|
|
189
|
+
- `git subrepo push <subdir>|--all [<branch>] [-m msg] [--file=<msg file>] [-r <remote>] [-b <branch>] [-M|-R] [-u] [-f] [-s] [-N]`
|
|
192
190
|
|
|
193
191
|
Push a properly merged subrepo branch back upstream.
|
|
194
192
|
|
|
@@ -212,10 +210,11 @@ the same arguments. Keep reading…
|
|
|
212
210
|
discouraged. Only use this option if you fully understand it. (The `--force`
|
|
213
211
|
option will NOT check for a proper merge. ANY branch will be force pushed!)
|
|
214
212
|
|
|
215
|
-
The `push` command accepts the `--all`, `--branch=`, `--dry-run`, `--
|
|
216
|
-
`--merge`, `--rebase`, `--remote=`, `--squash` and
|
|
213
|
+
The `push` command accepts the `--all`, `--branch=`, `--dry-run`, `--file`,
|
|
214
|
+
`--force`, `--merge`, `--message`, `--rebase`, `--remote=`, `--squash` and
|
|
215
|
+
`--update` options.
|
|
217
216
|
|
|
218
|
-
- `git subrepo fetch <subdir>|--all [-r <remote>] [-b <branch>]`
|
|
217
|
+
- `git subrepo fetch <subdir>|--force --all [-r <remote>] [-b <branch>]`
|
|
219
218
|
|
|
220
219
|
Fetch the remote/upstream content for a subrepo.
|
|
221
220
|
|
|
@@ -224,7 +223,7 @@ the same arguments. Keep reading…
|
|
|
224
223
|
`subrepo/<subdir>`. These are temporary and you can easily remove them with
|
|
225
224
|
the subrepo `clean` command.
|
|
226
225
|
|
|
227
|
-
The `fetch` command accepts the `--all`, `--branch=` and `--remote=` options.
|
|
226
|
+
The `fetch` command accepts the `--force`, `--all`, `--branch=` and `--remote=` options.
|
|
228
227
|
|
|
229
228
|
- `git subrepo branch <subdir>|--all [-f] [-F]`
|
|
230
229
|
|
|
@@ -239,7 +238,7 @@ the same arguments. Keep reading…
|
|
|
239
238
|
|
|
240
239
|
The `branch` command accepts the `--all`, `--fetch` and `--force` options.
|
|
241
240
|
|
|
242
|
-
- `git subrepo commit <subdir> [<subrepo-ref>] [-m <msg>] [-e] [-f] [-F]`
|
|
241
|
+
- `git subrepo commit <subdir> [<subrepo-ref>] [-m <msg>] [--file=<msg file>] [-e] [-f] [-F]`
|
|
243
242
|
|
|
244
243
|
Add subrepo branch to current history as a single commit.
|
|
245
244
|
|
|
@@ -252,8 +251,8 @@ the same arguments. Keep reading…
|
|
|
252
251
|
branch history. That way the same branch can push upstream. Use the
|
|
253
252
|
`--force` option to commit anyway.
|
|
254
253
|
|
|
255
|
-
The `commit` command accepts the `--edit`, `--fetch`, `--force`
|
|
256
|
-
`--message=` options.
|
|
254
|
+
The `commit` command accepts the `--edit`, `--fetch`, `--file`, `--force`
|
|
255
|
+
and `--message=` options.
|
|
257
256
|
|
|
258
257
|
- `git subrepo status [<subdir>|--all|--ALL] [-F] [-q|-v]`
|
|
259
258
|
|
|
@@ -370,6 +369,10 @@ the same arguments. Keep reading…
|
|
|
370
369
|
|
|
371
370
|
Use this option to fetch the upstream commits, before running the command.
|
|
372
371
|
|
|
372
|
+
- `--file=<commit msg file>`
|
|
373
|
+
|
|
374
|
+
Supply your own commit message from a file
|
|
375
|
+
|
|
373
376
|
- `--force` (`-f`)
|
|
374
377
|
|
|
375
378
|
Use this option to force certain commands that fail in the general case.
|
|
@@ -574,7 +577,7 @@ is called:
|
|
|
574
577
|
|
|
575
578
|
= Status
|
|
576
579
|
|
|
577
|
-
The git-subrepo command has been in
|
|
580
|
+
The git-subrepo command has been used in production and seems to get
|
|
578
581
|
the job done. Development is still ongoing but mostly just for fixing bugs.
|
|
579
582
|
|
|
580
583
|
Trying subrepo out is simple and painless (this is not `git submodule`).
|
|
@@ -600,6 +603,7 @@ If you want to chat about the `git-subrepo` command, join `#gitcommands` on
|
|
|
600
603
|
|
|
601
604
|
* Ingy döt Net <ingy@ingy.net>
|
|
602
605
|
* Magnus Carlsson <grimmymail@gmail.com>
|
|
606
|
+
* Austin Morgan <admorgan@morgancomputers.net>
|
|
603
607
|
|
|
604
608
|
= License and Copyright
|
|
605
609
|
|
|
@@ -61,7 +61,7 @@ article is about.
|
|
|
61
61
|
Submodules tend to receive a lot of bad press. Here's some of it:
|
|
62
62
|
|
|
63
63
|
* http://ayende.com/blog/4746/the-problem-with-git-submodules
|
|
64
|
-
* http://somethingsinistral.net/blog/git-submodules-are-probably-not-the-answer/
|
|
64
|
+
* https://web.archive.org/web/20171101202911/http://somethingsinistral.net/blog/git-submodules-are-probably-not-the-answer/
|
|
65
65
|
* http://codingkilledthecat.wordpress.com/2012/04/28/why-your-company-shouldnt-use-git-submodules/
|
|
66
66
|
|
|
67
67
|
A quick recap of some of the good and bad things about submodules:
|
|
@@ -227,9 +227,7 @@ Good:
|
|
|
227
227
|
* Pushed history is kept intact.
|
|
228
228
|
* Creates a clean historical view. (See below)
|
|
229
229
|
* Bash code is very simple and easy to follow.
|
|
230
|
-
* Comprehensive test suite.
|
|
231
|
-
|
|
232
|
-
<badge travis ingydotnet/git-subrepo>
|
|
230
|
+
* Comprehensive test suite.
|
|
233
231
|
|
|
234
232
|
Bad:
|
|
235
233
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
; DO NOT EDIT (unless you know what you are doing)
|
|
2
|
+
;
|
|
3
|
+
; This subdirectory is a git "subrepo", and this file is maintained by the
|
|
4
|
+
; git-subrepo command. See https://github.com/git-commands/git-subrepo#readme
|
|
5
|
+
;
|
|
6
|
+
[subrepo]
|
|
7
|
+
remote = git@github.com:ingydotnet/bashplus.git
|
|
8
|
+
branch = master
|
|
9
|
+
commit = 030d196bf621e971e223e95e73c235e6992b85e0
|
|
10
|
+
parent = 2c14be68fc5196ed1210d759421b33ef91c3e3db
|
|
11
|
+
cmdver = 0.4.1
|
|
12
|
+
method = merge
|
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
---
|
|
2
|
+
version: 0.1.0
|
|
3
|
+
date: Sat 14 Nov 2020 10:14:14 AM EST
|
|
4
|
+
changes:
|
|
5
|
+
- Add tests for version-check
|
|
6
|
+
- Improve version-check
|
|
7
|
+
- Move PATH assignment into test/setup
|
|
8
|
+
- Meta bashplus supports Bash 3.2
|
|
9
|
+
---
|
|
10
|
+
version: 0.0.9
|
|
11
|
+
date: Wed 11 Nov 2020 02:19:32 PM EST
|
|
12
|
+
changes:
|
|
13
|
+
- Apply shellcheck fixes
|
|
14
|
+
- Modernize bash code
|
|
15
|
+
---
|
|
16
|
+
version: 0.0.8
|
|
17
|
+
date: Fri Aug 21 08:00:45 PDT 2020
|
|
18
|
+
changes:
|
|
19
|
+
- Support paths with spaces @admorgan++
|
|
20
|
+
---
|
|
2
21
|
version: 0.0.7
|
|
3
22
|
date: Sat Jan 23 16:28:59 PST 2016
|
|
4
23
|
changes:
|
|
@@ -15,6 +15,10 @@ INSTALL_DIR ?= test
|
|
|
15
15
|
INSTALL_MAN1 ?= $(shell bpan env BPAN_MAN1)
|
|
16
16
|
INSTALL_MAN3 ?= $(shell bpan env BPAN_MAN3)
|
|
17
17
|
|
|
18
|
+
DOCKER_IMAGE := ingy/bash-testing:0.0.1
|
|
19
|
+
DOCKER_TESTS := 5.1 5.0 4.4 4.3 4.2 4.1 4.0 3.2
|
|
20
|
+
DOCKER_TESTS := $(DOCKER_TESTS:%=docker-test-%)
|
|
21
|
+
|
|
18
22
|
default: help
|
|
19
23
|
|
|
20
24
|
help:
|
|
@@ -24,6 +28,13 @@ help:
|
|
|
24
28
|
test:
|
|
25
29
|
prove $(PROVEOPT:%=% )test/
|
|
26
30
|
|
|
31
|
+
test-all: test docker-test
|
|
32
|
+
|
|
33
|
+
docker-test: $(DOCKER_TESTS)
|
|
34
|
+
|
|
35
|
+
$(DOCKER_TESTS):
|
|
36
|
+
$(call docker-make-test,$(@:docker-test-%=%))
|
|
37
|
+
|
|
27
38
|
install:
|
|
28
39
|
install -C -d -m 0755 $(INSTALL_LIB)/$(INSTALL_DIR)/
|
|
29
40
|
install -C -m 0755 $(LIB) $(INSTALL_LIB)/$(INSTALL_DIR)/
|
|
@@ -43,3 +54,17 @@ $(MAN1)/%.1: doc/%.swim
|
|
|
43
54
|
|
|
44
55
|
$(MAN3)/%.3: doc/%.swim
|
|
45
56
|
swim --to=man $< > $@
|
|
57
|
+
|
|
58
|
+
define docker-make-test
|
|
59
|
+
docker run -i -t --rm \
|
|
60
|
+
-v $(PWD):/git-subrepo \
|
|
61
|
+
-w /git-subrepo \
|
|
62
|
+
$(DOCKER_IMAGE) \
|
|
63
|
+
/bin/bash -c ' \
|
|
64
|
+
set -x && \
|
|
65
|
+
[[ -d /bash-$(1) ]] && \
|
|
66
|
+
export PATH=/bash-$(1)/bin:$$PATH && \
|
|
67
|
+
bash --version && \
|
|
68
|
+
make test \
|
|
69
|
+
'
|
|
70
|
+
endef
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
=meta: 0.0.2
|
|
2
2
|
|
|
3
3
|
name: bashplus
|
|
4
|
-
version: 0.0
|
|
4
|
+
version: 0.1.0
|
|
5
5
|
abstract: Modern Bash Programming
|
|
6
|
-
homepage:
|
|
6
|
+
homepage: https://github.com/ingydotnet/bashplus
|
|
7
7
|
|
|
8
8
|
license: MIT
|
|
9
|
-
copyright: 2013-
|
|
9
|
+
copyright: 2013-2020
|
|
10
10
|
author:
|
|
11
11
|
name: Ingy döt Net
|
|
12
12
|
email: ingy@ingy.net
|
|
@@ -16,7 +16,7 @@ author:
|
|
|
16
16
|
homepage: http://ingy.net
|
|
17
17
|
|
|
18
18
|
requires:
|
|
19
|
-
bash: 3.2
|
|
19
|
+
bash: 3.2
|
|
20
20
|
test:
|
|
21
21
|
cmd: make test
|
|
22
22
|
install:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=pod
|
|
2
2
|
|
|
3
3
|
=for comment
|
|
4
|
-
DO NOT EDIT. This Pod was generated by Swim v0.1.
|
|
4
|
+
DO NOT EDIT. This Pod was generated by Swim v0.1.48.
|
|
5
5
|
See http://github.com/ingydotnet/swim-pm#readme
|
|
6
6
|
|
|
7
7
|
=encoding utf8
|
|
@@ -70,7 +70,7 @@ Written by Ingy döt Net <ingy@ingy.net>
|
|
|
70
70
|
|
|
71
71
|
=head1 Copyright & License
|
|
72
72
|
|
|
73
|
-
Copyright 2013-
|
|
73
|
+
Copyright 2013-2020. Ingy döt Net.
|
|
74
74
|
|
|
75
75
|
The MIT License (MIT).
|
|
76
76
|
|
|
@@ -2,29 +2,30 @@
|
|
|
2
2
|
#------------------------------------------------------------------------------
|
|
3
3
|
# Bash+ - Modern Bash Programming
|
|
4
4
|
#
|
|
5
|
-
# Copyright (c) 2013-
|
|
5
|
+
# Copyright (c) 2013-2020 Ingy döt Net
|
|
6
6
|
#------------------------------------------------------------------------------
|
|
7
7
|
|
|
8
8
|
set -e
|
|
9
|
-
shopt -s compat31&>/dev/null
|
|
9
|
+
shopt -s compat31 &>/dev/null || true
|
|
10
10
|
|
|
11
11
|
#------------------------------------------------------------------------------
|
|
12
12
|
# Determine how `bash+` was called, and do the right thing:
|
|
13
13
|
#------------------------------------------------------------------------------
|
|
14
|
-
if [
|
|
14
|
+
if [[ ${BASH_SOURCE[0]} != "$0" ]]; then
|
|
15
15
|
# 'bash+' is being sourced:
|
|
16
|
-
[[
|
|
16
|
+
[[ ${BASH_SOURCE[0]} =~ /bin/bash\\+$ ]] || {
|
|
17
17
|
echo "Invalid Bash+ path '${BASH_SOURCE[0]}'" 2> /dev/null
|
|
18
18
|
exit 1
|
|
19
19
|
}
|
|
20
20
|
source "${BASH_SOURCE[0]%/bin/*}"/lib/bash+.bash || return $?
|
|
21
21
|
bash+:import "$@"
|
|
22
22
|
return $?
|
|
23
|
+
|
|
23
24
|
else
|
|
24
|
-
if [ $# -eq 1
|
|
25
|
-
echo 'bash+ version 0.0.
|
|
25
|
+
if [[ $# -eq 1 ]] && [[ $1 == --version ]]; then
|
|
26
|
+
echo 'bash+ version 0.0.9'
|
|
26
27
|
else
|
|
27
|
-
|
|
28
|
+
cat <<'...'
|
|
28
29
|
|
|
29
30
|
Greetings modern Bash programmer. Welcome to Bash+!
|
|
30
31
|
|
|
@@ -1,34 +1,66 @@
|
|
|
1
1
|
# bash+ - Modern Bash Programming
|
|
2
2
|
#
|
|
3
|
-
# Copyright (c) 2013-
|
|
3
|
+
# Copyright (c) 2013-2020 Ingy döt Net
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
set -e
|
|
6
|
+
|
|
7
|
+
[[ ${BASHPLUS_VERSION-} ]] && return 0
|
|
8
|
+
|
|
9
|
+
BASHPLUS_VERSION=0.1.0
|
|
10
|
+
|
|
11
|
+
bash+:version-check() {
|
|
12
|
+
local cmd want got out
|
|
13
|
+
|
|
14
|
+
IFS=' ' read -r -a cmd <<< "${1:?}"
|
|
15
|
+
IFS=. read -r -a want <<< "${2:?}"
|
|
16
|
+
: "${want[0]:=0}"
|
|
17
|
+
: "${want[1]:=0}"
|
|
18
|
+
: "${want[2]:=0}"
|
|
19
|
+
|
|
20
|
+
if [[ ${cmd[*]} == bash ]]; then
|
|
21
|
+
got=("${BASH_VERSINFO[@]}")
|
|
22
|
+
BASHPLUS_VERSION_CHECK=${BASH_VERSION-}
|
|
23
|
+
else
|
|
24
|
+
[[ ${#cmd[*]} -gt 1 ]] || cmd+=(--version)
|
|
25
|
+
out=$("${cmd[@]}") ||
|
|
26
|
+
{ echo "Failed to run '${cmd[*]}'" >&2; exit 1; }
|
|
27
|
+
[[ $out =~ ([0-9]+\.[0-9]+(\.[0-9]+)?) ]] ||
|
|
28
|
+
{ echo "Can't determine version number from '${cmd[*]}'" >&2; exit 1; }
|
|
29
|
+
BASHPLUS_VERSION_CHECK=${BASH_REMATCH[1]}
|
|
30
|
+
IFS=. read -r -a got <<< "$BASHPLUS_VERSION_CHECK"
|
|
31
|
+
fi
|
|
32
|
+
: "${got[2]:=0}"
|
|
33
|
+
|
|
34
|
+
(( got[0] > want[0] || ((
|
|
35
|
+
got[0] == want[0] && ((
|
|
36
|
+
got[1] > want[1] || ((
|
|
37
|
+
got[1] == want[1] && got[2] >= want[2]
|
|
38
|
+
)) )) )) ))
|
|
14
39
|
}
|
|
15
40
|
|
|
16
|
-
|
|
41
|
+
bash+:version-check bash 3.2 ||
|
|
42
|
+
{ echo "The 'bashplus' library requires 'Bash 3.2+'." >&2; exit 1; }
|
|
17
43
|
|
|
18
|
-
|
|
44
|
+
@() (echo "$@") # XXX do we want to keep this?
|
|
19
45
|
|
|
20
|
-
|
|
46
|
+
bash+:export:std() {
|
|
47
|
+
set -o pipefail
|
|
21
48
|
|
|
22
|
-
|
|
23
|
-
|
|
49
|
+
if bash+:version-check bash 4.4; then
|
|
50
|
+
set -o nounset
|
|
51
|
+
shopt -s inherit_errexit
|
|
52
|
+
fi
|
|
53
|
+
|
|
54
|
+
echo use die warn
|
|
55
|
+
}
|
|
24
56
|
|
|
25
57
|
# Source a bash library call import on it:
|
|
26
58
|
bash+:use() {
|
|
27
|
-
local library_name
|
|
28
|
-
local library_path=; library_path
|
|
29
|
-
[[
|
|
59
|
+
local library_name=${1:?bash+:use requires library name}; shift
|
|
60
|
+
local library_path=; library_path=$(bash+:findlib "$library_name") || true
|
|
61
|
+
[[ $library_path ]] ||
|
|
30
62
|
bash+:die "Can't find library '$library_name'." 1
|
|
31
|
-
|
|
63
|
+
|
|
32
64
|
source "$library_path"
|
|
33
65
|
if bash+:can "$library_name:import"; then
|
|
34
66
|
"$library_name:import" "$@"
|
|
@@ -42,9 +74,11 @@ bash+:import() {
|
|
|
42
74
|
local arg=
|
|
43
75
|
for arg; do
|
|
44
76
|
if [[ $arg =~ ^: ]]; then
|
|
45
|
-
|
|
77
|
+
# Word splitting required here
|
|
78
|
+
# shellcheck disable=2046
|
|
79
|
+
bash+:import $(bash+:export"$arg")
|
|
46
80
|
else
|
|
47
|
-
bash+:fcopy bash+:$arg $arg
|
|
81
|
+
bash+:fcopy "bash+:$arg" "$arg"
|
|
48
82
|
fi
|
|
49
83
|
done
|
|
50
84
|
}
|
|
@@ -53,38 +87,51 @@ bash+:import() {
|
|
|
53
87
|
bash+:fcopy() {
|
|
54
88
|
bash+:can "${1:?bash+:fcopy requires an input function name}" ||
|
|
55
89
|
bash+:die "'$1' is not a function" 2
|
|
56
|
-
local func
|
|
57
|
-
|
|
90
|
+
local func
|
|
91
|
+
func=$(type "$1" 3>/dev/null | tail -n+3)
|
|
92
|
+
[[ ${3-} ]] && "$3"
|
|
58
93
|
eval "${2:?bash+:fcopy requires an output function name}() $func"
|
|
59
94
|
}
|
|
60
95
|
|
|
61
96
|
# Find the path of a library
|
|
62
97
|
bash+:findlib() {
|
|
63
|
-
local library_name
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
98
|
+
local library_name
|
|
99
|
+
library_name=$(tr '[:upper:]' '[:lower:]' <<< "${1//:://}").bash
|
|
100
|
+
local lib=${BASHPLUSLIB:-${BASHLIB:-$PATH}}
|
|
101
|
+
library_name=${library_name//+/\\+}
|
|
102
|
+
IFS=':' read -r -a libs <<< "$lib"
|
|
103
|
+
find "${libs[@]}" -name "${library_name##*/}" 2>/dev/null |
|
|
67
104
|
grep -E "$library_name\$" |
|
|
68
105
|
head -n1
|
|
69
106
|
}
|
|
70
107
|
|
|
71
108
|
bash+:die() {
|
|
72
|
-
local msg
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
109
|
+
local msg=${1:-Died}
|
|
110
|
+
msg=${msg//\\n/$'\n'}
|
|
111
|
+
|
|
112
|
+
printf "%s" "$msg" >&2
|
|
113
|
+
if [[ $msg == *$'\n' ]]; then
|
|
114
|
+
exit 1
|
|
115
|
+
else
|
|
116
|
+
printf "\n"
|
|
117
|
+
fi
|
|
118
|
+
|
|
119
|
+
local c
|
|
120
|
+
IFS=' ' read -r -a c <<< "$(caller "${DIE_STACK_LEVEL:-${2:-0}}")"
|
|
121
|
+
if (( ${#c[@]} == 2 )); then
|
|
122
|
+
msg=" at line %d of %s"
|
|
123
|
+
else
|
|
80
124
|
msg=" at line %d in %s of %s"
|
|
81
|
-
|
|
125
|
+
fi
|
|
126
|
+
|
|
127
|
+
# shellcheck disable=2059
|
|
128
|
+
printf "$msg\n" "${c[@]}" >&2
|
|
82
129
|
exit 1
|
|
83
130
|
}
|
|
84
131
|
|
|
85
132
|
bash+:warn() {
|
|
86
|
-
local msg
|
|
87
|
-
printf "${msg//\\n/$'\n'}\n" >&2
|
|
133
|
+
local msg=${1:-Warning}
|
|
134
|
+
printf "%s" "${msg//\\n/$'\n'}\n" >&2
|
|
88
135
|
}
|
|
89
136
|
|
|
90
137
|
bash+:can() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.\" Automatically generated by Pod::Man
|
|
1
|
+
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
|
2
2
|
.\"
|
|
3
3
|
.\" Standard preamble:
|
|
4
4
|
.\" ========================================================================
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
.ie \n(.g .ds Aq \(aq
|
|
47
47
|
.el .ds Aq '
|
|
48
48
|
.\"
|
|
49
|
-
.\" If the F register is
|
|
49
|
+
.\" If the F register is >0, we'll generate index entries on stderr for
|
|
50
50
|
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
|
|
51
51
|
.\" entries marked with X<> in POD. Of course, you'll have to process the
|
|
52
52
|
.\" output yourself in some meaningful fashion.
|
|
@@ -56,12 +56,12 @@
|
|
|
56
56
|
..
|
|
57
57
|
.nr rF 0
|
|
58
58
|
.if \n(.g .if rF .nr rF 1
|
|
59
|
-
.if (\n(rF:(\n(.g==0)) \{
|
|
60
|
-
. if \nF \{
|
|
59
|
+
.if (\n(rF:(\n(.g==0)) \{\
|
|
60
|
+
. if \nF \{\
|
|
61
61
|
. de IX
|
|
62
62
|
. tm Index:\\$1\t\\n%\t"\\$2"
|
|
63
63
|
..
|
|
64
|
-
. if !\nF==2 \{
|
|
64
|
+
. if !\nF==2 \{\
|
|
65
65
|
. nr % 0
|
|
66
66
|
. nr F 2
|
|
67
67
|
. \}
|
|
@@ -70,8 +70,8 @@
|
|
|
70
70
|
.rr rF
|
|
71
71
|
.\" ========================================================================
|
|
72
72
|
.\"
|
|
73
|
-
.IX Title "
|
|
74
|
-
.TH
|
|
73
|
+
.IX Title "STDIN 1"
|
|
74
|
+
.TH STDIN 1 "November 2020" "Generated by Swim v0.1.48" "Modern Bash Programming"
|
|
75
75
|
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
|
76
76
|
.\" way too many mistakes in technical documents.
|
|
77
77
|
.if n .ad l
|
|
@@ -129,6 +129,6 @@ If you are interested in chatting about this, \f(CW\*(C`/join #bpan\*(C'\fR on i
|
|
|
129
129
|
Written by Ingy döt Net <ingy@ingy.net>
|
|
130
130
|
.SH "Copyright & License"
|
|
131
131
|
.IX Header "Copyright & License"
|
|
132
|
-
Copyright 2013\-
|
|
132
|
+
Copyright 2013\-2020. Ingy döt Net.
|
|
133
133
|
.PP
|
|
134
134
|
The \s-1MIT\s0 License (\s-1MIT\s0).
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.\" Automatically generated by Pod::Man
|
|
1
|
+
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
|
2
2
|
.\"
|
|
3
3
|
.\" Standard preamble:
|
|
4
4
|
.\" ========================================================================
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
.ie \n(.g .ds Aq \(aq
|
|
47
47
|
.el .ds Aq '
|
|
48
48
|
.\"
|
|
49
|
-
.\" If the F register is
|
|
49
|
+
.\" If the F register is >0, we'll generate index entries on stderr for
|
|
50
50
|
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
|
|
51
51
|
.\" entries marked with X<> in POD. Of course, you'll have to process the
|
|
52
52
|
.\" output yourself in some meaningful fashion.
|
|
@@ -56,12 +56,12 @@
|
|
|
56
56
|
..
|
|
57
57
|
.nr rF 0
|
|
58
58
|
.if \n(.g .if rF .nr rF 1
|
|
59
|
-
.if (\n(rF:(\n(.g==0)) \{
|
|
60
|
-
. if \nF \{
|
|
59
|
+
.if (\n(rF:(\n(.g==0)) \{\
|
|
60
|
+
. if \nF \{\
|
|
61
61
|
. de IX
|
|
62
62
|
. tm Index:\\$1\t\\n%\t"\\$2"
|
|
63
63
|
..
|
|
64
|
-
. if !\nF==2 \{
|
|
64
|
+
. if !\nF==2 \{\
|
|
65
65
|
. nr % 0
|
|
66
66
|
. nr F 2
|
|
67
67
|
. \}
|
|
@@ -70,8 +70,8 @@
|
|
|
70
70
|
.rr rF
|
|
71
71
|
.\" ========================================================================
|
|
72
72
|
.\"
|
|
73
|
-
.IX Title "
|
|
74
|
-
.TH
|
|
73
|
+
.IX Title "STDIN 1"
|
|
74
|
+
.TH STDIN 1 "November 2020" "Generated by Swim v0.1.48" "Modern Bash Programming"
|
|
75
75
|
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
|
76
76
|
.\" way too many mistakes in technical documents.
|
|
77
77
|
.if n .ad l
|
|
@@ -129,6 +129,6 @@ If you are interested in chatting about this, \f(CW\*(C`/join #bpan\*(C'\fR on i
|
|
|
129
129
|
Written by Ingy döt Net <ingy@ingy.net>
|
|
130
130
|
.SH "Copyright & License"
|
|
131
131
|
.IX Header "Copyright & License"
|
|
132
|
-
Copyright 2013\-
|
|
132
|
+
Copyright 2013\-2020. Ingy döt Net.
|
|
133
133
|
.PP
|
|
134
134
|
The \s-1MIT\s0 License (\s-1MIT\s0).
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
#!/bin/bash
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
|
-
source test/
|
|
3
|
+
source test/setup
|
|
4
4
|
|
|
5
|
-
PATH=$PWD/bin:$PATH
|
|
6
5
|
source bash+ :std
|
|
7
6
|
|
|
8
|
-
ok $? '
|
|
7
|
+
ok $? "'source bash+' works"
|
|
9
8
|
|
|
10
|
-
is "$BASHPLUS_VERSION" '0.0
|
|
9
|
+
is "$BASHPLUS_VERSION" '0.1.0' 'BASHPLUS_VERSION is 0.1.0'
|
|
11
10
|
|
|
12
11
|
done_testing 2
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
source test/setup
|
|
4
|
+
|
|
5
|
+
source bash+ :std
|
|
6
|
+
|
|
7
|
+
got=$(die "Nope" 2>&1) || true
|
|
8
|
+
want="Nope
|
|
9
|
+
at line 7 in main of test/die.t"
|
|
10
|
+
is "$got" "$want" "die() msg ok"
|
|
11
|
+
|
|
12
|
+
got=$(die "Nope\n" 2>&1) || true
|
|
13
|
+
want="Nope"
|
|
14
|
+
is "$got" "$want" "die() msg ok"
|
|
15
|
+
|
|
16
|
+
done_testing 2
|