Commit graph

605 commits

Author SHA1 Message Date
Jesse Duffield 68a9d7fd77 appease linter 2023-04-30 13:19:53 +10:00
Jesse Duffield 037cd99138 move quit actions to controller 2023-04-30 13:19:53 +10:00
Jesse Duffield f8c9ce33c2 move more actions into controller 2023-04-30 13:19:53 +10:00
Jesse Duffield 4a33fede7b move window arrangement helper 2023-04-30 13:19:53 +10:00
Jesse Duffield db12853bbe lots of changes 2023-04-30 13:19:53 +10:00
Jesse Duffield 43251e7275 split context common from helper common 2023-04-30 13:19:53 +10:00
Jesse Duffield 1b2fb34ffd start moving getDisplayStrings funcs into contexts 2023-04-30 13:19:53 +10:00
Jesse Duffield 509e3efa70 lots more refactoring 2023-04-30 13:19:53 +10:00
Jesse Duffield 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
Stefan Haller 046b0d9daa Show warning about deprecated edit configs
We print this to the terminal after lazygit quits rather than showing it in a
panel at startup, so as to not annoy people too much. Hopefully it will still be
prominent enough this way.
2023-04-13 13:14:00 +02:00
Jesse Duffield 4780953cef
Merge pull request #2377 from shinhs0506/clear-staging-after-commit 2023-03-24 19:13:00 +11:00
Jesse Duffield 8121a0cc74 remove old integration test recording code 2023-03-24 18:42:11 +11:00
Stefan Haller b7c61aa883 Push initial context instead of just putting it in the context array
This makes sure activateContext gets called on it.
2023-03-20 20:14:13 +11:00
Ryooooooga a624e0457f
feat(subcommits): load unlimited sub-commits 2023-02-27 15:29:00 +09:00
Phanindra kumar Paladi a11e91e651 replaced 'screenMode' to 'windowSize' in config 2023-01-16 20:07:21 +05:30
Phanindra kumar Paladi f4ccb68464 Added screenMode configuration to gui configuration 2023-01-11 16:51:46 +05:30
Ryooooooga cd9111837e
feat: add GitVersion struct 2022-12-30 20:01:14 +09:00
Ryooooooga 41222f07ed
chore(gui): remove unused gitConfig 2022-12-30 20:01:14 +09:00
Jesse Duffield af5b3be286 integrate snake game into lazygit 2022-12-30 12:18:59 +11:00
Jesse Duffield fa97b0c76e move background code into its own file 2022-12-24 19:14:52 +11:00
Jesse Duffield dde70486a1 apply user config changes in sandbox mode 2022-12-20 23:07:43 +11:00
Jesse Duffield ed98b60078 use thread safe map 2022-10-02 20:57:44 -07:00
kawaemon 17df42e517 fix: scan to buffer to empty character input in stdin 2022-09-23 23:42:45 -07:00
jiepeng b8900baf1a remove deprecated calls 2022-09-17 15:10:41 -07:00
Jesse Duffield 7af7af27c6 various changes to improve integration tests 2022-09-16 08:42:39 -07:00
Jesse Duffield ba96baee32 move code from main into app package to allow test to be injected 2022-08-13 13:55:08 +10:00
Jesse Duffield d890238c7b move input and assert into integration tests package 2022-08-13 13:52:13 +10:00
Jesse Duffield 77881a9c7d add new integration test pattern 2022-08-11 21:24:15 +10:00
Jesse Duffield 755ae0ef84 add deadlock mutex package
write to deadlock stderr after closing gocui

