| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
- checkout → switch (git 2.23+) - branch parsing via sed/grep/tr → branch --show-current (git 2.22+) - egrep → grep -E (egrep is deprecated)
- branch: use 'git show-ref --verify --quiet' for branch existence checks instead of parsing 'git branch --no-color | grep'
- branch, merge: use 'git rev-parse --abbrev-ref @{upstream}' for tracking detection instead of parsing 'git branch -vv | awk'
- push: use 'git remote get-url --push' instead of parsing 'git remote show | grep Push | awk'
- drop the stray 'echo tracking=' debug line in merge
- branch: propagate exit code from 'git branch -d/-D' so failures (nonexistent branch, unmerged with -d) return non-zero - branch: quote $branch in git switch calls so names with spaces don't break (slashes already worked) - branch: drop redundant `[ -n "$x" ] && [ \! "$x" == '' ]` duplications - push: fix `[ -z $* ]` glob bug by switching to `$#` and an args array, so passthrough args with spaces/globs no longer misbehave - pull: replace locale-fragile "No local changes to save" string match with a refs/stash before/after comparison; bug would have caused 'git stash pop' to run against the wrong stash on localized git installs - pull, push: swap deprecated `which` for `command -v` - pull, push, merge: detect detached HEAD up-front with a friendly error instead of falling through to confusing git output and bogus exit codes - install.sh: add -fL to curl so HTTP errors fail loudly and redirects are followed, and quote paths
- branch: quote $branch in the list-mode test so weird names don't trip it - pull: simplify has_changed to drop the outer $(...). same behavior either way (bash propagates the inner exit code when the substitution is empty, and grep --quiet always is) but the unwrapped form doesn't depend on that quirk to read correctly
* Expand CI test coverage + add shellcheck job
new test steps:
- branch -d on a nonexistent branch must exit non-zero (was silently exit 0)
- branch name with `/` in it (common feature/* flow, never tested)
- detached HEAD: pull/push/merge must fail cleanly (was confusing fallthrough)
- pull: skips `git stash pop` when nothing was stashed
- pull: pop runs exactly once when something was stashed
- pull: package-manager install hooks (yarn) don't fire when their lockfile didn't change
- push: passthrough flag (--force-with-lease) doesn't get mangled
also a separate shellcheck job (warning-level) so we catch unquoted vars and similar before they ship.
stacked on top of modernize-git-commands — most of these tests rely on those fixes.
* Fix shellcheck warnings across scripts
- branch: replace `remotes=($(git remote))` with a portable while-read loop (mapfile isn't in macOS /bin/bash 3.2)
- pull: quote `cd "$(dirname ...)"` and add `|| return 1` on both `cd` calls
- push: use `grep -F '*'` for the literal-asterisk match, and unquote the rhs of `=~` so github.com matches as a regex
- install.sh: iterate with `"${FILES[@]}"` instead of `${FILES[*]}`
* Fix flaky CI test by resetting working tree after stash test
The "stash - passthrough arguments" test runs `stash pop` which reapplies its modification to file.txt, leaving every subsequent test running on a dirty working tree. That made the "pull - skips pop when nothing was stashed" assertion fail because pull correctly stashed the lingering modification.
- restore file.txt at the end of the stash passthrough test so later steps start clean
|
working OK for me so far on modern macOS and Ubuntu Linux 25 |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
quick swap of legacy git incantations across the 5 scripts for modern equivalents:
git 2.23 (Aug 2019) becomes the new floor, which feels safe.
to test: