Repository navigation
Releases: nathanchance/forgit
Release list
26.05.0
🚀 Features
- Add interactive git worktree operations
- Add missing entries for completion scripts
- Add interactive worktree add command (gwa)
- Add interactive checkout file from commit selector
🐛 Bug Fixes
- (docs) Fix typos and broken markdown in README
- Use array length instead of string length in reset_head
- Review comments
- Use git-switch native completion for switch_branch
- Use non-interactive pager in fzf preview for TUI pagers (wfxr#498)
- Handle backslashes in filenames in _forgit_worktree_changes
🚜 Refactor
- Extract branch helpers and ANSI strip utility
- Extract _forgit_print_dim helper and improve worktree ops
- Remove command specific previews from PRIVATE_COMMANDS (wfxr#501)
- Extract _forgit_git_log from _forgit_log
- Extract _forgit_git_show from _forgit_show
- Extract _forgit_worktree_changes from _forgit_add
📚 Documentation
- Add missing attributes command to README
- Improve options documentation in README
- Update sheldon version in README
- Restructure README for improved navigation
- Move pager config out of per-command table into own section
- Add docs for 'show commit message' keybinding (wfxr#492)
- Add agent repository guidelines
- Update README headers for cleaner rendering
- Add contribution guide
- Add star history chart
🎨 Styling
- (docs) Capitalize section headings in README
26.03.0
🐛 Bug Fixes
- Forgit add shows dir view for submodules (wfxr#484)
💼 Other
- Bump actions/download-artifact from 5 to 6 (wfxr#470)
- Bump actions/upload-artifact from 4 to 5 (wfxr#469)
- (deps) Bump actions/checkout from 5 to 6
- Preview for clean when file names contain backslashes (wfxr#465)
- Update bashunit helper functions due to breaking change (wfxr#480)
- Allow configuring arguments of git ls-files in forgit clean (wfxr#481)
- Add interactive git switch selector (wfxr#472)
- Add empty state messages for checkout commands (wfxr#478)
- Bump actions/upload-artifact from 5 to 6 (wfxr#483)
- Bump actions/download-artifact from 6 to 7 (wfxr#482)
26.02.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 (wfxr#434)](cf9e15e...
26.01.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 (wfxr#434)](cf9e15e...
25.12.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 (wfxr#434)](cf9e15e...
25.11.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 (wfxr#434)](cf9e15e...
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 (wfxr#434)](cf9e15e...