gitbash 2.0.1 → 2.2.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 +116 -35
- package/bin/gitbash +145 -18
- package/commands/_self_update.sh +323 -0
- package/commands/_utils.sh +153 -9
- package/commands/branch.sh +3 -3
- package/commands/cleanstash.sh +1 -1
- package/commands/cleanup.sh +3 -3
- package/commands/commit.sh +1 -1
- package/commands/commits.sh +59 -10
- package/commands/create.sh +1 -1
- package/commands/pr.sh +3 -49
- package/commands/repo.sh +82 -0
- package/commands/reset-repo.sh +200 -0
- package/commands/stale.sh +2 -2
- package/commands/stash.sh +1 -1
- package/commands/stashes.sh +2 -2
- package/commands/status.sh +3 -3
- package/commands/switch.sh +16 -25
- package/commands/unstash.sh +6 -4
- package/commands/update.sh +1 -1
- package/docs/CONTRIBUTING.md +2 -1
- package/docs/SECURITY.md +1 -1
- package/package.json +4 -3
package/commands/unstash.sh
CHANGED
|
@@ -12,8 +12,8 @@ _stash_preview() {
|
|
|
12
12
|
printf '%s' '
|
|
13
13
|
sel=$(printf "%s" {} | grep -o "^stash@{[0-9]*}" || true)
|
|
14
14
|
if [[ -n "$sel" ]]; then
|
|
15
|
-
{ git stash show --include-untracked -p --color
|
|
16
|
-
git stash show -p --color
|
|
15
|
+
{ git stash show --include-untracked -p --color=$GB_COLOR "$sel" 2>/dev/null ||
|
|
16
|
+
git stash show -p --color=$GB_COLOR "$sel" 2>/dev/null; } | '"$pager"'
|
|
17
17
|
else
|
|
18
18
|
echo "No preview"
|
|
19
19
|
fi'
|
|
@@ -25,7 +25,7 @@ unstash() {
|
|
|
25
25
|
return 0
|
|
26
26
|
fi
|
|
27
27
|
if [[ "${1:-}" == "-h" || "${1:-}" == "--help" ]]; then
|
|
28
|
-
|
|
28
|
+
gb_help << 'EOF'
|
|
29
29
|
Usage: unstash [OPTIONS]
|
|
30
30
|
|
|
31
31
|
Apply a git stash to your working directory with optional removal.
|
|
@@ -84,7 +84,9 @@ EOF
|
|
|
84
84
|
fi
|
|
85
85
|
|
|
86
86
|
echo "Applying $stash_id ..."
|
|
87
|
-
|
|
87
|
+
# The restored files are good news: list them in green, not git's red
|
|
88
|
+
if ! git -c color.status.changed=green -c color.status.untracked=green \
|
|
89
|
+
stash apply "$stash_id"; then
|
|
88
90
|
print_error "Apply failed or had conflicts - the stash was kept."
|
|
89
91
|
return 1
|
|
90
92
|
fi
|
package/commands/update.sh
CHANGED
package/docs/CONTRIBUTING.md
CHANGED
|
@@ -104,6 +104,7 @@ When your PR is merged:
|
|
|
104
104
|
3. Changesets are consumed and version is bumped
|
|
105
105
|
4. CHANGELOG.md is automatically updated
|
|
106
106
|
5. Changes are published with `npm run release`
|
|
107
|
+
6. Pushing the `vX.Y.Z` tag triggers the Release workflow, which creates the GitHub release with that version's CHANGELOG.md section as its notes (re-run it for an existing tag via "Run workflow")
|
|
107
108
|
|
|
108
109
|
## Development Guidelines
|
|
109
110
|
|
|
@@ -124,7 +125,7 @@ shellcheck -x bin/gitbash commands/*.sh
|
|
|
124
125
|
|
|
125
126
|
Tests live in `test/*.bats`. Each test gets its own temporary repository with a local bare remote (`test/helpers/setup.bash`). fzf is replaced by a stub that records its arguments and answers from a plan (`test/helpers/bin/fzf`); `test/fzf_real.bats` drives the real fzf in a pseudo-terminal. Add a test for every bug fix.
|
|
126
127
|
|
|
127
|
-
CI runs shellcheck and the tests on Ubuntu (bash 5)
|
|
128
|
+
CI runs shellcheck and the tests on Ubuntu (bash 5), macOS (bash 3.2 and 5) and Windows (Git Bash). Scripts must keep LF line endings (`.gitattributes` enforces it).
|
|
128
129
|
|
|
129
130
|
### Code style:
|
|
130
131
|
- Follow existing bash script conventions; scripts must work with bash 3.2
|
package/docs/SECURITY.md
CHANGED
|
@@ -20,7 +20,7 @@ Versions before 2.0 executed repository `.gitbashrc` files as shell code, so ope
|
|
|
20
20
|
- Configuration files (`~/.gitbashrc`, a repository's `.gitbashrc` and `.gitbashrc-user`) are **parsed, never executed**. Only plain `GITBASH_*="value"` lines from a fixed list of settings are read; values containing `$`, backticks, backslashes or quotes are rejected.
|
|
21
21
|
- A repository's committed `.gitbashrc` is treated as untrusted: it cannot set `GITBASH_MERGE_COMMAND` (the only setting that names a program to run). That setting is only read from `~/.gitbashrc` and `.gitbashrc-user`.
|
|
22
22
|
- `gitbash --init` prints wrapper functions that call the installed `gitbash` binary; command code is not sourced into your shell.
|
|
23
|
-
- `pr` never
|
|
23
|
+
- `pr` and `repo` never pass credentials from the remote URL to the browser.
|
|
24
24
|
|
|
25
25
|
---
|
|
26
26
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gitbash",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "Opinionated git utilities for bash with fzf-powered menus",
|
|
5
5
|
"author": "jaggli",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,7 +35,8 @@
|
|
|
35
35
|
],
|
|
36
36
|
"os": [
|
|
37
37
|
"darwin",
|
|
38
|
-
"linux"
|
|
38
|
+
"linux",
|
|
39
|
+
"win32"
|
|
39
40
|
],
|
|
40
41
|
"engines": {
|
|
41
42
|
"node": ">=14"
|
|
@@ -44,7 +45,7 @@
|
|
|
44
45
|
"test": "bats test",
|
|
45
46
|
"changeset": "changeset",
|
|
46
47
|
"version": "changeset version",
|
|
47
|
-
"release": "
|
|
48
|
+
"release": "scripts/release.sh"
|
|
48
49
|
},
|
|
49
50
|
"devDependencies": {
|
|
50
51
|
"@changesets/cli": "^2.29.8",
|