@kova1/pullr 0.8.0 → 0.9.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.
- package/README.md +4 -1
- package/bin/pullr +15 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -78,6 +78,9 @@ first. It will never:
|
|
|
78
78
|
pullr [options] [DIR]
|
|
79
79
|
```
|
|
80
80
|
|
|
81
|
+
Short options can be combined: `-rs` is `-r -s`, and `-j8` or `-rj 8` set
|
|
82
|
+
the number of jobs.
|
|
83
|
+
|
|
81
84
|
| Option | Default | Meaning |
|
|
82
85
|
| :--- | :--- | :--- |
|
|
83
86
|
| `DIR` | current directory | Where to look for repositories |
|
|
@@ -86,7 +89,7 @@ pullr [options] [DIR]
|
|
|
86
89
|
| `-n`, `--dry-run` | | Show what a run would do without pulling, see below |
|
|
87
90
|
| `-r`, `--rebase` | off | Rebase local commits onto the upstream instead of refusing a diverged branch (`git pull --rebase`). A rebase that hits a conflict is aborted and the repository is left as it was. |
|
|
88
91
|
| `--no-autostash` | | Don't stash local changes that are in the way of an update; report the repository as dirty instead. Autostash is on by default, see "What it will never do". |
|
|
89
|
-
| `--submodules` | off | Also fast-forward each submodule that is checked out on a branch, see below |
|
|
92
|
+
| `-s`, `--submodules` | off | Also fast-forward each submodule that is checked out on a branch, see below |
|
|
90
93
|
| `--no-color` | | Disable colored output. Also disabled when the [`NO_COLOR`](https://no-color.org) environment variable is set, or when output is not a terminal. |
|
|
91
94
|
| `-V`, `--version` | | Print the version |
|
|
92
95
|
| `-h`, `--help` | | Show help |
|
package/bin/pullr
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# Usage: pullr [--jobs N] [--max-depth N] [--dry-run] [--rebase] [--no-autostash] [--submodules] [--no-color] [DIR]
|
|
4
4
|
set -euo pipefail
|
|
5
5
|
|
|
6
|
-
VERSION="0.
|
|
6
|
+
VERSION="0.9.0" # set by the release workflow
|
|
7
7
|
|
|
8
8
|
usage() {
|
|
9
9
|
cat <<'EOF'
|
|
@@ -29,13 +29,15 @@ Options:
|
|
|
29
29
|
made and they are re-applied; if re-applying conflicts,
|
|
30
30
|
the repository is put back exactly as it was.
|
|
31
31
|
--autostash The default; accepted for scripts that want to be explicit.
|
|
32
|
-
|
|
32
|
+
-s, --submodules Also fast-forward each submodule that is checked out on a
|
|
33
33
|
branch, with the same rules as any other repository.
|
|
34
34
|
Submodules on a detached HEAD are skipped.
|
|
35
35
|
--no-color Disable colored output. Also disabled when NO_COLOR is
|
|
36
36
|
set (https://no-color.org) or output is not a terminal.
|
|
37
37
|
-V, --version Print the version.
|
|
38
38
|
-h, --help Show this help.
|
|
39
|
+
|
|
40
|
+
Short options can be combined: -rs is -r -s, and -j8 or -rj 8 set the jobs.
|
|
39
41
|
EOF
|
|
40
42
|
}
|
|
41
43
|
|
|
@@ -50,6 +52,16 @@ root=""
|
|
|
50
52
|
|
|
51
53
|
while (($#)); do
|
|
52
54
|
case "$1" in
|
|
55
|
+
# bundled short options: split -rs into -r -s, and -j8 into -j 8
|
|
56
|
+
-[!-]?*)
|
|
57
|
+
opt="${1:1:1}" rest="${1:2}"
|
|
58
|
+
shift
|
|
59
|
+
if [[ "$opt" == j ]]; then
|
|
60
|
+
set -- -j "$rest" "$@"
|
|
61
|
+
else
|
|
62
|
+
set -- "-$opt" "-$rest" "$@"
|
|
63
|
+
fi
|
|
64
|
+
;;
|
|
53
65
|
-j|--jobs) jobs="${2:-}"; shift 2 || { usage >&2; exit 2; } ;;
|
|
54
66
|
--jobs=*) jobs="${1#*=}"; shift ;;
|
|
55
67
|
--max-depth) max_depth="${2:-}"; shift 2 || { usage >&2; exit 2; } ;;
|
|
@@ -58,7 +70,7 @@ while (($#)); do
|
|
|
58
70
|
-r|--rebase) rebase=1; shift ;;
|
|
59
71
|
--autostash) autostash=1; shift ;;
|
|
60
72
|
--no-autostash) autostash=0; shift ;;
|
|
61
|
-
|
|
73
|
+
-s|--submodules) submodules=1; shift ;;
|
|
62
74
|
--no-color) color=0; shift ;;
|
|
63
75
|
-h|--help) usage; exit 0 ;;
|
|
64
76
|
-V|--version) echo "pullr $VERSION"; exit 0 ;;
|