lazygit/pkg/gui/controllers
Stefan Haller 649a8b7276 Improve editing a commit
In 67b8ef449c we changed the "edit" command to insert a "break" after the
selected commit, rather than setting the selected todo to "edit". The reason for
doing this was that it now works for merge commits too.

Back then, I claimed "In most cases the behavior is exactly the same as before."
Unfortunately that's not true, there are two reasons why the previous behavior
was better (both are demonstrated by tests earlier in this branch):
- when editing the last commit of a branch in the middle of a stack of branches,
  we are now missing the update-ref todo after it, which means that amending the
  commit breaks the stack
- it breaks auto-amending (see the added test earlier in this branch for an
  explanation)

For these reasons, we are going back to the previous approach of setting the
selected commit to "edit" whenever possible, i.e. unless it's a merge commit.

The only scenario where this could still be a problem is when you have a stack
of branches, and the last commit of one of the branches in the stack is a merge
commit, and you try to edit that. In my experience with stacked branches this is
very unlikely, in almost all cases my stacked branches are linear.
2024-11-29 18:29:47 +01:00
..
helpers pkg/gui: Allow user to select remote and branch when creating a PR 2024-11-23 11:52:21 +11:00
attach.go
base_controller.go Remove return value of Focus-related functions 2024-09-06 08:45:48 +02:00
basic_commits_controller.go Remove return value of Alert/Confirm/Prompt 2024-09-06 08:45:48 +02:00
bisect_controller.go Remove return value of Alert/Confirm/Prompt 2024-09-06 08:45:48 +02:00
branches_controller.go pkg/gui: Allow user to select remote and branch when creating a PR 2024-11-23 11:52:21 +11:00
command_log_controller.go Remove return value of Focus-related functions 2024-09-06 08:45:48 +02:00
commit_description_controller.go Remove return value of IContextMgr.Push/Pop et. al. 2024-09-06 08:45:48 +02:00
commit_message_controller.go Remove return value of IContextMgr.Push/Pop et. al. 2024-09-06 08:45:48 +02:00
commits_files_controller.go Get rid of error return value of PostRefreshUpdate and a few related ones 2024-10-13 16:55:54 +02:00
common.go
confirmation_controller.go Remove return value of IContextMgr.Push/Pop et. al. 2024-09-06 08:45:48 +02:00
context_lines_controller.go use an unsigned_64 for DiffContextSize and add saturated add/subtract 2024-11-19 08:21:19 +11:00
custom_patch_options_menu_action.go Remove return value of OpenCommitMessagePanel 2024-09-06 08:45:48 +02:00
diffing_menu_action.go Remove return value of Alert/Confirm/Prompt 2024-09-06 08:45:48 +02:00
files_controller.go Add new filter to only show tracked files in Files panel 2024-11-12 16:54:24 +11:00
filter_controller.go
filtering_menu_action.go Remove return value of Alert/Confirm/Prompt 2024-09-06 08:45:48 +02:00
git_flow_controller.go Remove return value of Alert/Confirm/Prompt 2024-09-06 08:45:48 +02:00
global_controller.go Rename "Custom Command" to "Shell Command" 2024-08-17 10:56:03 +02:00
jump_to_side_window_controller.go Add config option to disable tab switching with jump keys 2024-11-09 17:19:14 +11:00
list_controller.go Remove return value of IContextMgr.Push/Pop et. al. 2024-09-06 08:45:48 +02:00
list_controller_trait.go
local_commits_controller.go Improve editing a commit 2024-11-29 18:29:47 +01:00
local_commits_controller_test.go
menu_controller.go Remove return value of IContextMgr.Push/Pop et. al. 2024-09-06 08:45:48 +02:00
merge_conflicts_controller.go Remove return value of IContextMgr.Push/Pop et. al. 2024-09-06 08:45:48 +02:00
options_menu_action.go Replace CurrentContext() with Context().Current() 2024-08-17 11:14:51 +02:00
patch_building_controller.go Get rid of error return value of PostRefreshUpdate and a few related ones 2024-10-13 16:55:54 +02:00
patch_explorer_controller.go Cleanup: remove isFocused parameter from GetContentToRender and related methods 2024-10-18 22:46:48 +02:00
quit_actions.go Get rid of error return value of PostRefreshUpdate and a few related ones 2024-10-13 16:55:54 +02:00
reflog_commits_controller.go Remove return value of RenderToMainViews and some related functions 2024-09-06 08:45:48 +02:00
remote_branches_controller.go Remove return value of Alert/Confirm/Prompt 2024-09-06 08:45:48 +02:00
remotes_controller.go Get rid of error return value of PostRefreshUpdate and a few related ones 2024-10-13 16:55:54 +02:00
rename_similarity_threshold_controller.go Remove return value of RenderToMainViews and some related functions 2024-09-06 08:45:48 +02:00
screen_mode_actions.go Remove return value of HandleRender 2024-09-06 08:45:48 +02:00
scroll_off_margin.go
scroll_off_margin_test.go
search_controller.go
search_prompt_controller.go
shell_command_action.go Remove return value of Alert/Confirm/Prompt 2024-09-06 08:45:48 +02:00
side_window_controller.go Remove return value of IContextMgr.Push/Pop et. al. 2024-09-06 08:45:48 +02:00
snake_controller.go Remove return value of IContextMgr.Push/Pop et. al. 2024-09-06 08:45:48 +02:00
staging_controller.go Don't render staging view when it loses focus 2024-10-18 22:46:47 +02:00
stash_controller.go Add options for disabling switching to the Files panel after popping or applying a stash 2024-09-15 11:59:59 +02:00
status_controller.go Use AutoRenderHyperLinks in main views 2024-09-28 12:04:51 +02:00
sub_commits_controller.go Remove return value of Focus-related functions 2024-09-06 08:45:48 +02:00
submodules_controller.go Remove return value of Alert/Confirm/Prompt 2024-09-06 08:45:48 +02:00
suggestions_controller.go Remove return value of IContextMgr.Push/Pop et. al. 2024-09-06 08:45:48 +02:00
switch_to_diff_files_controller.go Remove return value of IContextMgr.Push/Pop et. al. 2024-09-06 08:45:48 +02:00
switch_to_sub_commits_controller.go
sync_controller.go Remove return value of Alert/Confirm/Prompt 2024-09-06 08:45:48 +02:00
tags_controller.go Remove return value of Alert/Confirm/Prompt 2024-09-06 08:45:48 +02:00
toggle_whitespace_action.go Remove return value of Focus-related functions 2024-09-06 08:45:48 +02:00
undo_controller.go Remove return value of Alert/Confirm/Prompt 2024-09-06 08:45:48 +02:00
vertical_scroll_controller.go Change direct access to Common.UserConfig to a getter 2024-08-18 10:24:52 +02:00
workspace_reset_controller.go Get rid of error return value of PostRefreshUpdate and a few related ones 2024-10-13 16:55:54 +02:00
worktree_options_controller.go
worktrees_controller.go Remove return value of RenderToMainViews and some related functions 2024-09-06 08:45:48 +02:00