Stefan Haller
b71aa5e23b
Add regression test for resolving conflicts in a file without a trailing LF
...
The test shows that the last line of the file is lost.
2024-10-09 15:36:02 +02:00
Stefan Haller
72cf3efb1d
Add test demonstrating problem with ForEachLineInFile
...
The function drops the last line if it doesn't end with a line feed.
2024-10-09 15:36:02 +02:00
Stefan Haller
ae610dcbb7
Extract helper function for easier testing
2024-10-09 15:08:01 +02:00
Stefan Haller
d11e11d179
Auto-render hyperlinks ( #3914 )
...
- **PR Description**
Add a facility to gocui.View to enable auto-rendering of https
hyperlinks. Then, use it for the Command Log panel (as an alternative
approach to #3911 ), and also in the status view and in confirmation
popups to get rid of some code that used to do this manually.
- **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 ))
* [ ] If a new UserConfig entry was added, make sure it can be
hot-reloaded (see
[here](https://github.com/jesseduffield/lazygit/blob/master/docs/dev/Codebase_Guide.md#using-userconfig ))
* [ ] Docs have been updated if necessary
* [x] You've read through your own file changes for silly mistakes etc
2024-09-28 12:07:28 +02:00
Stefan Haller
825f5c0a91
Use AutoRenderHyperLinks in confirmation view
...
This allows us to get rid of the underlineLinks function.
2024-09-28 12:04:51 +02:00
Stefan Haller
26e3a93fc3
Use AutoRenderHyperLinks in main views
...
This allows clicking on links in commit messages, for examples. It also affects
the status view, so we can get rid of the manual hyperlinking there.
2024-09-28 12:04:51 +02:00
Stefan Haller
1ceb5a6b37
Turn on AutoRenderHyperLinks in the Command Log panel
...
Some commands output hyperlinks, and it's useful to be able to click them.
2024-09-28 12:04:51 +02:00
Stefan Haller
65b731f484
Bump gocui
2024-09-28 12:04:51 +02:00
Stefan Haller
c6a7722066
Add a menu item to delete both local and remote branch at once ( #3916 )
...
- **PR Description**
Add a menu item to delete both local and remote branch at once.
- **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 ))
* [ ] If a new UserConfig entry was added, make sure it can be
hot-reloaded (see
[here](https://github.com/jesseduffield/lazygit/blob/master/docs/dev/Codebase_Guide.md#using-userconfig ))
* [ ] Docs have been updated if necessary
* [x] You've read through your own file changes for silly mistakes etc
2024-09-28 11:26:20 +02:00
Stefan Haller
1ab70ec645
Add a menu item to delete both local and remote branch at once
2024-09-28 11:23:21 +02:00
Stefan Haller
e181de1180
Better branch delete confirmation ( #3915 )
...
- **PR Description**
When deleting a local branch, put up the "This branch is not fully
merged, do you want to force delete it" confirmation only when the
branch is not merged into any of the main branches.
- **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 ))
* [ ] If a new UserConfig entry was added, make sure it can be
hot-reloaded (see
[here](https://github.com/jesseduffield/lazygit/blob/master/docs/dev/Codebase_Guide.md#using-userconfig ))
* [ ] Docs have been updated if necessary
* [x] You've read through your own file changes for silly mistakes etc
2024-09-28 11:22:54 +02:00
Stefan Haller
c712b1d0fe
Better local branch delete confirmation
...
Currently we try to delete a branch normally, and if git returns an error and
its output contains the text "branch -D", then we prompt the user to force
delete, and try again using -D. Besides just being ugly, this has the
disadvantage that git's logic to decide whether a branch is merged is not very
good; it only considers a branch merged if it is either reachable from the
current head, or from its own upstream. In many cases I want to delete a branch
that has been merged to master, but I don't have master checked out, so the
current branch is really irrelevant, and it should rather (or in addition) check
whether the branch is reachable from one of the main branches. The problem is
that git doesn't know what those are.
But lazygit does, so make the check on our side, prompt the user if necessary,
and always use -D. This is both cleaner, and works better.
See this mailing list discussion for more:
https://lore.kernel.org/git/bf6308ce-3914-4b85-a04b-4a9716bac538@haller-berlin.de/
2024-09-28 11:19:32 +02:00
Stefan Haller
c4e5995cb9
Fix bug with deleting remote branch whose name doesn't match local branch
2024-09-28 11:19:32 +02:00
Stefan Haller
be3683ccc8
Add test that demonstrates bug with deleting remote branch with different name
...
It's maybe not very common, but it's totally possible for a remote branch to
have a different name than the local branch. This test shows that we don't
support this properly when deleting the remote branch.
2024-09-28 11:19:32 +02:00
Stefan Haller
7e7309f97e
Add question marks to questions
2024-09-28 11:19:32 +02:00
Stefan Haller
d2b6f93858
Remove unused texts
2024-09-28 11:19:32 +02:00
Stefan Haller
a91fe517d3
Remove obsolete TODO comment
...
Looks perfectly internationalized to me.
2024-09-28 11:19:32 +02:00
Stefan Haller
8a328a553a
Fix copying commit author to clipboard ( #3936 )
...
- **PR Description**
This included single quotes in strange places in the copied text.
Fixes #3933 .
- **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 ))
* [ ] If a new UserConfig entry was added, make sure it can be
hot-reloaded (see
[here](https://github.com/jesseduffield/lazygit/blob/master/docs/dev/Codebase_Guide.md#using-userconfig ))
* [ ] Docs have been updated if necessary
* [x] You've read through your own file changes for silly mistakes etc
2024-09-28 11:15:03 +02:00
Stefan Haller
3d56357294
Fix copying commit author to clipboard
...
This was a regression introduced with the GitCommandBuilder in 25f8b0337.
2024-09-23 09:47:14 +02:00
Stefan Haller
9b2a0c4538
Add test for copying a commit author to the clipboard
...
The test shows that we are including single quotes in strange places.
2024-09-23 09:45:03 +02:00
Jesse Duffield
a04ad24a60
Add performance improvements section to release notes ( #3922 )
...
- **PR Description**
- **Please check if the PR fulfills these requirements**
* [ ] Cheatsheets are up-to-date (run `go generate ./...`)
* [ ] 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 ))
* [ ] If a new UserConfig entry was added, make sure it can be
hot-reloaded (see
[here](https://github.com/jesseduffield/lazygit/blob/master/docs/dev/Codebase_Guide.md#using-userconfig ))
* [ ] Docs have been updated if necessary
* [ ] 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-09-18 21:26:47 +10:00
Jesse Duffield
0d633896ae
Add performance improvements section to release notes
2024-09-18 21:06:02 +10:00
Stefan Haller
611fabde11
Fix crash when viewing the divergence of a branch which is up to date with its upstream ( #3918 )
...
This was introduced by #3838 , specifically by commit e675025411.
Fixes #3900 and #3917 .
v0.44.1
2024-09-18 09:27:11 +02:00
Stefan Haller
f8073c7188
Fix crash when viewing the divergence of a branch which is up to date with its upstream
...
This was introduced by #3838 , specifically by commit e675025411.
Add a regression test that would have crashed without the fix.
2024-09-18 09:24:10 +02:00
Stefan Haller
4dadcd2ace
Improve performance with large numbers of untracked or modified files ( #3919 )
...
- **PR Description**
**BuildTreeFromFiles** used a linear complexity lookup to find if the
children has already been added. Use maps to get constant time lookup
for children.
For the test scenario in #3798 (90000 untracked files) this reduces the
time of BuildTreeFromFiles from something like 10s down to about 30ms on
my machine.
Fixes #3798 .
- **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 ))
* [ ] If a new UserConfig entry was added, make sure it can be
hot-reloaded (see
[here](https://github.com/jesseduffield/lazygit/blob/master/docs/dev/Codebase_Guide.md#using-userconfig ))
* [ ] Docs 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-09-18 09:23:21 +02:00
partho.kunda
b18f12ca0f
Use map to quickly find children in BuildTreeFromFiles
2024-09-18 09:16:58 +02:00
Stefan Haller
c67979abbb
Add options for disabling switching to the Files panel after popping or applying a stash ( #3913 )
...
- **PR Description**
In v0.44.0 we added a small QoL improvement to auto-switch to the Files
panel after popping or applying a stash. While this should be an
improvement for most people, it turns out to be in the way of some
people's workflows, so make it configurable. See
[here](https://github.com/jesseduffield/lazygit/pull/3888#issuecomment-2350853602 )
for more discussion.
2024-09-15 14:19:08 +02:00
Stefan Haller
0e489bb5cc
Add options for disabling switching to the Files panel after popping or applying a stash
2024-09-15 11:59:59 +02:00
Stefan Haller
647f533e71
With stacked branches, create fixup commit at the end of the branch it belongs to ( #3892 )
...
- **PR Description**
When working with stacked branches, and creating a fixup commit for a
commit in one of the lower branches of the stack, the fixup was created
at the top of the stack and the user needed to move it down to the right
branch manually. This is unnecessary extra work; create it at the end of
the right branch automatically.
2024-09-15 11:21:34 +02:00
Stefan Haller
b22149d832
Create fixup commit at end of its branch when there's a stack of branches
2024-09-15 11:19:39 +02:00
Stefan Haller
396215a5c9
Extract helper function for getting the hash of the last commit made
2024-09-15 11:19:39 +02:00
Stefan Haller
42c157a5e6
Add changeToFixup field to MoveFixupCommitDown
2024-09-15 11:19:39 +02:00
Stefan Haller
a793f709b6
Update language files from Crowdin ( #3898 )
...
- **PR Description**
Pull down the latest translations from Crowdin. Unfortunately I forgot
to do this in time for the 0.44 release, bummer.
I'm not sure how much testing/proof-reading/peer review we want to do on
these.
2024-09-15 09:43:15 +02:00
Stefan Haller
f74551e464
Generate keybindings
2024-09-08 15:20:52 +02:00
Stefan Haller
e06b1cef60
Update language files from Crowdin
2024-09-08 15:19:26 +02:00
Stefan Haller
2d0c7cb0fc
Switch to Files panel after popping a stash ( #3888 )
...
#### PR Description
I find myself always switching to the Files panel after popping a stash,
100% of the time, so it makes sense that lazygit does this for me. Do it
for apply as well, for consistency.
#### 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 ))
* [ ] If a new UserConfig entry was added, make sure it can be
hot-reloaded (see
[here](https://github.com/jesseduffield/lazygit/blob/master/docs/dev/Codebase_Guide.md#using-userconfig ))
* [ ] Docs have been updated if necessary
* [x] You've read through your own file changes for silly mistakes etc
v0.44.0
2024-09-06 13:21:49 +02:00
Stefan Haller
f5b8619ded
Switch to Files panel after popping a stash
2024-09-06 13:15:37 +02:00
Stefan Haller
4c6c915a77
Get rid of a lot of error return values ( #3890 )
...
- **PR Description**
Change many functions in the gui package (and some in gocui) to no
longer return errors.
There might be more that could be changed in this way, but I feel these
are the main ones.
Fixes #3887 .
2024-09-06 08:48:44 +02:00
Stefan Haller
064fae41e7
Remove return value of OpenCommitMessagePanel
...
Similar to the previous commit: in 100% of the call sites we now need an extra
`return nil`. Nevertheless, I still prefer it this way.
2024-09-06 08:45:48 +02:00
Stefan Haller
d4ef8e53d5
Remove return value of Alert/Confirm/Prompt
...
This might seem controversial; in many cases the client code gets longer,
because it needs an extra line for an explicit `return nil`. I still prefer
this, because it makes it clearer which calls can return errors.
2024-09-06 08:45:48 +02:00
Stefan Haller
b15a1c7ae7
Remove return value of CreatePopupPanel
2024-09-06 08:45:48 +02:00
Stefan Haller
6f0182f11c
Remove return value of RefreshPatchBuildingPanel
2024-09-06 08:45:48 +02:00
Stefan Haller
371998e635
Remove return value of IContextMgr.Push/Pop et. al.
2024-09-06 08:45:48 +02:00
Stefan Haller
072b465fa6
Fix a lock that is held too long
...
I can only guess, but I think this was a typo (or a copy-paste-o) when this code
was written. It was introduced in 55af07a1bb, and I think the defer was kept by
accident; if it had been on purpose, then the statement would have been put
right after the Lock call.
2024-09-06 08:45:48 +02:00
Stefan Haller
8302575078
Remove return value of Focus-related functions
2024-09-06 08:45:48 +02:00
Stefan Haller
8edcd71234
Remove return value of IPatchExplorerContext.Render, RenderAndFocus, and NavigateTo
2024-09-06 08:45:48 +02:00
Stefan Haller
5446683881
Remove return value of RenderToMainViews and some related functions
2024-09-06 08:45:48 +02:00
Stefan Haller
b91beb68e1
Remove return value of HandleRender
2024-09-06 08:45:48 +02:00
Stefan Haller
5659f1f3e9
Bump gocui
...
And adapt client code.
2024-09-06 08:45:48 +02:00
Stefan Haller
753b16b697
Add Zed editor support to editorPreset ( #3886 )
...
- **PR Description**
- **Please check if the PR fulfills these requirements**
* [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)
* [X] Docs have been updated if necessary
* [X] You've read through your own file changes for silly mistakes etc
2024-09-03 19:27:29 +02:00