summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2024-06-23Show radio buttons in the sort order menu for branchesStefan Haller
2024-06-23Support showing checkboxes or radio buttons in menusStefan Haller
For checkboxes it probably doesn't really make sense to use them yet, because we'd have to find a way how you can toggle them without closing the dialog; but we already provide rendering for them to lay the ground. But radio buttons can be used already, because for those it is ok to close the dialog when choosing a different option (as long as there is only one grounp of radio buttons in the panel, that is).
2024-06-23Always show the "Discard unchanged changes" menu item (#3683)Stefan Haller
Always show the "Discard unchanged changes" menu item in the Discard menu, just strike it through if not applicable. This will hopefully help with confusion about the meaning of "all" in the "Discard all changes" entry; some people misunderstand this to mean all changes in the working copy. Seeing the "Discard unstaged changes" item next to it hopefully makes it clearer that "all" is meant in contrast to that.
2024-06-23Always show the "Discard unchanged changes" menu itemStefan Haller
Strike it through if not applicable. This will hopefully help with confusion about the meaning of "all" in the "Discard all changes" entry; some people misunderstand this to mean all changes in the working copy. Seeing the "Discard unstaged changes" item next to it hopefully makes it clearer that "all" is meant in contrast to that.
2024-06-23Fix custom patch operations for added files (#3684)Stefan Haller
- **PR Description** Several custom patch commands on parts of an added file would fail with the confusing error message "error: new file XXX depends on old contents". These were dropping the custom patch from the original commit, moving the patch to a new commit, moving it to a later commit, or moving it to the index. We fix this by converting the patch header from an added file to a diff against an empty file. We do this not just for the purpose of applying the patch, but also for rendering it and copying it to the clip board. I'm not sure it matters much in these cases, but it does feel more correct for a filtered patch to be presented this way. Fixes #3679. - **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 have been updated if necessary * [x] You've read through your own file changes for silly mistakes etc
2024-06-23Fix custom patch operations on added filesStefan Haller
Several custom patch commands on parts of an added file would fail with the confusing error message "error: new file XXX depends on old contents". These were dropping the custom patch from the original commit, moving the patch to a new commit, moving it to a later commit, or moving it to the index. We fix this by converting the patch header from an added file to a diff against an empty file. We do this not just for the purpose of applying the patch, but also for rendering it and copying it to the clip board. I'm not sure it matters much in these cases, but it does feel more correct for a filtered patch to be presented this way.
2024-06-23Introduce options struct for RenderPatchForFileStefan Haller
We're going to add another argument in the next commit, and that's getting a bit much, especially when most of the arguments are bool and you only see true and false at the call sites without knowing what they mean.
2024-06-23Add test for moving a patch from an added file to an earlier commitStefan Haller
This currently works (albeit with a bit of manual work, as the user needs to resolve conflicts), and we add this test just to make sure that we don't break it with the following change.
2024-06-23Add test for moving a patch from a deleted file to a new commitStefan Haller
This currently works, we add it as a regression test to make sure we don't break it. It is an interesting test because it turns the deletion of the file in the moved-from commit into a modification.
2024-06-23Remove unneccesary test actionsStefan Haller
Pressing enter in the patch building view does nothing.
2024-06-23Fix PTY layout problems (#3658)Stefan Haller
- **PR Description** This fixes two layout problems with pagers that draw a horizontal line across the entire width of the view (e.g. delta): - sometimes the width of that line was one character too long or too short in the staged changes view - when changing from a file or directory that has only staged or only unstaged changes to one that has both, the length of the horizontal line was totally off and only redraw correctly at the next refresh
2024-06-23Run PTY tasks after layout so that they get the correct view sizeStefan Haller
This is important when using a pager that draws a horizontal line across the entire width of the view; when changing from a file or directory that has only unstaged (or only staged) changes to one that has both, the main view is split in half, but the PTY task would be run on the view in its old state, so the horizonal line would be too long and wrap around.
2024-06-23Fix possible off-by-one error wrt PTY sizeStefan Haller
All PTYs were created with the size of the main view, on the assumption that main and secondary always have the same size. That's not true though; in horizontal split mode, the width of the two views can differ by one because of rounding, and when using a pager that draws a horizontal line across the width of the view, this is visible and looks very ugly.
2024-06-23Add prompt to the remote branch checkout menu (#3652)Stefan Haller
- **PR Description** As a followup to [this discussion](https://github.com/jesseduffield/lazygit/pull/3388#issuecomment-2002308045), this PR adds a way to add a prompt text to menus. It is shown above the menu items, separated by a blank line. We use it to add a prompt to the remote branch checkout menu.
2024-06-23Add prompt to the remote branch checkout menuStefan Haller
2024-06-23Add menu promptStefan Haller
This makes it possible to add a prompt to a menu. It will be shown above the menu items, separated from them by a blank line.
2024-06-23Extract function wrapMessageToWidthStefan Haller
This steals even more code from `gocui.lineWrap`. We'll make use of this in the next commit.
2024-06-23Fix duplicate keybinding suggestions in status bar after switching repos (#3660)Stefan Haller
- **PR Description** When switching to a repo that was open before, all keybinding suggestions in the status bar would show twice. Fixes #3612. - **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 have been updated if necessary * [x] You've read through your own file changes for silly mistakes etc
2024-06-23Clear keybinding functions in resetHelpersAndControllersStefan Haller
When switching to a repo that was open before, the context tree is reused, so before adding keybinding functions to those contexts again, we need to clear the old ones.
2024-06-23Add a test demonstrating the bugStefan Haller
After switching to another repo and then back to the original one, all keybinding suggestions in the status bar are shown twice.
2024-06-23Fix truncation of branch names containing non-ASCII characters (#3685)Stefan Haller
Fix truncating long branch names containing non-ASCII characters.
2024-06-23Fix truncation of long branch names containing non-ASCII charactersStefan Haller
2024-06-23Add test demonstrating wrong truncation of branch names containing non-ASCII ↵Stefan Haller
characters
2024-06-23Use actual ellipsis character instead of ... to truncate stringsStefan Haller
Space is scarce in lazygit's UI, and using ... wastes a lot of it.
2024-06-23Reduce memory consumption when loading large number of commits (#3687)Stefan Haller
(Github decided to auto-close #2533, and I don't see any way to reopen it, so opening a new one here. Please see there for discussion and review.) When pressing `>` in the commits panel to trigger loading all the remaining commits past the initial 300, memory consumption is a pretty big problem for larger repositories. The two main causes seem to be 1. the cell memory from rendering the entire list of commits into the gocui view 2. the pipe sets when git.log.showGraph is on This PR addresses only the first of these problems, by not rendering the entire view, but only the visible portion of it. Since we already re-render the visible portion of the view on every layout call, this was relatively easy to do. Below are some measurements for our repository at work (261.985 commits): | | master | this PR | | ------------- | ------ | ------- | | without Graph | 855 MB | 360 MB | | with Graph | 3.1 GB | 770 MB | And for the linux kernel repo (1.170.387 commits): | | master | this PR | | ------------- | ----------------------------------------- | ------- | | without Graph | 5.8 GB | 1.2G | | with Graph | Killed by the OS after it reached 86.9 GB | 39.9 GB | The measurements were taken after scrolling all the way down in the list of commits. They have to be taken with a grain of salt, as memory consumption fluctuates quite a bit in ways that I find hard to make sense of. As you can see, there's more work to do to reduce the memory usage for the graph, but for our repo at work this PR makes it usable already, which it wasn't really before.
2024-06-23Render the view when scrolling with the wheelStefan Haller
2024-06-23Only render visible portion of the screen for commits viewStefan Haller
2024-06-23Simplify ListContextTrait.FocusLineStefan Haller
When refreshViewportOnChange is true, we would refresh the viewport once at the end of FocusLine, and then we would check at the end of AfterLayout if the origin has changed, and refresh again if so. That's unnecessarily complicated, let's just unconditionally refresh at the end of AfterLayout only.
2024-06-23Bump gocuiStefan Haller
2024-06-23Log memory usage every 10sStefan Haller
2024-06-23Search the model instead of the view in the commits panel (#3642)Stefan Haller
- **PR Description** This makes it possible to search the model data instead of the view when pressing `/`, and uses this for the commits view. This is mainly a preparation for #2533 which requires it, but it is also useful on its own, because it makes it possible to search for full commit hashes. It will highlight the abbreviated hash in that case. - **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)) * [ ] 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 have been updated if necessary * [x] You've read through your own file changes for silly mistakes etc
2024-06-23Use model searching in commits (and sub-commits) viewStefan Haller
2024-06-23Assert that the search status view is visibleStefan Haller
Just to be really sure that it not only contains the expected status text, but also actually shows it.
2024-06-23Add type assertions for all searchable contextsStefan Haller
We want to add an additional method to ISearchableContext later in this branch, and this will make sure that we don't forget to implement it in any concrete context.
2024-06-23Cleanup: remove outdated commentStefan Haller
We do show the graph in the left/right view, as of b7673577a2.
2024-06-23Fix searching in the divergence (left/right) viewStefan Haller
Searching in the "Divergence from upstream" view would select the wrong lines. The OnSearchSelect function gets passed a view index, and uses it to select a model line. In most views these are the same, but not in the divergence view (because of the Remote/Local section headers).
2024-06-23Cleanup: reduce some code duplicationStefan Haller
ListContextTrait.OnSearchSelect was introduced in 138be04e65, but it was never called. I can only guess that a planned refactoring wasn't finished here.
2024-06-15Add user config gui.commitAuthorFormat (#3625)Stefan Haller
- **PR Description** Adds configuration option defining whether to show full author names or their shortened form in the commit graph. Closes [#3624](https://github.com/jesseduffield/lazygit/issues/3624). - **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)) * [ ] 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)) * [x] Docs have been updated if necessary * [x] You've read through your own file changes for silly mistakes etc
2024-06-15Add user config gui.commitAuthorFormatanikiforov
2024-06-14Fix reporting of unexpected selections in integration tests (#3662)Stefan Haller
Expected and actual selection were swapped in the error message.
2024-06-14Fix reporting of unexpected selections in integration testsStefan Haller
Expected and actual selection were swapped in the error message.
2024-06-12Show "exec" todos in the list of rebase todos (#3654)Stefan Haller
- **PR Description** It is sometimes useful to perform a `git rebase -x "make test" origin/main` in order to verify that all commits of the current branch are green. However, if the rebase stops in the middle because one of those tests fail, it's easy to accidentally press `m <enter>` in lazygit after amending some fix, not realizing that the rest of the tests will now run invisibly inside lazygit. This PR makes two changes to improve this situation: - It shows exec todos in the commits panel: <img width="482" alt="image" src="https://github.com/jesseduffield/lazygit/assets/1225667/608b24e8-9f3d-4a5f-9bb5-e16268c86e83"> - when continuing a rebase and there are exec todos, it suspends itself to the background so that you can see the output of the test runs in the terminal. We can improve this further in the future; for example, it would often be useful to be able to delete some of the exec commands, this is not currently possible. But it's still better than before.
2024-06-12Suspend lazygit when continuing a rebase with exec todosStefan Haller
It's likely that the exec todos are some kind of lengthy build task whose output the user will want to see in the terminal.
2024-06-12Show "exec" todos in the list of rebase todosStefan Haller
Unfortunately it isn't possible to delete them. This would often be useful, but our todo rewriting mechanisms rely on being able to find todos by some identifier (hash for pick, ref for update-ref), and exec todos don't have a unique identifier.
2024-06-10Improve "Find base commit for fixup" command when there are changes for ↵Stefan Haller
master commits (#3645) - **PR Description** If exactly one candidate from inside the current branch is found, we return that one even if there are also hunks belonging to master commits; we disregard those in this case. - **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 have been updated if necessary * [x] You've read through your own file changes for silly mistakes etc
2024-06-10Disregard master commits when finding base commit for fixupStefan Haller
If exactly one candidate from inside the current branch is found, we return that one even if there are also hunks belonging to master commits; we disregard those in this case.
2024-06-10Don't reference Model().Commits multiple timesStefan Haller
Copy the slice into a variable and use that throughout the whole operation; this makes us a little more robust against the model refreshing concurrently.
2024-06-10Add test demonstrating the desired behaviorStefan Haller
It has two modified hunks, one for a master commit and one for a branch commit. Currently we get an error mentioning those two commits, but we would like to silently select the branch commit.
2024-06-07Support range select for amending commit attributes (#3587)Stefan Haller
- **PR Description** This PR makes it possible for users to select a range of commits from the commits view to amend their attributes (set/reset author, add co-author), the same way it's already possible to do for a single commit. It closes #3273. - **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 have been updated if necessary * [x] You've read through your own file changes for silly mistakes etc
2024-06-07feat: support range selection for commit attributes amendAzraelSec