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

6505 Commits

Author SHA1 Message Date
2cba98e3fe move another action into controller 2023-04-30 13:19:53 +10:00
f8c9ce33c2 move more actions into controller 2023-04-30 13:19:53 +10:00
71753770ad move custom patch options menu action to controllers package 2023-04-30 13:19:53 +10:00
820b1e811d move custom command action into its own file 2023-04-30 13:19:53 +10:00
4a33fede7b move window arrangement helper 2023-04-30 13:19:53 +10:00
db12853bbe lots of changes 2023-04-30 13:19:53 +10:00
711674f6cd standardise controller helper methods 2023-04-30 13:19:53 +10:00
fc91ef6a59 standardise helper args 2023-04-30 13:19:53 +10:00
43251e7275 split context common from helper common 2023-04-30 13:19:53 +10:00
f081358943 move getDisplayStrings funcs into contexts 2023-04-30 13:19:53 +10:00
0c6ab4b43e refactor cherry pick code to move state access out of helper 2023-04-30 13:19:53 +10:00
1b2fb34ffd start moving getDisplayStrings funcs into contexts 2023-04-30 13:19:53 +10:00
0e5a4c7a36 move getModel functions into contexts 2023-04-30 13:19:53 +10:00
47b91f1ef5 move views into contexts 2023-04-30 13:19:53 +10:00
e2db6a1732 remove context callback opts 2023-04-30 13:19:53 +10:00
509e3efa70 lots more refactoring 2023-04-30 13:19:53 +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
3ec416047f Updated README.md 2023-04-30 02:22:54 +00:00
8ed29f2b7d Merge pull request #2390 from seand52/revamp-commit-message 2023-04-30 12:22:42 +10:00
9adbef40de Refresh staging panel when committing
We now refresh the staging panel when doing an unscoped refresh, so that if we commit from the staging panel we escape
back to the files panel if need be. But that causes flickering when doing an unscoped refresh from other contexts,
because the refreshStagingPanel function assumes that the staging panel has focus. So we're adding a guard at the top
of that function to early exit if we don't have focus.
2023-04-30 12:17:34 +10:00
0cd5257523 Retain commit message when cycling history
When cycling history, we want to make it so that upon returning to the original prompt, you get your text back.
Importantly, we don't want to use the existing preservedMessage field for that because that's only for preserving
a NEW commit message, and we don't want the history stuff of the commit reword flow to overwrite that.
2023-04-30 12:17:34 +10:00
49da7b482d Split commit message panel into commit summary and commit description panel
When we use the one panel for the entire commit message, its tricky to have a keybinding both for adding a newline and submitting.
By having two panels: one for the summary line and one for the description, we allow for 'enter' to submit the message when done from the summary panel,
and 'enter' to add a newline when done from the description panel. Alt-enter, for those who can use that key combo, also works for submitting the message
from the description panel. For those who can't use that key combo, and don't want to remap the keybinding, they can hit tab to go back to the summary panel
and then 'enter' to submit the message.

We have some awkwardness in that both contexts (i.e. panels) need to appear and disappear in tandem and we don't have a great way of handling that concept,
so we just push both contexts one after the other, and likewise remove both contexts when we escape.
2023-04-30 12:17:34 +10:00
d675117289 Fix activation of initial context
This broke with 40f6767cfc77; the symptom is that starting lazygit with a git
arg (e.g. "lazygit log") wouldn't activate the requested panel correctly. While
it would show in the expanded view, it didn't have a green frame, and keyboard
events would go to the files panel.
2023-04-29 07:37:44 +02:00
e63858215e refactor moveFixupCommitDown 2023-04-29 07:28:33 +02:00
3fe4db9316 Make RebaseCommands.AmendTo more robust
This fixes two problems with the "amend commit with staged changes" command:

1. Amending to a fixup commit didn't work (this would create a commmit with the
   title "fixup! fixup! original title" and keep that at the top of the branch)
