1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-15 00:15:32 +02:00
Commit Graph

128 Commits

Author SHA1 Message Date
2499a6c8a3 Initialize translation set after reading user config
This allows having per-repo config files with different languages per repo. Now
granted, this is not an important use case that we need to support; however, the
goal is to eventually make all configs hot-reloadable (as opposed to loading
them only once at startup), so this is one step in that direction.
2024-08-18 10:24:52 +02:00
f98b57aa5e Change direct access to Common.UserConfig to a getter
This will allow us to turn the field into an atomic.Value for safe concurrent
access.
2024-08-18 10:24:52 +02:00
ef4fd70f9c Ignore GetRepoPaths error when launching 2024-08-03 10:02:47 -04:00
7a670964cd Optimize number of early calls to GetRepoPaths
This change reduces the number of calls during application startup to
one, calling GetRepoPaths() earlier than previously and plumbing the
repoPaths struct around to achieve this end.
2024-07-06 12:09:48 -07:00
9fa43394fe Make it possible to handle toasts in integration tests
Use it in two selected tests to demonstrate what it looks like.
2024-01-14 17:42:03 +01:00
18c5780485 Add AppState to common.Common 2023-09-04 17:48:39 +02:00
e33fe37a99 Standardise on using lo for slice functions
We've been sometimes using lo and sometimes using my slices package, and we need to pick one
for consistency. Lo is more extensive and better maintained so we're going with that.

My slices package was a superset of go's own slices package so in some places I've just used
the official one (the methods were just wrappers anyway).

I've also moved the remaining methods into the utils package.
2023-07-30 18:51:23 +10:00
7b302d8c29 Write unit tests with the help of afero
Afero is a package that lets you mock out a filesystem with an in-memory filesystem.
It allows us to easily create the files required for a given test without worrying about
a cleanup step or different tests tripping on eachother when run in parallel.

Later on I'll standardise on using afero over the vanilla os package
2023-07-30 18:35:36 +10:00
d4eae73a68 Do not quote initial branch arg when creating repo
Also, we shouldn't pass the initial branch arg if it's empty.
2023-07-11 17:18:58 +10:00
c92e687d3b Fix focus issue when opening recent-repos menu at launch
I don't know why we were setting the initial context to CurrentSideContext
and not just CurrentContext in the first place. If there is no current context
in either case it'll default to the files context. So the only issue is if
we anticipated that some random context would be focused and we didn't want to
activate that. But I can't think of any situation where that would happen.
2023-06-07 18:27:18 +10:00
e0ecc9e835 Allow global logging when developing
I'll be honest, for all I know logging should be global in general: it is
a pain to pass a logger to any struct that needs it. But smart people on the
internet tell me otherwise, and I do like the idea of not having any global
variables lying around.

Nonetheless, I often need to log things when locally debugging and that's a
different kind of logging than the kind you would include in the actual
released binary. For example if I want to log something from gocui, I would
rather not have gocui depend on lazygit's logging setup.
2023-05-25 18:31:32 +10:00
63dc07fded Construct arg vector manually rather than parse string
By constructing an arg vector manually, we no longer need to quote arguments

Mandate that args must be passed when building a command

Now you need to provide an args array when building a command.
There are a handful of places where we need to deal with a string,
such as with user-defined custom commands, and for those we now require
that at the callsite they use str.ToArgv to do that. I don't want
to provide a method out of the box for it because I want to discourage its
use.

For some reason we were invoking a command through a shell when amending a
commit, and I don't believe we needed to do that as there was nothing user-
supplied about the command. So I've switched to using a regular command out-
side the shell there
2023-05-23 19:49:19 +10:00
8edad826ca Begin refactoring gui
This begins a big refactor of moving more code out of the Gui struct into contexts, controllers, and helpers. We also move some code into structs in the
gui package purely for the sake of better encapsulation
2023-04-30 13:19:52 +10:00
bb856ad7c6 Bump minimum required git version to 2.20
We need this because the next commit is going to make use of the "break"
interactive rebase instruction, which was added in 2.20.
2023-02-19 10:20:14 +01:00
cd9111837e feat: add GitVersion struct 2022-12-30 20:01:14 +09:00
41222f07ed chore(gui): remove unused gitConfig 2022-12-30 20:01:14 +09:00
956372cf8a Run gofumpt 2022-08-18 18:26:34 +01:00
21a4522a51 Merge branch 'master' into feat/detect-bare-repo 2022-08-15 14:00:34 +01:00
154bd975a6 Apply refactoring suggestions 2022-08-15 13:59:34 +01:00
4aea005f26 Merge pull request #2098 from Ryooooooga/feature/not-a-repository-quit 2022-08-14 17:37:07 +10:00
ba96baee32 move code from main into app package to allow test to be injected 2022-08-13 13:55:08 +10:00
d890238c7b move input and assert into integration tests package 2022-08-13 13:52:13 +10:00
46ae55f91e introduce gui adapter 2022-08-13 13:51:56 +10:00
8b371ada73 feat(config): add notARepository: quit 2022-08-08 18:11:58 +09:00
0b4f9f8c76 Refactor branching logic 2022-08-01 21:58:00 +01:00
a658cd4076 Factor out opening of recent repos 2022-08-01 20:05:35 +01:00
69718fb557 Factor out redundant statement 2022-08-01 19:39:39 +01:00
b9b2f58bc8 Format, bug fixes 2022-08-01 17:41:20 +01:00
2866827ca8 Apply suggestions from code review 2022-08-01 17:05:16 +01:00
9987e65c35 Merge branch 'master' into feat/detect-bare-repo 2022-08-01 03:14:49 +01:00
9c6239df3d Worktrees should not be filtered out
But non-git directories should
2022-07-30 17:03:30 +02:00
41b54d742f Check for bare repositories 2022-07-29 23:55:34 +01:00
f1efa02640 Ask for initial branch name 2022-06-30 13:53:58 +02:00
32c0b39dbd Merge pull request #1950 from HiromasaNojima/add_subcommand_into_specific_layout_directly 2022-06-11 11:51:14 +10:00
b1e4968d0b allow opening lazygit to a specific panel 2022-06-11 11:23:56 +10:00
a955dbcfd7 Validate recent repo before blindly opening it 2022-06-11 09:42:51 +10:00
658a6b239b Fix parsing of 'y/n' when starting in non-repo 2022-06-11 09:42:51 +10:00
499d51ecf6 Merge pull request #1931 from mark2185/fix-non-existant-recent-repo 2022-05-18 22:22:28 +10:00
9693afd671 fix: fix lint error 2022-05-18 20:34:35 +09:00
1de5ca3511 Don't panic when there are no valid git repos 2022-05-17 07:28:52 +02:00
cd5b041b0f clearer separation of concerns when bootstrapping application 2022-05-07 16:02:04 +10:00
86c259623c feat: fix permission problem of temp dirs 2022-04-02 08:48:38 +11:00
99e55725fb simplify 2022-03-24 20:14:41 +11:00
cb26c7a1f2 more things 2022-03-24 20:14:41 +11:00
a34bdf1a04 update linters 2022-03-19 12:12:57 +11:00
2a1e3faa0c resetting controllers on new repo 2022-03-17 19:13:40 +11:00
b8fc829f86 Record current directory on switch 2022-03-17 19:01:28 +11:00
2436ff197a fewer panics 2022-01-09 14:14:47 +11:00
18f48a43d5 add some more linters 2022-01-09 14:09:53 +11:00
364c5db19c shorten name 2022-01-09 14:09:53 +11:00