Repository navigation
25.10.0
Changes since 24.04.0:
- Fix _forgit_diff on macOS (#375)
In bash 3.2 uninitialized arrays contain one entry: an empty string,
whereas in modern versions of bash they do not contain any entry. Make
sure the $commits and $files arrays are explicitly initialized as empty
arrays to allow git to fall back to diffing local changes instead of
trying to diff against a revision with a name of an empty string. - Fix bug where homebrew replacement wouldn't work (#379)
- Refactor: Quote variables in preview of _forgit_diff, _forgit_reset_head & _forgit_cherry_pick_form_branch (#372)
- Fix branch preview for branches that have the same name as a file (#374)
The preview for branches (when using gbd or gcb) did not work for branches that have the same name as a file in the repository. This commit fixes this behavior by separating files and revisions with '--' as git suggests, while leaving the files blank to keep matching all files. - Fix preview for deleted files in _forgit_stash_push (#336)
- Refactor: Do not ignore shellcheck 2207 (#378)
We sometimes capture multiline output in an array. We used to do so
directly, while setting IFS to "\n" to control splitting. This has the
downside that bashs glob expansion will be invoked.
Use read -r in such cases to add each line into the array without glob
expansion. - Fix: Pager variables are not evaluated (#381)
Reintroduces the usage of eval for evaluating pagers. We removed all usage of eval with wfxr#326, which broke code defined by users in the $FORGIT_*_PAGER environment variables and git pagers. In this particular case, eval does exactly what we want, since we do want to execute code that is defined by the user outside of forgit. - Fix ga, gsp & gcf with older git versions (#335)
Removes the usage of --pathspec-file-nul (which is not available in older git versions) in favor of storing the file names passed to the git command in an array instead of a string. - Do not disable shellcheck 2206 and 2068 in _forgit_ignore (#382)
Shellcheck 2206 and 2068 have been disabled in _forgit_ignore for a very long time. The code that triggers the shellchecks was added in ce240ac before the shellcheck action had been added. The shellcheck for the lines in question got disabled in c14ce93. Disabling shellcheck does not seem necessary, instead this commit implements the fixes shellcheck suggest. - Move fzf options into $opts variables (#384)
_forgit_stash_push, _forgit_revert_commit and _forgit_blame passed some
fzf options as arguments directly instead of defining them in the $opts
variable, as we do everywhere else. This change makes these functions
consistent with the rest of the code base and additionally allows
overriding said options with the respective $FORGIT_*_FZF_OPTS
environment variables. - Add a preview to _forgit_clean (#383)
- Fix: Early out from _forgit_stash_push when no files can be stashed (#376)
Previously when using _forgit_stash_push without any local changes an empty file picker would open. Exit early and show a message instead. - Fix typos in README.md (#390)
* Fix some typos and wordings
* Fix headers style: no double spaces
* Fix "e.g." usage (Latin) - Fix: --date option in gbl can not be overridden anymore (#385)
The order of the arguments passed to git blame in _forgit_blame_preview
has been changed in bfffda6, putting --date=short as the last argument
instead of the first. This caused it taking precedence of anything
defined in $FORGIT_BLAME_GIT_OPTS.
This commit restores the order of the arguments to what they were before
bfffda6. - Allow disabling --graph with FORGIT_LOG_GRAPH_ENABLE=false in grc (#387)
- Fix: gsp does not work outside the root directory (#386)
- Fix: Opening files from diff line when not in project root (#393)
When trying to open a file from gd in $EDITOR (alt + e) the wrong file
was being opened when the command wasn't executed from the repository's
root directory. - Fix special characters in file names (#388)
Git escapes special characters in it's output when core.quotePath is
true or unset. Git always expects unquoted file paths as input. This
leads to issues when we consume output from git and use it to build
input for other git commands. This commit ensures we always feed unqoted
paths to git commands.
The _forgit_list_files function is introduced to handle usage of git
ls-files with the -z flag, which ensures unquoted paths.
It replaces the direct calls to git ls-files in _forgit_reset_head,
_forgit_stash_push and _forgit_checkout_file.
In _git_reset_head the -z option is added to the git diff command to
ensure unqoted paths.
Since git clean does not support the -z flag, we disable core.quotePath
by passing a configuration parameter in _forgit_clean. The same is done for
_forgit_add. - refactor: remove -u option from git status in forgit add (#397)
- Feature: Add interactive git reflog (#398)
- chore: rename default branch (#410)
- fix: fix edit file key binding (alt-e) in diff and add (#415)
The key binding for editing a file in diff and add was not working
properly on recent versions of fzf. As its documentation suggests, we
should replace `execute-silent` with `execute` since we need to switch
to a new screen and handle both input and output.fzf switches to the alternate screen when executing a command.
However, if the command is expected to complete quickly, and you are
not interested in its output, you might want to use execute-silent
instead, which silently executes the command without the switching. - Feature: add forgit show command (#417)
Introducing `show` as a new subcommand of `forgit`, an interactive
version of `git show`. The configured default alias is `gso`.
Alt-T can be used to toggle between showing the diff and the commit
message in the fzf preview window.
The new command in used instead of `forgit diff` when pressing enter
in `forgit log`. This fixes the display of diffs for merge commits.
**Note**: we have a requirement for the `fzf` version now. The minimum
required `fzf` version is 0.49.0. If the installed version is lower,
forgit will exit with an error message.
Fixes wfxr#416. - Refactor: Remove _forgit_ignore_clean (#421)
- Refactor: Make functions interacting with repositories reusable
- Feature: Add interactive git attributes generator
- Allow passing arguments to git rebase (#422)
If non-option arguments are passed to `git forgit rebase`, pass them
through directly to `git rebase`, without launching the interactive
selector, just like we do for other forgit commands.
Along with this, remove possibility to pass files to rebase, as there is
no need for that. I assume this was a copy-paste error when the
rebase function was introduced in the first place. - Update README.md (#425)
Adding sheldon.cli configuration for zsh as an example. - fix: Use "ga" alias for "forgit attributes" in fish shell (#432)
- Fix: create branch when checking non origin remote (#430)
- Fix: add fish completions for forgit diff and forgit show (#434)
- Fix: use FORGIT_SHOW_FZF_OPTS in _forgit_show (#437)
- Fix: prefix all commands in forgit.plugin.zsh (#439)
* Fix: prefix all commands in forgit.plugin.zsh
This prevents the wrong commands getting executed in case a user added a
shell alias with the same name.
* Fix: prefix built-ins - Feature: add interactive squash selector (#440)
- Refactor: Do not pass files to fixup and squash (#442)
Similar to 09f17c9, this removes the option to pass files to the fixup
and squash functions. There is no need to do so. - Feature: add interactive reword selector (#443)
- Refactor: do not disable shellcheck 2230
It is optional with ubuntu 24.04 and disabled by default. - Docs: improve completion docs and move them to the top
- Fix: allow filtering by files in fixup, squash and reword (#448)
This reverts commit 3f694f6 and adds the same filtering option to reword. - Feat: allow passing arguments to git add (#452)
- Feate: allow passing arguments to git checkout file (#451)
- Feat: Use forgit show in stash_show enter (#450)
Instead of using `git stash show` in the `enter` binding of the
`stash_show` command, use `forgit show`. This allows forgit to show the
stash in the same interactive way it shows other commits (e.g. on
`forgit log`), with the same context and formatting options. - Refactor: Remove unnecessary xargs in git show commands
- Fix: remove explicit -u flag in git status command in _forgit_add (#455)
git status includes untracked files by default, so passing the flag
explicitly is not necessary. This allows overriding forgits behavior
by setting showUntrackedFiles = no in the .gitconfig. - Fix: bash completions for reword
- Feat: use git log completions for fixup commands
- Fix: early out with non-file arguments in checkout file (#456)
- Fix: files in untracked directories are not shown in git add
Pass the value of git config status.showUntrackedFiles to the git status
command we run in _forgit_add, defaulting to 'all' when unset.
Additionally correctly handle directories in _forgit_add_preview for the
case when status.showUntracked is explicitly set to 'normal'. - Fix: use github/gitignore for ignore files (#461)
The repo we originally used has gone away - Chore(deps): Bump actions/download-artifact from 4 to 5 (#462)
Bumps actions/download-artifact from 4 to 5.
updated-dependencies:- dependency-name: actions/download-artifact
dependency-version: '5'
dependency-type: direct:production
update-type: version-update:semver-major
...
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- dependency-name: actions/download-artifact
- Refactor: Move global code into a main function (#464)
This is a prequisite for being able to source the script in order to
implement unit tests for individual functions. - Chore: Do not execute any code when forgit is sourced (#464)
In order to run unit tests for individual functions we have to be able
to source the script without triggering the main execution flow. - Refactor: extract function to remove status from diff line (#464)