Commit graph

578 commits

Author SHA1 Message Date
dependabot[bot] e242562612
Meta: Bump actions/upload-artifact from 5 to 6 (#483)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 5 to 6.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-18 15:30:11 +01:00
Jose M. Valera Reales 76506fc3da
Feature: add empty state messages for checkout commands (#478)
Show informative messages when there is nothing to checkout:
  - checkout_file: "Nothing to checkout." when no modified files
  - checkout_tag: "Nothing to checkout: there are no tags."
2025-12-10 20:23:14 +01:00
Iván Sotillo del Horno 3cd63a1bbe
Feature: add interactive git switch selector (#472) 2025-12-10 20:19:26 +01:00
sandr01d 779b59690f
Feature: allow configuring arguments of git ls-files in forgit clean (#481) 2025-12-08 20:24:11 +01:00
sandr01d 9167c65714
Meta: update bashunit helper functions due to breaking change (#480) 2025-12-08 20:12:34 +01:00
sandr01d b9ed7bc40e
Fix: preview for clean when file names contain backslashes (#465)
This is a breaking change: flag arguments provided to forgit clean are
now passed to git ls-files instead of git clean -n. This change is
necessary because git clean does not have a -z option that would prevent
it from escaping file names containing backslashes. However, git ls-files
is way more flexible than git clean, so all use cases covered by git
clean (and more) should still be possible.
2025-12-05 22:58:46 +01:00
dependabot[bot] 582a64ea36 Chore(deps): Bump actions/checkout from 5 to 6
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-27 18:28:32 +08:00
dependabot[bot] eae60c1373
Meta: Bump actions/upload-artifact from 4 to 5 (#469)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-01 19:29:28 +01:00
dependabot[bot] 7953f1c883
Meta: Bump actions/download-artifact from 5 to 6 (#470)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 5 to 6.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-01 19:28:34 +01:00
carlfriedrich 2a4e2e53b7 Refactor: extract function to remove status from diff line (#464) 2025-09-08 06:47:52 +02:00
carlfriedrich 61d3192055 Meta: Add unit test for _forgit_get_files_from_diff_line function (#464)
Update CI to install latest bashunit beta version instead of fixed
0.23.0 version because we need the new "data_set" function for
parameterized tests.
2025-09-08 06:47:52 +02:00
carlfriedrich ab6a63ee0f 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.
2025-09-08 06:47:52 +02:00
carlfriedrich 9b3b185e24 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.
2025-09-08 06:47:52 +02:00
carlfriedrich 94e52ed942 Meta: Add bashunit tests to CI workflow and implement a first test case (#464) 2025-09-08 06:47:52 +02:00
dependabot[bot] 5d4d6121b1
Meta: Bump actions/checkout from 4 to 5 (#463)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-21 21:05:51 +02:00
dependabot[bot] 23ccf9a246
Chore(deps): Bump actions/download-artifact from 4 to 5 (#462)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-11 18:52:17 +02:00
sandr01d f7796d5ce2
Fix: use github/gitignore for ignore files (#461)
The repo we originally used has gone away
2025-07-30 19:19:33 +02:00
sandroid 9a4ff16829 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'.
2025-07-23 09:39:37 +02:00
sandr01d 8285d2e1b0
Fix: early out with non-file arguments in checkout file (#456) 2025-07-16 20:37:06 +02:00
sandroid 7c3aff1142 Feat: use git log completions for fixup commands 2025-07-16 20:36:10 +02:00
sandroid c9d047bf16 Fix: bash completions for reword 2025-07-16 20:36:10 +02:00
sandr01d fd373ba6c2
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.
2025-07-15 21:00:04 +02:00
carlfriedrich c0df9a56d0 Refactor: Remove unnecessary xargs in git show commands 2025-07-15 06:36:45 +02:00
carlfriedrich cfc954ebc0 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.
2025-07-15 06:36:45 +02:00
sandr01d b71e54c4aa
Feate: allow passing arguments to git checkout file (#451) 2025-07-13 15:41:48 +02:00
sandr01d fe350db899
Feat: allow passing arguments to git add (#452) 2025-07-13 15:41:14 +02:00
sandr01d 7a5e68b11b
Fix: allow filtering by files in fixup, squash and reword (#448)
This reverts commit 3f694f6e99 and adds the same filtering option to reword.
2025-06-21 00:36:27 +02:00
sandroid d08c9e5477 Docs: improve completion docs and move them to the top 2025-06-04 16:58:31 +08:00
sandroid d477ffaee4 Refactor: do not disable shellcheck 2230
It is optional with ubuntu 24.04 and disabled by default.
2025-06-03 09:37:29 +08:00
sandr01d 455e42ba64
Feature: add interactive reword selector (#443) 2025-05-29 20:51:12 +02:00
sandr01d 3f694f6e99
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.
2025-05-28 19:37:36 +02:00
sandr01d c2b012855f
Feature: add interactive squash selector (#440) 2025-05-25 18:21:56 +02:00
sandr01d 38d74ba3ed
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
2025-05-18 16:23:51 +02:00
sandr01d 47fd184c7c
Fix: use FORGIT_SHOW_FZF_OPTS in _forgit_show (#437) 2025-05-05 18:16:52 +02:00
sandr01d cf9e15edab
Fix: add fish completions for forgit diff and forgit show (#434) 2025-04-23 18:39:35 +02:00
sandr01d 79c4e5a4c4
Fix: create branch when checking non origin remote (#430) 2025-04-22 18:08:37 +02:00
sandr01d 8c0355ca9e
Meta: use latest ubuntu image for ci (#433) 2025-04-22 18:06:55 +02:00
Swastik Acharyya 72b8d6feb2
fix: Use "ga" alias for "forgit attributes" in fish shell (#432) 2025-04-21 14:16:58 +02:00
carlfriedrich aec8b1f2b5
Meta: Do not tag release without public changes (#427)
This is mostly a refactoring of our GitHub actions. The tag workflow and
script have been removed completely, since the release action will
implicitly create the release tag if it does not exit, yet. This makes
sure that we do not create a tag when there will be no release.

We have only one workflow now, which contains two jobs: one for
generating the changelog and one for creating the release.

The changelog job will generate the changelog and upload it as an
artifact if there are public changes. The release version, which
previously was determined in the tag script, is now determined within
this job, so that we can pass it to the release job.

The release job will run only if the changelog job was successful, i.e.
if there are public changes. It will create a tag and a GitHub release
with the given version number.

The workflow will run on the first day of every month for our regular
automatic monthly releases.
It will also run on every tag push, so that we still can create a
release manually if necessary. The release action will implicitly use
the existing tag for the release then.

Fixes #413
Closes #414
2025-03-14 07:01:12 +01:00
carlfriedrich 18f1a1e0c3
Meta: Improve the documentation for overriding aliases (#426)
Some checks failed
ci / build (ubuntu-22.04) (push) Failing after 1s
ci / build (macos-latest) (push) Has been cancelled
ci / build (ubuntu-20.04) (push) Has been cancelled
2025-02-24 14:09:06 +01:00
crazy-matt 4dc0f5474a
Update README.md (#425)
Some checks failed
ci / build (ubuntu-22.04) (push) Failing after 1s
ci / build (macos-latest) (push) Has been cancelled
ci / build (ubuntu-20.04) (push) Has been cancelled
Adding sheldon.cli configuration for zsh as an example.
2025-02-23 13:09:51 +01:00
carlfriedrich 09f17c9032
Allow passing arguments to git rebase (#422)
Some checks failed
ci / build (ubuntu-22.04) (push) Failing after 1s
ci / build (macos-latest) (push) Has been cancelled
ci / build (ubuntu-20.04) (push) Has been cancelled
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.
2025-02-15 14:57:57 +01:00
sandroid 0d65efc769 Feature: Add interactive git attributes generator
Some checks failed
ci / build (macos-latest) (push) Waiting to run
ci / build (ubuntu-20.04) (push) Waiting to run
ci / build (ubuntu-22.04) (push) Failing after 1s
2025-02-14 20:29:33 +01:00
sandroid 408fe6033a Refactor: Make functions interacting with repositories reusable 2025-02-14 20:29:33 +01:00
sandr01d e07b353b94
Refactor: Remove _forgit_ignore_clean (#421)
Some checks failed
ci / build (ubuntu-22.04) (push) Failing after 1s
ci / build (macos-latest) (push) Has been cancelled
ci / build (ubuntu-20.04) (push) Has been cancelled
2025-02-10 19:36:13 +01:00
carlfriedrich bb83b3cba0
Feature: add forgit show command (#417)
Some checks failed
ci / build (ubuntu-22.04) (push) Failing after 1s
ci / build (macos-latest) (push) Has been cancelled
ci / build (ubuntu-20.04) (push) Has been cancelled
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 #416.
2025-01-29 07:04:07 +01:00
sandr01d fdae9cb235
Meta: add tree as an optional dependency (#420)
Some checks failed
ci / build (macos-latest) (push) Has been cancelled
ci / build (ubuntu-20.04) (push) Has been cancelled
ci / build (ubuntu-22.04) (push) Failing after 1s
2025-01-22 20:28:56 +01:00
Wenxuan df5191157f
fix: fix edit file key binding (alt-e) in diff and add (#415)
Some checks failed
ci / build (ubuntu-22.04) (push) Failing after 1s
ci / build (macos-latest) (push) Has been cancelled
ci / build (ubuntu-20.04) (push) Has been cancelled
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.
2024-12-22 09:18:39 +08:00
Wenxuan Zhang 755b3dd9f8
chore: rename default branch (#410) 2024-12-16 22:35:07 +08:00
Sufien Tout 7a40a11e79
Meta: add an .editorconfig and apply it to the codebase (#404)
Some checks failed
ci / build (ubuntu-22.04) (push) Failing after 0s
ci / build (macos-latest) (push) Has been cancelled
ci / build (ubuntu-20.04) (push) Has been cancelled
2024-11-06 10:10:27 +01:00