2. Unrelated fixup commits would be squashed too.

The added integration test verifies that both of these problems are fixed.
2023-04-29 07:28:33 +02:00
185bbf0c75 Refactor to tighten interface to lazygit daemon 2023-04-29 07:28:33 +02:00
a8586ba57e Refactor: simplify PrepareInteractiveRebaseCommand API
Instead of passing a bunch of different options in
PrepareInteractiveRebaseCommandOpts, where it was unclear how they interact if
several are set, have only a single field "instruction" which can be set to one
of various different instructions.

The functionality of replacing the entire todo file with our own is no longer
available; it is only possible to prepend todos to the existing file.

Also, instead of using different env vars for the various rebase operations that
we want to tell the daemon to do, use a single one that contains a json-encoded
struct with all available instructions. This makes the protocol much clearer,
and makes it easier to extend in the future.
2023-04-29 07:28:33 +02:00
dad7a70bf8 Implement moving commits up/down in terms of daemon 2023-04-29 07:28:33 +02:00
3791f0b2fa Implement "move patch to selected commit" in terms of daemon 2023-04-29 07:28:33 +02:00
b8fbe9756e Implement squash, fixup, drop, and reword in terms of daemon 2023-04-29 07:28:33 +02:00
ab25600ccb Extract EditRebaseTodo into a function in utils.rebaseTodo
We want to reuse it from the daemon code in the next commit.
2023-04-29 07:28:33 +02:00
d50c58b4c6 Implement "edit commit" in terms of the new EditRebase function 2023-04-29 07:28:33 +02:00
5645a662de Use --rebase-merges for interactive rebase
At the moment it doesn't make a big difference, because the vast majority of
callers create a list of todos themselves to completely replace what git came up
with. We're changing this in the following commits though, and then it's helpful
to preserve merges.
2023-04-29 07:28:33 +02:00
a41218551d Put gitCommon.version back in deps_test.go
This was reverted in 3546ab8f21, but shouldn't have.
2023-04-29 07:28:33 +02:00
d210107caa Bump github.com/fsmiamoto/git-todo-parser to latest version 2023-04-29 07:28:33 +02:00
826128a8e0 Merge pull request #2578 from jesseduffield/enforce-lowercase-filenames 2023-04-29 13:08:06 +10:00
aec46942a8 enforce lowercase filenames 2023-04-29 13:05:05 +10:00
aa70723e3a Merge pull request #2558 from stefanhaller/allow-resetting-author-during-rebase 2023-04-29 12:44:14 +10:00
7db54a948a Merge pull request #2548 from AKARSHITJOSHI/fix/tagPush 2023-04-29 12:43:55 +10:00
32556480da Updated README.md 2023-04-29 02:39:27 +00:00
2553015029 Merge pull request #2577 from jbrains/add-editor-preset-for-kakoune 2023-04-29 12:39:10 +10:00
6c010a788c Add an editor preset for kakoune (kakoune.org). 2023-04-27 13:41:54 -03:00
b17c38befd Merge pull request #2567 from jesseduffield/bump-clipboard-package 2023-04-24 13:42:18 +10:00
79dc1d9052 Merge pull request #2557 from noahziheng/feature/add-gitea-pr 2023-04-24 13:42:05 +10:00
28d2b1432b Updated README.md 2023-04-24 03:37:27 +00:00
ed98e11fa0 Merge pull request #2555 from Ryooooooga/revert-force-if-includes 2023-04-24 13:37:14 +10:00
07a22e69e7 bump clipboard package for WSL support 2023-04-24 13:33:27 +10:00
bf3dd79b7a feat: add gitea to hosting service 2023-04-18 16:16:09 +00:00
21072226d2 Don't allow resetting non-HEAD commits (including rebase todos) during rebase 2023-04-18 17:34:07 +02:00
b09000194a Allow resetting author of HEAD commit during rebase 2023-04-18 17:33:33 +02:00