summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2024-03-09WIPfix-sponsorsJesse Duffield
2024-03-09TestJesse Duffield
2024-03-09Fix sponsors CIJesse Duffield
this was failing because you need sufficient permissions to push to a protected branch
2024-03-09Auto-wrap commit message while typing (#3173)Stefan Haller
- **PR Description** Add new config settings `git.commit.autoWrapCommitMessage` (default true) and `git.commit.autoWrapWidth` (default 72), which allow automatic as-you-type wrapping of the commit message body to the specified width. There are occasional situations where this wrapping is in the way, for example when you need to have longer lines in the message for some reason (perhaps because you have a very wide ASCII art picture or table), and you'll have to resort to switching to the editor in that case. However, in my experience these cases are quite rare.
2024-03-09Add integration testStefan Haller
2024-03-09Remove hard line breaks when rewording commitsStefan Haller
... and when recalling a commit message from an old commit by pressing up-arrow. This is necessary because committing turns our soft line breaks into real ones, but when rewording we want to turn them back into soft ones again, so that it's possible to insert words at the beginning of a paragraph and have everything rewrap nicely. This is only a best effort; the algorithm only removes those hard line breaks that can be removed without changing the way the message looks. This works well when the previous commit message was wrapped at the same width, which for most users should be the most common case; but if it wasn't, the result is not great. Specifically, if the old wrap width was smaller, some hard line breaks just won't be removed; if it was wider though, you'll get an unpleasant comb effect with alternating long and short lines. In such a case it's best to switch to the editor and use whatever wrapping features you have there (e.g. alt-Q).
2024-03-09Replace DOS linefeeds with Unix line feeds when loading a commit messageStefan Haller
I have seen some commit messages that contain CRLF instead of just LF; I'm not sure if these were created by a broken git client, but they exist, so we need to deal with them. Editing them when rewording a commit sort of works, but is a little strange; the \r characters are invisble, so you need an extra arrow key press to skip over them. In the next commit we are going to add more logic related to line breaks, and it is getting confused by the \r, so it is becoming more important to fix this. The easiest fix is to normalize the line endings right after loading.
2024-03-09Save and restore the unwrapped descriptionStefan Haller
When preserving the commit message (when cancelling a commit), and later restoring it, use the unwrapped description.
2024-03-09Add config for soft-wrapping the commit message bodyStefan Haller
2024-03-09Bump gocuiStefan Haller
2024-03-09Adjust selection after squashing fixups (#3338)Stefan Haller
- **PR Description** Keep the same commit selected after squashing fixup commits, and after creating fixup commits. Edge case: it is now possible to have a range of commits selected when squashing fixups (by using the "in current branch" version of the command), and in that case we don't bother preserving the range. It would be possible, but would require more code, and I don't think it's worth it, so I'm simply collapsing the range in that case.
2024-03-09Keep the same line selected after squashing fixup commitsStefan Haller
This uses a bit of a heuristic that is hopefully correct most of the time.
2024-03-09Extract common code to a helper methodStefan Haller
This should arguably have been done in b133318b40 already; it's becoming more important now because we're going to extend the common code with more logic in the next commit.
2024-03-09Move selection down by one after creating a fixup commitStefan Haller
2024-03-09Extend squash_fixups_in_current_branch test to check the selectionStefan Haller
This shows a problem with the wrong commit being selected after squashing.
2024-03-09Add test for creating a fixup commit and squashing fixupsStefan Haller
We have such a test already (squash_fixups_above_first_commit.go), but it can't be used for what we want to check here, because it uses the first commit, and we can't move down from there. So create a new one that basically does the same thing, but for a commit in the middle. The focus of this new test is to check how the selection behaves; as you can see, there is a problem both when creating a fixup and when squashing fixups. We'll address these separately in the next commits.
2024-03-09Support setting a range of commits to "edit" outside of a rebase (#3370)Stefan Haller
- **PR Description** It is now possible to select a range of commits (while not in a rebase), and hit "e" to edit them all. This starts a rebase on the bottom-most commit of the range, and sets all the selected commits to "edit" (skipping merge commits, because they can't be edited).
2024-03-09Support setting a range of commits to "edit" outside of a rebaseStefan Haller
It starts a rebase on the bottom-most commit of the range, and sets all the selected commits to "edit" (skipping merge commits, because they can't be edited).
2024-03-07Show all submodules recursively (#3341)Stefan Haller
- **PR Description** Extend the submodules tab to show not only the top-level submodules, but also their nested submodules, recursively. Fixes #3306.
2024-03-07Show all submodules recursivelyStefan Haller
2024-03-07Pass entire submodule to UpdateUrl instead of name and path separatelyStefan Haller
This will make the next commit slightly simpler.
2024-03-07Fix deleting submodule where name and path are differentStefan Haller
2024-03-07Add test to check that the git dir for a deleted submodule was removedStefan Haller
The test shows that it actually doesn't work when the submodule name is different from its path. We'll fix this in the next commit.
2024-03-07Extend submodule tests to use a submodule where name and path are differentStefan Haller
In most real-world scenarios, name and path are usually the same. They don't have to be though, and it's important to make sure we use the right one when passing arguments to git commands, so change the tests to have different name and path.
2024-03-07Don't strike out reserved keys in menus (#3365)Stefan Haller
It seems to cause more confusion than it helps. Fixes #2819.
2024-03-06Don't strike out reserved keys in menusStefan Haller
It seems to cause more confusion than it helps.
2024-03-03Bump gocui (#3356)Stefan Haller
This resolves the regression from the last gocui bump that strikethrough no longer worked. Fixes #3355.
2024-03-03Bump gocuiStefan Haller
This resolves the regression from the last gocui bump that strikethrough no longer worked.
2024-03-02Remove support for old style non-interactive rebase (#3348)Stefan 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 or by using very uncommon git options. So instead of fixing the bug, just remove the code.
2024-03-02Remove support for old-style non-interactive rebasesStefan 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 or by using very uncommon git options. So instead of fixing the bug, just remove the code.
2024-03-02Allow more than one argument in git.merging.args config (#3336)Stefan Haller
- **PR Description** Fix a bug where merging would fail with an error message when you try to put more than one argument in the `git.merging.args` config. This broke with 25f8b0337e. Fixes #3334.
2024-03-02Break git.merging.args config into separate arguments on whitespaceStefan Haller
This makes it possible again to pass multiple arguments, for example "--ff-only --autostash". This won't work correctly if you want to use an argument that contains a space, but it's very unlikely that people will want to do that, so I think this is good enough.
2024-03-02Add a test that demonstrates a bug with multiple args in git.merging.args configStefan Haller
We are currently passing the whole string as a single argument, which doesn't work of course.
2024-03-02Don't show branch head on rebase todos if the rebase.updateRefs config is on ↵Stefan Haller
(#3340) - **PR Description** When doing an interactive rebase of a stack of branches with the `rebase.updateRefs` git config set to true, you get `update-ref` todos between the "pick" items. In this situation we would still show the branch head icon for each pick item that used to be the head of a branch. This is confusing, especially when you want to move a new commit to the head of a branch in the middle of the stack. Consider the following scenario: <img width="410" alt="image" src="https://github.com/jesseduffield/lazygit/assets/1225667/438b7157-e51e-48fb-95a9-b67039a7ad30"> Here we have made a new commit at the top of the stack, entered interactive rebase, and moved the commit down to the head of the second branch. Now it sits between the commit that shows the branch icon of the second branch, and the update-ref item for the second branch. This is super confusing, and it's simply better to not show branch icons for pick entries. That's what this PR does. We do show the icons if the `rebase.updateRefs` config is off, because otherwise there would be no indication of where the branches start and end. Of course, changing anything in this case will destroy the stack, so maybe it would be better to hide the icons in this case too to make this more obvious. I'm unsure about that.
2024-03-02Don't show branch head on rebase todos if the rebase.updateRefs config is onStefan Haller
The additional branch head icon is more confusing than useful in this situation. The update-ref entries show very clearly where the branch heads will go when continuing the rebase; the information where the branch heads used to be before the rebase is not really needed here, and just makes the display more confusing. I'm not adding more tests here because the changes to the existing tests demonstrate the change clearly enough.
2024-03-02Rename showBranchMarkerForHeadCommit parameter to hasRebaseUpdateRefsConfigStefan Haller
Name it after what it is rather than what it is used for. In the next commit we will use it for another condition.
2024-03-02Add test demonstrating the current (undesired) behaviorStefan Haller
2024-03-02Provide two helix presets, one for "helix" and one for "hx" (#3346)Stefan Haller
The helix binary seems to be called "helix" on some distributions (e.g. Arch), but "hx" on others (e.g. Fedora). Provide presets for both, so that auto-detection from $EDITOR works. See https://github.com/jesseduffield/lazygit/issues/2624#issuecomment-1966509979.
2024-03-02Provide two helix presets, one for "helix" and one for "hx"Stefan Haller
The helix binary seems to be called "helix" on some distributions (e.g. Arch), but "hx" on others (e.g. Fedora). Provide presets for both, so that auto-detection from $EDITOR works.
2024-03-02Make ctrl-f available in staging view (#3349)Stefan Haller
- **PR Description** A common workflow for me is to create a fixup commit from only some of my current changes; to do that, I enter a file, stage a few hunks, and then want to invoke ctrl-f to find the base commit for these changes. Currently I need to esc back to the files panel in order to do that; it's more convenient to be able to do this right from the staging panel. Labelled as "ignore-for-release" because the ctrl-f feature has only been added after the last release, so no release notes needed for this change.
2024-03-02Make ctrl-f available in staging viewStefan Haller
A common workflow for me is to create a fixup commit from only some of my current changes; to do that, I enter a file, stage a few hunks, and then want to invoke ctrl-f to find the base commit for these changes. Currently I need to esc back to the files panel in order to do that; it's more convenient to be able to do this right from the staging panel.
2024-03-02Fix linter warnings (#3351)Stefan Haller
These started to pop up in my editor after I installed an update of gopls, I think.
2024-03-02Fix linter warningsStefan Haller
These started to pop up in my editor after I installed an update of gopls, I think. It's unfortunate that we don't see them on CI.
2024-03-02Fix display of Chinese characters on Windows (#3352)Stefan Haller
Bump our gocui dependency, which in turn bumps tcell to v2.7.1, which should fix problems with multibyte characters on Windows. Fixes #2741.
2024-03-01Bump gocuiStefan Haller
The main change here is to bump tcell to v2.7.1, which should fix problems with multibyte characters on Windows.
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.