more deadlock checking
2022-08-07 11:16:14 +10:00
Jesse Duffield 7410acd1aa move merge conflicts code into controller 2022-08-07 11:16:03 +10:00
Jesse Duffield 445a625b56 rename merging context to mergeConflicts 2022-08-06 18:05:00 +10:00
Jesse Duffield 54fb73080a use ptmx map so that we can have multiple ptmx's stored for resizing 2022-08-06 13:49:11 +10:00
Jesse Duffield 524bf83a4a refactor to only have one context per view 2022-08-06 13:49:11 +10:00
Jesse Duffield debc58b6c5 fix popup focus issue 2022-08-01 22:09:48 +10:00
Jesse Duffield 7077ea428f add optimistic rendering for staging and unstaging files 2022-07-31 14:34:57 +10:00
Jesse Duffield b1e4968d0b allow opening lazygit to a specific panel 2022-06-11 11:23:56 +10:00
Ryooooooga bfefef92a6
chore(i18n): move InitialViewTabContextMap to gui package 2022-05-18 21:09:48 +09:00
Ryooooooga 5275161a88
chore(i18n): localize panel titles 2022-05-18 20:55:42 +09:00
Jesse Duffield f257740ea7 add tooltip view for showing menu item descriptions 2022-05-08 13:24:36 +10:00
Jesse Duffield 517e9445df refactor view definitions 2022-05-08 11:41:13 +10:00
Ryooooooga cb13fe7f46
feat(gui): show commit icons 2022-04-23 12:25:41 +09:00
Ryooooooga b07aeda5a6
feat(gui): show file icons 2022-04-23 12:25:40 +09:00
Jesse Duffield e68093fe99 add scrollbars 2022-04-16 17:29:17 +10:00
Jesse Duffield b838b74801 do not highlight line if there are no items to display 2022-04-16 15:19:32 +10:00
Ryooooooga 86c259623c feat: fix permission problem of temp dirs 2022-04-02 08:48:38 +11:00
Moritz Haase e35ab3c5fe pkg/gui: Use 'alert' popups instead of 'confirm' popups where appropriate
Invocations of 'IPopupHandler::Confirm()' that use neither 'HandleConfirm' nor
'HandleClose' can be replaced by 'Alert()'.
2022-03-30 20:13:43 +11:00
Moritz Haase 8fb2acc224 pkg/gui: Rename IPopupHandler::Ask() to Confirm()
Follow the JavaScript naming scheme for user interaction (alert, prompt,
confirm) as discussed in #1832.
2022-03-30 20:13:43 +11:00
Jesse Duffield 0dfb7c08b7 remove controllers struct 2022-03-27 18:16:16 +11:00
Moritz Haase 4abd80e2c4 pkg/gui: Fix crash if auto-fetch interval is non-positive
Check whether the auto-fetch interval configured is actually positive before
starting the background fetcher. If it is not, an error is logged. Also improve
the config option documentation a bit to make it easier to understand how to
disable auto-fetch.
2022-03-27 10:14:33 +11:00
Moritz Haase 240483953f config: Add option 'git.autoRefresh' to en-/disable auto-refresh
Adds a new 'autoRefresh' option to the 'git' config section that allows user to
disable auto-refresh (defaults to on). If auto-refresh is enabled, the
refreshInterval is now checked before starting the timer to prevent crashes when
it is non-positive.

