* feat(mr): support Forgejo/Codeberg pull request URLs
Codeberg and other Forgejo instances expose pull requests under
refs/pull/<id>/head instead of GitLab's refs/merge-requests/<id>/head,
so passing a Codeberg pull request URL to git mr fetched the wrong
ref. Recognize the /pulls/<id> URL shape and switch to the matching
ref for that case, leaving the GitLab URL and bare numeric id
behavior unchanged.
Closes#1213
* test(git-mr): cover Forgejo/Codeberg URLs, regenerate man docs
Add a bats test that exercises the pulls URL branch via a local
insteadOf remote rewrite (no real HTTP endpoint needed), and bring
git-mr.1/git-mr.html in line with the git-mr.md changes.
---------
Co-authored-by: vjymisal0 <vijay.looprai@gmail.com>
* feat(scp): add -v/--verbose and -i/--interactive flags
git scp/git rscp printed a diff via plain `git diff`/`git diff --stat`
with no `--no-pager` and no TTY check, blocking on the user's pager.
Add -v/--verbose to print the diff via --no-pager before syncing, and
-i/--interactive to also prompt for confirmation before the real
push/copy. Both apply to git scp and git rscp, and must precede
<remote>.
Updates man/git-scp.md and Commands.md.
* feat(scp): add -n/--dry-run flag
Add -n/--dry-run to preview a sync without changing anything: rsync
runs with -n, and git add --force / ssh ... rm are skipped outright.
Implies --verbose, since confirming or previewing with nothing shown
is useless.
Also restructures scp_and_stage's push/delete blocks from `&&`-chains
into if/then, needed to branch on dry-run, which incidentally fixes a
latent bug where a non-TTY COLOR_RESET could silently skip the real
rsync/git add/ssh rm calls.
Updates man/git-scp.md and Commands.md.
* test(scp): add coverage for -n/--dry-run and -i/--interactive abort
git-scp had no test coverage at all. Cover the two paths that need no
real remote destination: dry-run must preview without touching the
index, working tree, or remote path, and declining the interactive
confirmation must abort before anything syncs.
* feat(scp): Code review
* feat(scp): Code review
* Added edit/remove functionality to git-ignore.
* Minor change to array-string assignment.
* Fixes array handling for remove.
* Suggested fixes (iteration over arguments, pattern removal, editor handling, tmp file location, symlinked gitignore handling).
* Changed pure bash editing of files to an awk script. Some other minor cosmetic changes.
* Updated docs.
* Modified autocomplete to work with new git-ignore
* Added help message to git-ignore.
* Added help flags to git-ignore's man.
* Made $file in eval safe. Should not do the same for editor since then all of the GIT_EDITOR will be treated as command (flags included).
* Typo fixes.
* feat: add git-delete-gone-branches command
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
* Address PR review feedback on git-delete-gone-branches
- 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
* Use GitHub profile for author contact in man page
* Fix gone-branch detection with nobracket format
* 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}
```
* 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`
* 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
* 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.
* check the file times in check_integrity
* make no-arguments to check_integrity check all commands, and also make check_integrity run git-utimes first
this has the downside that the script now takes a little longer. But the upside that it guarantees more correctness.
* update git-extras
using the incredible power of the new script, I have detected this was out of date, out of sync, etc
* Update git-alias.md: add brs to prevent incorrect line behavior
currently these all appear on one line, in the rendered markdown viewer and also in the man page. That isn't what's wanted. What's wanted is for each to be on its own line, which this change implements, using the strategy I found in git-bulk.
* run make on git-alias
* feat: Add pathspec support in git-missing
Allow to specify a path to limit the commit difference list. This
improvement allows users to focus on changes in specific directories or
files when comparing branches for missing commits.
* refactor: Improve pathspec handling in git-missing
- Change pathspec from string to array to support multiple pathspecs
- Remove unnecessary 'shift' command in argument processing loop
- Simplify git log command execution by using a single codepath
* chore: Update git-missing docs
* chore: Fix a typo in git-missing docs
* feat: add reverse option to git-brv
When there are a large amount of branches it is often useful to see the
most recent branches last as they end up closer to the prompt. This adds
a new --reverse / -r option and an environment variable to set the
default behavior (GIT_BRV_REVERSE).
* git-brv: change to git option instead of environment variable and fix typo
* wrap git option in backticks for git-brv and fix git-feature title
* update git-feature docs
* fix missing breaks in git-feature.md
* git-feature: add configurable branch separator
Closes#1069
This allows the use of a separator other than `/` for feature or other
alias branches. While a command-line option has been provided (`-s` or
`--separator`), this will most often be used via
`git-extras.feature.separator`.
* Significant update to bin/git-feature
- Changed option parsing so that `--alias` requires an argument and will
fail with an error unless provided. Applied the same logic to
`--separator`.
- Changed `finish` parsing to capture it as a variable flag during
argument parsing.
This could be extended so that if `finish` is already true, a second
`finish` results in the word being added to the argument list.
```console
$ git feature -- finish remote
$ git feature finish finish remote
```
This has not been done because it is a bit of an inconsistent handling
for documentation purposes.
- Add handling of `--` to permit options or `finish` to be made part of
the feature branch name.
- Since `finish` is now a variable flag, simplify the name-building
logic to always use `concatargs "${argv[@]}"`. This means that
`git feature finish ...` and `git feature ...` behave the same in
terms of feature branch name building.
- Basically rewrote the man page to include better descriptions of the
options as well as adding a GIT CONFIG section and additional EXAMPLES
for the new features/behaviour.