summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2024-02-28fixup! Fix showing the "YOU ARE HERE" marker for old-style non-interactive ↵fix-support-for-old-style-non-interactive-rebaseStefan Haller
rebases
2024-02-26Fix showing the "YOU ARE HERE" marker for old-style non-interactive rebasesStefan Haller
When stopping in an old-style non-interactive rebase (see previous commit for an explanation of what that means), the YOU ARE HERE marker should point to the first non-rebasing commit, but it was pointing at the first rebasing commit instead. To keep the tests working, we need to set all commits that have an Action to StatusRebasing, which matches what happens in the real code.
2024-02-26Fix showing old-style non-interactive rebase todoStefan Haller
When doing a non-interactive rebase using a version of git earlier than 2.26, or by explicitly calling `git -c rebase.backend=apply rebase`, lazygit can display the pending todos by parsing the numbered patch files in `.git/rebase-apply/`. Unfortunately, support for this has been broken for more than three years because of the change in 682db77401e (the string literal "normal" should have been changed to REBASE_MODE_NORMAL instead of REBASE_MODE_MERGING). It's not an important bug since you can only get into this situation by doing a rebase outside of lazygit, and then only with a pretty old git version. So instead of fixing the bug we might consider removing this code.
2024-02-21Add author filtering to commit view (#3302)Stefan Haller
- **PR Description** This PR introduces a new feature to the commit view, allowing users to filter commits based on the author's name or email address. Similar to the existing path filtering functionality, accessible through `<c-s>`, this feature allows users to filter the commit history by the currently selected commit's author if the commit view is focused, or by typing in the author's name or email address. This feature adds an entry to the filtering menu, to provide users with a familiar and intuitive experience ![filter-by-author](https://github.com/jesseduffield/lazygit/assets/3098462/5b00a716-e432-4204-8568-0e93b1411bc7) - **Please check if the PR fulfils these requirements** * [x] Cheatsheets are up-to-date (run `go generate ./...`) * [x] Code has been formatted (see [here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#code-formatting)) * [x] Tests have been added/updated (see [here](https://github.com/jesseduffield/lazygit/blob/master/pkg/integration/README.md) for the integration test guide) * [x] Text is internationalised (see [here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#internationalisation)) * [x] Docs (specifically `docs/Config.md`) have been updated if necessary * [x] You've read through your own file changes for silly mistakes etc
2024-02-21Add author filtering to commit viewTristan Déplantes
This commit introduces a new feature to the commit view, allowing users to filter commits based on the author's name or email address. Similar to the existing path filtering functionality, accessible through <c-s>, this feature allows users to filter the commit history by the currently selected commit's author if the commit view is focused, or by typing in the author's name or email address. This feature adds an entry to the filtering menu, to provide users with a familiar and intuitive experience
2024-02-21Change "git reset" default to --mixed (#3264)Stefan Haller
Calling "git reset" on the command line (without further arguments) defaults to --mixed, which is reason enough to make it the default for us, too. But I also find myself using --mixed more often than --soft. The main use case for me is that I made a bunch of WIP commits, and want to turn them into real commits when I'm done hacking. I select the last commit before the WIP commits and reset to it, leaving all changes of all those commits in the working directory. Since I want to start staging things from there, I prefer those modifications to be unstaged at that point, which is what --mixed does.
2024-02-21Add tooltips for reset menu itemsStefan Haller
2024-02-21Change "git reset" default to --mixedStefan Haller
Calling "git reset" on the command line (without further arguments) defaults to --mixed, which is reason enough to make it the default for us, too. But I also find myself using --mixed more often than --soft. The main use case for me is that I made a bunch of WIP commits, and want to turn them into real commits when I'm done hacking. I select the last commit before the WIP commits and reset to it, leaving all changes of all those commits in the working directory. Since I want to start staging things from there, I prefer those modifications to be unstaged at that point, which is what --mixed does.
2024-02-18Use $XDG_STATE_HOME for state.yml (#2936)Stefan Haller
- **PR Description** fixes #2856, #2794, #818
2024-02-18Update Config.mdStefan Haller
2024-02-18Change log path to state dirChing Pei Yang
2024-02-18Use $XDG_STATE_DIR for state.ymlChing Pei Yang
2024-02-18Switch to github.com/adrg/xdgChing Pei Yang
2024-02-18Fix some problems with patches if `git diff` was customized with config ↵Stefan Haller
(e.g. `external` or `noprefix`). (#3222) - **PR Description** I encountered the problem that I couldn't extract changes into a new commit because I had difftastic as an external git tool configured. Add `diff.noprefix=false` config Option and also specify `--no-ext-diff` when doing the `git diff` after applying a patch. This fixes #3107. Though, there might be other config options that can cause problems, but fixing these common cases should be an improvement nevertheless.
2024-02-18Add integration testStefan Haller
The test would fail without the fixes in the previous commits; even if only one of the configs is set.
2024-02-18Set diff.noprefix=false for all other diff commands tooStefan Haller
This fixes problems with being able to stage things in a custom patch correctly.
2024-02-18Fix problems with patches if `git diff` was customized with config.Matthias Richerzhagen
2024-02-16Keep sort order when filtering lists sorted by date (#3282)Stefan Haller
- **PR Description** Keep the sort order stable when filtering lists of things sorted by date (branches, stashes, reflog entries).
2024-02-16Don't omit section headers when filtering the keybindings menuStefan Haller
2024-02-16Optionally keep sort order stable when filtering listsStefan Haller
For some lists it is useful to keep the same sort order when filtering (rather than sorting by best match like we usually do). Add an optional function to FilteredList to make this possible, and use it whenever we show lists of things sorted by date (branches, stashes, reflog entries), as well as menu items because this allows us to keep the section headers in the keybindings menu, which is useful for understanding what you are looking at when filtering.
2024-02-16Bump required go version to 1.21Stefan Haller
We'll need this to use the slices.Sort function in the next commit. It would also be possible to use sort.Ints instead, but it's slower.
2024-02-16Fix initial scroll bar size again (#3285)Stefan Haller
After #3283 we need to read more lines initially so that the scrollbar goes to its minimal height of 1 for long diffs. Without this, it would start with a height of 2 and then become smaller after you scroll down half the window height. It does mean that we need to read twice the number of lines initially (up to the limit of 5000). I think it's worth it, I find the incorrect initial size confusing.
2024-02-16Fix number of lines to read from a task initially for the right scroll bar sizeStefan Haller
After #3283 we need to read more lines initially so that the scrollbar goes to its minimal height of 1 for long diffs. Without this, it would start with a height of 2 and then become smaller after you scroll down half the window height.
2024-02-16Fix order of custom commands history (#3286)Stefan Haller
- **PR Description** Fix order problems when saving custom commands history This fixes two problems: - each time the custom commands panel was opened, the history of commands would be shown in reversed order compared to last time. (The reason is that lo.Reverse modifies the slice in place rather than just returning a new, reversed slice.) - when executing a previous command again (either by typing it in again, or by picking it from the history), it should move to the beginning of the history, but didn't. We fix this by storing the history in reversed order (as the user sees it in the panel), this makes the logic simpler. We just have to prepend rather than append newly added commands now. While this is theoretically a breaking change, it's not worth bothering because the order was wrong for existing users in 50% of the cases anyway.
2024-02-16Fix order problems when saving custom commands historyStefan Haller
This fixes two problems: - each time the custom commands panel was opened, the history of commands would be shown in reversed order compared to last time. (The reason is that lo.Reverse modifies the slice in place rather than just returning a new, reversed slice.) - when executing a previous command again (either by typing it in again, or by picking it from the history), it should move to the beginning of the history, but didn't. We fix this by storing the history in reversed order (as the user sees it in the panel), this makes the logic simpler. We just have to prepend rather than append newly added commands now. While this is theoretically a breaking change, it's not worth bothering because the order was wrong for existing users in 50% of the cases anyway.
2024-02-16Simplify saving app stateStefan Haller
2024-02-16Migrate git.log.showGraph and git.log.order to app state (#3197)Stefan Haller
2024-02-16Redraw commits view when showGraph setting changesStefan Haller
2024-02-16Deprecate git.log.showGraph and git.log.order configAlex March
Added identical properties to AppState that should eventually have their defaults set.
2024-02-16Fix two problems related to update-ref rebase todo items (#3290)Stefan Haller
- **PR Description** This fixes two loosely related problems with `update-ref` todos: 1. Panic when hitting enter on an `update-ref` item 2. When selecting an `update-ref` item and then triggering a refresh, there was a bogus error message `fatal: ambiguous argument '': unknown revision or path not in the working tree.`
2024-02-16Avoid crash when hitting enter on an update-ref todoStefan Haller
2024-02-16Fix a problem with refreshing while an update-ref todo is selectedStefan Haller
Scenario: - show the files of a commit, escape out of it again - start an interactive rebase of a stack of branches, with the rebase.updateRefs git config set to true - select one of the update-ref todos - trigger a refresh (either manually or by bringing lazygit's terminal window to the front) This results in an error message "fatal: ambiguous argument '': unknown revision or path not in the working tree." Fix this by putting another band-aid on the check for the commit files refresh. This is the easiest way to fix the problem, but I don't think it's the best one. We shouldn't be refreshing the commit files context at all if it isn't visible, because it's pointless; there's no way to switch to it again except by calling viewFiles again with a specific ref. But I'm too lazy too figure out how to do that right now.
2024-02-16Support range select removing files from a commit (#3276)Jesse Duffield
- **PR Description** Support adding range select for removing multiple files from a commit. Closes #3260. The approaches I saw were to either modify `RebaseCommands.DiscardOldFileChanges` to accept multiple files or do the file removals as part of the custom patch workflow. I ended up going with the second way, but I'd be happy to re-implement with the first approach if that's preferred. I added a test that handles several different situations when removing commit files, and updated the original test for removing a single file from a commit. I changed how the user gets informed when removing files from a commit. The previous version had 2 prompts that I combined into 1 (because those two situations are now possible to see at the same time), and I added the total number of files that will be affected. This feature seems like it could cause some real damage if used improperly, so I'm trying to let the user know as much as possible. There are 2 or 3 i18n strings that I removed because they're no longer used. `RebaseCommands.DiscardOldFileChanges` isn't used anywhere any more, but I left it in there anyway. - **Please check if the PR fulfills these requirements** * [x] Cheatsheets are up-to-date (run `go generate ./...`) * [x] Code has been formatted (see [here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#code-formatting)) * [x] Tests have been added/updated (see [here](https://github.com/jesseduffield/lazygit/blob/master/pkg/integration/README.md) for the integration test guide) * [x] Text is internationalised (see [here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#internationalisation)) * [ ] Docs (specifically `docs/Config.md`) have been updated if necessary * [x] You've read through your own file changes for silly mistakes etc <!-- Be sure to name your PR with an imperative e.g. 'Add worktrees view' see https://github.com/jesseduffield/lazygit/releases/tag/v0.40.0 for examples -->
2024-02-13Fix range select bugAaron Hoffman
After discarding file changes from the commit, the was still referencing these indexes as being part of the range select. The consequence was needing to hit escape twice to exit commit files in some situations. Canceling the range select after discarding changes fixes that.
2024-02-13Clean up test caseAaron Hoffman
I'm combining the delete single file case from `discard_old_file_change` with the content of `discard_range_select` and calling that `discard_old_file_changes`. Hopefully that cleans things up a little bit. This also adds a check that the custom patch is getting reset properly.
2024-02-13CleanupAaron Hoffman
The waiting status shouldn't happen until after the user has responded to the popup. Since we're not giving a standalone prompt about clearing the patch, all of the business in `discard` doesn't need to be in a function any more
2024-02-13Support range select removing files from a commitAaron Hoffman
2024-02-13Change default of git.log.showGraph to 'always' (#3314)Stefan Haller
Change default of git.log.showGraph to 'always'; most people seem to prefer it to be on. Fixes #3312.
2024-02-13Change default of git.log.showGraph to 'always'Stefan Haller
Most people seem to prefer it to be on.
2024-02-12Disallow cherry-picking merge commits (#3316)Stefan Haller
Cherry-picking merge commits is currently not supported because of the way copy/pasting is currently implemented. Disable the command with a proper error message if the user tries to copy a merge commit, instead of running into the confusing error message that git would otherwise give, see #1374. While we're at it, disable it also when trying to copy an "update-ref" todo, which doesn't make sense.
2024-02-10Disallow cherry-picking merge commitsStefan Haller
2024-02-10Disallow cherry-picking update-ref todosStefan Haller
2024-02-10Cleanup: remove unused methodStefan Haller
2024-01-30Fix cherrypick demo (#3287)Stefan Haller
Cherrypick selections are now cleared after pasting (#3240), so the demo needs a tiny change to reflect that. - **PR Description** The cherry pick demo is failing after the changes in #3240. This is just a small update to that demo to reflect the new (and more convenient) behavior from #3240. - **Please check if the PR fulfills these requirements** * [x] Cheatsheets are up-to-date (run `go generate ./...`) * [x] Code has been formatted (see [here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#code-formatting)) * [x] Tests have been added/updated (see [here](https://github.com/jesseduffield/lazygit/blob/master/pkg/integration/README.md) for the integration test guide) * [ ] Text is internationalised (see [here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#internationalisation)) * [ ] Docs (specifically `docs/Config.md`) have been updated if necessary * [x] You've read through your own file changes for silly mistakes etc <!-- Be sure to name your PR with an imperative e.g. 'Add worktrees view' see https://github.com/jesseduffield/lazygit/releases/tag/v0.40.0 for examples -->
2024-01-30Fix cherrypick demoAaron Hoffman
Cherrypick selections are now cleared after pasting (#3240), so the demo needs a tiny change to reflect that.
2024-01-30Clear cherry-picked commits after pasting (#3240)Stefan Haller
It can be tedious after each cherry-pick opearation to clear the selection by pressing escape in order for lazygit to stop displaying info about copied commits. Also, it seems to be a rare case to cherry-pick commits to more than one destination. The simplest solution to address this issue is to clear the selection upon paste, including merge conflict scenario. Previously discussed in #3198.
2024-01-30Clear cherry-picked commits after pastingmolejnik88
It can be tedious after each cherry-pick opearation to clear the selection by pressing escape in order for lazygit to stop displaying info about copied commits. Also, it seems to be a rare case to cherry-pick commits to more than one destination. The simplest solution to address this issue is to clear the selection upon paste. The only exception is a merge conflict. Initially, I wanted to clear selected commits in this scenario too. During a discussion we found out that it may be convenient to have the copied commits still around. Aborting the rebase and pasting the commits in the middle of a branch can be a valid use case.
2024-01-30Use slimmer scrollbars (#3283)Jesse Duffield
(hopefully) fixes https://github.com/jesseduffield/lazygit/issues/1924 The previous scrollbars were too chunky and encroached too much on a view's content. The new ones are slim and right-aligned so they encroach into dead space between views which is much better. Before: ![image](https://github.com/jesseduffield/lazygit/assets/8456633/fe125804-0cb8-4f9b-be4c-5710fd73ac14) After: ![image](https://github.com/jesseduffield/lazygit/assets/8456633/8ae18f96-e2fd-46ff-be9a-09e745da1177) Admittedly, the original scrollbars look more like typical scrollbars and do a better job at telling you where the start and end of the scrollbar is. We experimented with having special characters for scrollbar bounds in the slim version but it all looked pretty ugly, and there's just not many ascii characters to choose from. Based on gocui PR: https://github.com/jesseduffield/gocui/pull/45 The important changes are in vendor/github.com/jesseduffield/gocui/gui.go vendor/github.com/jesseduffield/gocui/scrollbar.go The other changes are just modules being updated. - **PR Description** - **Please check if the PR fulfills these requirements** * [x] Cheatsheets are up-to-date (run `go generate ./...`) * [x] Code has been formatted (see [here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#code-formatting)) * [x] Tests have been added/updated (see [here](https://github.com/jesseduffield/lazygit/blob/master/pkg/integration/README.md) for the integration test guide) * [x] Text is internationalised (see [here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#internationalisation)) * [x] Docs (specifically `docs/Config.md`) have been updated if necessary * [x] You've read through your own file changes for silly mistakes etc <!-- Be sure to name your PR with an imperative e.g. 'Add worktrees view' see https://github.com/jesseduffield/lazygit/releases/tag/v0.40.0 for examples -->
2024-01-30Use slimmer scrollbarsJesse Duffield
The previous scrollbars were too chunky and encroached too much on a view's content. The new ones are slim and right-aligned so they encroach into dead space between views which is much better
2024-01-29Add command to squash all fixups in the current branch (#3274)Stefan Haller
Add command to squash all fixups in the current branch. To do that, change the "Apply fixup commits" command to show a menu with the two choices "in current branch" and "above the selected commit"; we make "in current branch" the default, as it's the more useful one most of the time, even though it is a breaking change for those who are used to "shift-S enter" meaning "squash above selected". Fixes #3263.