Fixes #1417
2022-03-27 10:14:33 +11:00
Jesse Duffield ad7703df65 show namesake for child views 2022-03-26 18:00:46 +11:00
Jesse Duffield 13b90ac37f support viewing commits of reflog entry and show better view title 2022-03-26 18:00:46 +11:00
Jesse Duffield a34bdf1a04 update linters 2022-03-19 12:12:57 +11:00
Jesse Duffield 8fd6338527 move workspace reset menu into controller 2022-03-17 19:13:40 +11:00
Jesse Duffield ee1337b931 add remote branches controller 2022-03-17 19:13:40 +11:00
Jesse Duffield 675510ba53 fix integration test 2022-03-17 19:13:40 +11:00
Jesse Duffield ef7c4c9ca9 refactor custom commands
more custom command refactoring
2022-03-17 19:13:40 +11:00
Jesse Duffield 952a4f3f23 prevent interrupting confirmation panel 2022-03-17 19:13:40 +11:00
Jesse Duffield 46e9946854 refactor credential handling 2022-03-17 19:13:40 +11:00
Jesse Duffield d991d74b06 add commit message controller 2022-03-17 19:13:40 +11:00
Jesse Duffield ecaff7fc6c add commit files controller 2022-03-17 19:13:40 +11:00
Jesse Duffield c685a413c9 stash controller 2022-03-17 19:13:40 +11:00
Jesse Duffield a643957f89 include stash in commitish controller 2022-03-17 19:13:40 +11:00
Jesse Duffield e842d1bc9e move git flow 2022-03-17 19:13:40 +11:00
Jesse Duffield 8a555dd62e refactor 2022-03-17 19:13:40 +11:00
Jesse Duffield bef26b9634 add common commit controller 2022-03-17 19:13:40 +11:00
Jesse Duffield 574c5ca0de add subcommits controller 2022-03-17 19:13:40 +11:00
Jesse Duffield eab00de273 reflog controller 2022-03-17 19:13:40 +11:00
Jesse Duffield 371b8d638b more consistent naming 2022-03-17 19:13:40 +11:00
Jesse Duffield 943a8e83da ensure we retain state when returning to submodule parent 2022-03-17 19:13:40 +11:00
Jesse Duffield 41527270ed appease linter 2022-03-17 19:13:40 +11:00
Jesse Duffield 722410aded refactor controllers 2022-03-17 19:13:40 +11:00
Jesse Duffield b93b8cc00a controller for viewing sub commits 2022-03-17 19:13:40 +11:00
Jesse Duffield cd31a762b9 rename OSCommand field to os 2022-03-17 19:13:40 +11:00
Jesse Duffield d82f175e79 refactor contexts 2022-03-17 19:13:40 +11:00
Jesse Duffield 145c69d9ae working again 2022-03-17 19:13:40 +11:00
Jesse Duffield 482bdc4f1e more refactoring 2022-03-17 19:13:40 +11:00
Jesse Duffield 8e3484d8e9 add global controller 2022-03-17 19:13:40 +11:00
Jesse Duffield 226985bf76 refactor keybindings 2022-03-17 19:13:40 +11:00
Jesse Duffield 2db4636815 no more indirection 2022-03-17 19:13:40 +11:00
Jesse Duffield 2a1e3faa0c resetting controllers on new repo 2022-03-17 19:13:40 +11:00
Jesse Duffield 0a8cff6ab6 some more refactoring 2022-03-17 19:13:40 +11:00
Jesse Duffield 182c999ee0 fix linting 2022-03-17 19:13:40 +11:00
Jesse Duffield b5515da00b move commit files context into new structure 2022-03-17 19:13:40 +11:00
Jesse Duffield c084abb378 move more view model logic into the files view model 2022-03-17 19:13:40 +11:00
Jesse Duffield 8ea7b7a62e migrate files context to new structure 2022-03-17 19:13:40 +11:00
Jesse Duffield f97de692e3 move helpers into their own struct 2022-03-17 19:13:40 +11:00
Jesse Duffield 2692637fbe standardise naming 2022-03-17 19:13:40 +11:00
Jesse Duffield 77d0732fa8 add actions abstraction 2022-03-17 19:13:40 +11:00
Jesse Duffield 138be04e65 refactor contexts code 2022-03-17 19:13:40 +11:00
Jesse Duffield 1a74ed3214 avoid deadlock 2022-03-17 19:13:40 +11:00
Jesse Duffield a2318d75b5 fix some things 2022-03-17 19:13:40 +11:00
Jesse Duffield 1dd7307fde start moving commit panel handlers into controller
more

and more

move rebase commit refreshing into existing abstraction

and more

and more

WIP

and more

handling clicks

properly fix merge conflicts

update cheatsheet

lots more preparation to start moving things into controllers

WIP

better typing

expand on remotes controller

