- Use git for-each-ref instead of git branch -vv to avoid false
positives from commit messages containing ': gone]'
- Add interactive confirmation prompt by default; skip with -f/--force
- Add -p/--prune flag to run git fetch --prune before checking
- Add generated man page .1 and .html files
Adds a new command to delete local branches whose remote-tracking
branch has been deleted (shown as [gone] in git branch -vv).
This is a common need after PRs are merged and remote branches are
cleaned up, leaving stale local branches behind.
Features:
- Deletes all local branches with a gone remote in one command
- --dry-run / -n flag to preview branches before deletion
Closes#1220
* ability to specify command when hitting enter
* documentation
* man page
* generate man page and html
* run default command through same logic as other commands
impetuous: persist return val for display in promt if non-zero
also future-proofs for other benefits / DRYness. no need for another eval invocation.
* fix generated manpage
* repl config ideas
* documentation
* Update bin/git-repl
Co-authored-by: Edwin Kofler <edwin@kofler.dev>
* separator
* man page and web docs
* always use dir for project name
---------
Co-authored-by: Edwin Kofler <edwin@kofler.dev>
* Upgrade codespell to v2.4.0
It is a lastet verison, and is needed so that I can use the inline
ignore support in a future commit.
After updating tests/pyproject.toml I ran the following commands:
```
cd tests
poetry lock --no-update
poetry install
```
I also fixed a spelling error in man/git-summary.md, which was not
caught by the old version of codespell. After updating the file I also
updated the related files by running the following commands:
```
cd man
make -C .. man/git-summary.{1,html}
```
* add git-wip and git-unwip
Updated/re-built the documentation with:
```
cd man
make -C .. man/git-unwip.{1,html}
make -C .. man/git-wip.{1,html}
make -C .. man/git-extras.{1,html}
```
* Initial scaffold
* Finish first half of Bats tests
* Add Bats to CI
* Fix CI
* Fix CI
* Fix configuration to set git name and email
* Fix `GIT_CONFIG_{KEY,VALUE}` indexing
* Fix Git config override precedence
* Remove unused and untested function
* feat(git-bulk): add --no-follow-hidden flag
* docs(git-bulk): add --no-follow-hidden description
* docs(man): make ronn
* docs(git-bulk): put --no-follow-hidden at right place in usage()
* refactor(git-bulk): logic optimization
Remove unnecessary subshell
Co-authored-by: Edwin Kofler <edwin@kofler.dev>
* fix(git-bulk): bad test operator
With the Bash' regexp matching operator `=~`, we need to use the Bash
conditional expression evaluation command `[[ ]]`.
* docs(completion.zsh): add --no-follow-hidden and --no-follow-symlink
---------
Co-authored-by: Pierre Ayoub <pierre.ayoub@protonmail.com>
Co-authored-by: Edwin Kofler <edwin@kofler.dev>
* feat(git-summary): add --full-path option
* docs(git-summary): add doc for --full-path option
* docs(man): make using ronn
* docs(git-extras-completion.zsh): add --full-path option of git-summary
* feat(git-bulk): add --no-follow-symlinks flag
* docs(git-bulk): add --no-follow-symlinks description
* docs(man): make ronn
* docs(git-bulk): put --no-follow-symlinks at right place in usage()
* fix(git-bulk): use readarray for find command
1. Use `readarray` such that we can handle paths with spaces
2. Remove the unnecessary `eval`
* docs(git-bulk): Add zsh completion
* docs(git-bulk): Harmonize help strings
* docs(git-bulk): simplify previous bad logic
The previous logic was not allowing to use multiple options (which is
often the case). This was bad because this is my first time with zsh
automcompletion. Without it, the user can use any flag combination --
but at least, he has the freedom.
* fix(git-bulk): fix workspace selection when cd fails
`cd` may fails for multiple reasons:
- mistake when editing `.gitconfig` manually
- previously existing workspace that have been removed
- ...
Currently, if `cd` fails, the `BulkOp` continue its execution ... in the
workspace defined in a higher directory that where the user, despite the
user specified a specific workspace (`-w`).
The user should be noticed of a failed `cd` (this is really not expected
for a valid configuration) and the operations should stop to not execute
something unexpected.
* fix(git-bulk): replace weak eval for better variable substitution
Get rid of poor `eval` syntax because they are vulnerable to command
injection, which may have unexpected side effects.
However, they enabled a useful feature: using environment variable
(*e.g.*, defined in a `.bashrc`) inside the `.gitconfig` to use dynamic
paths as `bulk` workspaces.
As such, I keep this feature possible by using the Bash's ${!VAR}
syntax, which allows to get the value of one variable using the name of
a another variable. However, arbitrary command injection is not possible
anymore.
* fix(git-bulk): missing check about empty environnement variable
* style(git-bulk): typo
* docs(Commands.md): git-bulk env var feature
* docs(man/git-bulk): git-bulk env var feature
* docs(man/git-bulk): mention .gitconfig for config storage
* style(man/git-bulk): typo
* docs(man/git-bulk): run make/ronn for .1 and .html
Fix a logic error inside the `allowedargcount()` function. This function
may be called with one or two arguments. However, no default values are
assigned to `$1` and `$2` that are used inside a numerical comparison.
Therefore, when using a bad number of arguments for the following lines:
```
listall|purge) allowedargcount 1;;
addcurrent|removeworkspace) allowedargcount 2;;
```
Then, we would get the error `[: : integer expression expected`. To fix
this, we assign the 0 default value to `$1` and `$2`, such that we
trigger the error message destined to the user without any integer error
when there is a bad number of argument and that the function is called
with only 1 argument instead of 2.
For managing the python dependencies, running the unit tests and
spellchecker. This makes it easier for everyone to have same environment
as CI. Also includes few cosmetic edits for style for the ci.yml
* feat: add git-continue
Also refactor `git-abort` to parse action from the called file name.
There's a promise for this in #865 but that was a long time ago.
* fix: add git-continue
address review comments, fix the script, remove unnecessary testpath
import.
* feat: add ruff linter with ci check
Liniting the python files in tests directory would reduce whitespace etc
change and enforce basic coding standard for those. Kind of
opportunistic PR as there might be other opinions about how to deal with
this.
* fix: format with ruff
* fix(github-actions): changed files output for editorcondig-checker
Seems that ci.yml includes a dead dependency action just to get list of
changed files for the PR / push. This seems weird as the repo is all
about git. Propose removing this extra dep with straightforward
implemenation. Also: github runners do have `jq` preinstalled.
* feat(ci): print changed files to log in lint job
* feat: add ruff linter with ci check
Liniting the python files in tests directory would reduce whitespace etc
change and enforce basic coding standard for those. Kind of
opportunistic PR as there might be other opinions about how to deal with
this.
* fix: format with ruff