moving more code into controllers
2022-03-17 19:13:40 +11:00
Jesse Duffield a90b6efded start refactoring gui 2022-03-17 19:13:40 +11:00
Jesse Duffield fa8571e1f4 rename field 2022-03-17 19:01:28 +11:00
David Roman b8fc829f86 Record current directory on switch 2022-03-17 19:01:28 +11:00
Ram Bhosale 7be25a105d allow skipping confirmation prompt after opening subprocess 2022-03-17 17:52:31 +11:00
Matt Cles 9adf4a1908 Add shared function for loading map of custom colors 2022-02-01 18:55:45 +11:00
Matt Cles 4df7646654 Add configurable colors for branch prefixes
Branches can now be colored based on their prefix, if it matches
a user defined prefix in the config file. If no user defined
prefix matches, then it will fallback to the defaults: green for
'feature', yellow for 'bugfix', and red for 'hotfix'. All
remaining branches will be set to the default text color.
2022-02-01 18:55:45 +11:00
Jesse Duffield c8cc18920f improve merge conflict flow 2022-01-26 14:50:47 +11:00
Jesse Duffield 5b7dd9e43c properly resolve cyclic dependency 2022-01-22 10:48:51 +11:00
Jesse Duffield 4ab5e54139 add support for git bisect 2022-01-22 10:48:51 +11:00
Birger Skogeng Pedersen ab84410b41 check returned error (if any) from UpdateWindowTitle 2022-01-21 23:13:39 +11:00
Birger Skogeng Pedersen 62a7d9bbcc invoke title-setting shell command appropriately 2022-01-21 23:13:39 +11:00
Birger Skogeng Pedersen 555d8bbc96 set repo name as window title when loading repo, fix #1691 2022-01-21 23:13:39 +11:00
Jesse Duffield 0092c9d08d fix bug with subprocess 2022-01-16 03:32:09 +00:00
Jesse Duffield cdcfeb396f stop refreshing the screen so much 2022-01-15 14:15:41 +11:00
Jesse Duffield ee15202207 add newline after message because it looks like the message doesn't appear otherwise for some reason 2022-01-09 14:09:53 +11:00
Jesse Duffield 18f48a43d5 add some more linters 2022-01-09 14:09:53 +11:00
Jesse Duffield 364c5db19c shorten name 2022-01-09 14:09:53 +11:00
Jesse Duffield f503ff1ecb start breaking up git struct 2022-01-09 14:09:53 +11:00
Jesse Duffield 48a4565d1f remove log of error now that we're returning it normally 2022-01-07 11:01:42 +11:00
Jakob Kogler ee7a6391a8 remove redundant commit 2022-01-07 11:01:42 +11:00
Jakob Kogler 68fc6059d3 rename variable to failedCommitMessage 2022-01-07 11:01:42 +11:00
Jakob Kogler f981255a5b don't ignore error when commit with subprocess fails
If signing by GPG is enabled, the git commit command will be executed in
a subprocess, differently from when it is executed without GPG signing.
In case of an error, e.g. a failing pre-commit hook, the error needs to
be passed along, and not just ignored.
2022-01-07 11:01:42 +11:00
Jakob Kogler beedc2553d remember the message if commit fails
In case a commit fails, e.g. because a pre-commit hook returns an error,
lazygit will now remember the commit message and will suggest it during
the next commit (e.g. after fixing the error of the pre-commit hook).
2022-01-07 11:01:42 +11:00
Jesse Duffield 0d3e5e6a1d simplify fetch 2022-01-07 10:52:51 +11:00
Jesse Duffield 91fe68576c refactor 2022-01-07 10:52:51 +11:00
Jesse Duffield 192a548c99 refactoring the config struct 2022-01-04 09:07:15 +11:00
Jesse Duffield 01ea5813a8 align Gui struct with GitCommand 2022-01-04 09:07:15 +11:00
Jesse Duffield 18ab086126 introduce Common struct for passing around common stuff 2022-01-04 09:07:15 +11:00
Jesse Duffield b4c078d565 WIP 2022-01-04 09:07:15 +11:00
Jesse Duffield 18283ad41b add popup handler for easier testing 2021-12-06 22:37:28 +11:00
Jesse Duffield 9a9e3d506d more consistent rendering 2021-11-05 07:58:21 +11:00
Jesse Duffield ccd80a0e4b add menu options for log stuff 2021-11-05 07:58:21 +11:00
Jesse Duffield 37be9dbea1 support scrolling left and right 2021-11-05 07:58:21 +11:00
Jesse Duffield 802cfb1a04 render commit graph 2021-11-05 07:58:21 +11:00
Jesse Duffield 2fc1498517 some refactoring in anticipation of the graph feature 2021-11-01 10:03:49 +11:00
Jesse Duffield c47c539e12 support user-configurable author colours 2021-10-30 18:26:06 +11:00
Jesse Duffield 3eb124c732 easier hiding of command log 2021-10-23 12:54:57 +11:00
Jesse Duffield ca7252ef8e suggest files when picking a path to filter on
async fetching of suggestions

remove limit

cache the trie for future use

more

more
2021-10-19 09:02:42 +11:00
Jesse Duffield d02e52989e small changes 2021-10-16 12:22:34 +11:00
mjarkk 913a2fd065 Allow having multiple config files 2021-10-16 12:22:34 +11:00
Jesse Duffield ab0117c416 fix some encodings 2021-09-27 19:58:24 +10:00
mjarkk 79848087bc Switch to github.com/gookit/color for terminal colors 2021-07-30 15:14:46 +02:00
Davyd McColl a9f04d3925 facilitate toggling whitespace in the diff view with a hotkey (c-w by default) 2021-07-01 17:13:13 +10:00
Jesse Duffield ce7cbe58a0 naming change 2021-06-14 18:17:08 +10:00
Andrei Yangabishev 7588d5290b ShowTotal flag 2021-06-10 12:43:05 +03:00
Jesse Duffield 93bf691fd6 refactoring 2021-06-06 09:12:49 +10:00
Jesse Duffield a99e6ba071 update release notes 2021-04-20 18:34:47 +10:00
Jesse Duffield 604ee02cd9 ignore east asian width setting to avoid broken frame rendering 2021-04-19 23:06:05 +10:00
Jesse Duffield 98375dc902 refactor merge panel 2021-04-18 18:58:09 +10:00
Jesse Duffield e73de332a1 refactor line by line panel 2021-04-18 16:55:09 +10:00
Jesse Duffield 06a8eb115c make command log size configurable 2021-04-11 23:36:34 +10:00
Jesse Duffield 0bebfe454e pull out function 2021-04-11 23:36:34 +10:00
Jesse Duffield 393ce05860 allow focusing on command log view 2021-04-11 17:07:49 +10:00
Jesse Duffield 4f03d7733a allow showing, hiding, and scrolling the extras panel 2021-04-11 17:07:49 +10:00
Jesse Duffield f2007f4d95 support scrolling extras view 2021-04-11 17:07:49 +10:00
Jesse Duffield 6fbe660f96 full coverage for logging commands 2021-04-11 17:07:49 +10:00
Jesse Duffield bb918b579a start adding support for logging of commands 2021-04-11 17:07:49 +10:00
Jesse Duffield e145090046 add cmdLog panel 2021-04-11 17:07:49 +10:00
Jesse Duffield 8d416634ba update release notes 2021-04-11 10:21:53 +10:00
Jesse Duffield e092da5f78 pause background threads when running subprocess 2021-04-10 12:16:45 +10:00
Jesse Duffield e42e7e5cbd fix commit amend 2021-04-10 11:54:38 +10:00
Jesse Duffield 4f700c23ba fix crash on first open 2021-04-07 22:59:53 +10:00
Jesse Duffield 8c93289a72 reduce chance of deadlock by using a RW mutex on the context stack 2021-04-06 19:34:32 +10:00
Jesse Duffield f09309485a remove time limit 2021-04-06 19:34:32 +10:00
Jesse Duffield 7178bab6b4 only re-use repo state when jumping in and out of submodules 2021-04-06 19:34:32 +10:00
Jesse Duffield 7bc6dc5cf3 show branches context when starting in filtering mode 2021-04-06 19:34:32 +10:00
Jesse Duffield 8301bba8ad make it more likely for CI to work 2021-04-06 19:34:32 +10:00
Jesse Duffield 843b8ceab0 support tcell simulation screen 2021-04-06 19:34:32 +10:00
Jesse Duffield 6a0066253f move recording code into gocui 2021-04-06 19:34:32 +10:00
Jesse Duffield 4fe512ff3a test
type safe view access
2021-04-06 19:34:32 +10:00
Jesse Duffield 4b69ab08c1 WIP 2021-04-06 19:34:32 +10:00
Jesse Duffield 633b6f596d WIP 2021-04-06 19:34:32 +10:00
Jesse Duffield e6274c0757 remove sentinel errors 2021-04-06 19:34:32 +10:00
Jesse Duffield 0898a7bb57 refactor 2021-04-06 19:34:32 +10:00
Jesse Duffield fafd5234bd refactor to get view tab context map into gui state 2021-04-06 19:34:32 +10:00
Jesse Duffield f1d7f59e49 switching repos without restarting the gui 2021-04-06 19:34:32 +10:00
Jesse Duffield bc9a99387f refactor of contexts and filtering 2021-04-06 19:34:32 +10:00
Jesse Duffield 69e9f6d29d use suspense rather than close the gui when switching to a subprocess 2021-04-06 19:34:32 +10:00
Jesse Duffield 1fb2317bac use true output mode 2021-04-06 19:34:32 +10:00
Jesse Duffield 6a6024e38f use tcell via porting over code from awesome-gocui 2021-04-06 19:34:32 +10:00
Jesse Duffield cc9293b386 add mutex to prevent crashes with merge conflicts 2021-04-02 11:09:12 +11:00
Jesse Duffield efe43077bc fix name 2021-04-02 11:00:15 +11:00
Jesse Duffield af09223dd5 refactor 2021-04-02 11:00:15 +11:00
Jesse Duffield 7d62f103e4 big refactor to give our enums actual types 2021-04-02 11:00:15 +11:00
Jesse Duffield 9e85d37fb9 refactor to no longer call these things file changes 2021-04-02 11:00:15 +11:00
Jesse Duffield 332a3c4cbf file tree for commit files 2021-04-02 11:00:15 +11:00
Jesse Duffield e52cec9cdf small refactor 2021-03-30 21:57:00 +11:00
Jesse Duffield 1b94462410 rename some things 2021-03-30 21:57:00 +11:00
Jesse Duffield 6fc3c03c4b allow configuring to show file tree on startup 2021-03-30 21:57:00 +11:00
Jesse Duffield a31db3df9c support toggling collapsed 2021-03-30 21:57:00 +11:00
Jesse Duffield 45939171ea WIP
start moving to new interface

WIP

WIP

WIP

WIP

WIP
2021-03-30 21:57:00 +11:00
Jesse Duffield ad1468f66f better handling of discarding files 2021-03-20 12:46:27 +11:00
Jesse Duffield 043cb2ea44 reload config whenever returning to gui 2021-02-24 02:45:05 -08:00
Nick Flueckiger 6f0f70bd92 Adding setup and config 2021-02-08 14:25:24 -08:00
Jesse Duffield f31fbc10f6 soft code finding of suggestions 2020-11-28 20:48:17 +11:00
Jesse Duffield be404068ff support labels for suggestions which are distinct from values 2020-11-28 20:48:17 +11:00
Jesse Duffield da3b0bf7c8 Start on supporting auto-suggestions when checking out a branch
switch to other fuzzy package with no dependencies
2020-11-28 20:48:17 +11:00
Jesse Duffield 682db77401 fix lint errors 2020-11-18 08:36:19 +11:00
Jesse Duffield 63f6d0c036 release notes in status panel 2020-10-10 00:23:01 +11:00
Jesse Duffield 4c9ec88be5 fix mutex deadlock 2020-10-10 00:23:01 +11:00
Jesse Duffield 9011271a01 fix another panic error 2020-10-10 00:23:01 +11:00
Jesse Duffield 795e4da8b8 do not put mutexes on state else we might unlock an unlocked mutex 2020-10-10 00:23:01 +11:00
Jesse Duffield 79e59d5460 add some safe goroutines
WIP
2020-10-10 00:23:01 +11:00
Jesse Duffield 2e05ac0c90 paging keybindings for line by line panel
support searching in line by line panel

move mutexes into their own struct

add line by line panel mutex

apply LBL panel mutex

bump gocui to prevent crashing when search item count decreases
2020-10-10 00:23:01 +11:00
Jesse Duffield ece93e5eef support recording sessions for testing purposes 2020-10-10 00:23:01 +11:00
Jesse Duffield 37bb89dac3 type i18n 2020-10-10 00:23:01 +11:00
Jesse Duffield ca31e5258f store popup version in state not config so that we never need to write to the user config 2020-10-10 00:23:01 +11:00