jesseduffield.lazygit/pkg/gui/controllers
Stefan Haller 81b497d186 Don't ask to force-push if the remote rejected updates
Lazygit has two ways to decide whether it needs to ask the user to force-push:
1. if it knows ahead of time that the push will fail because the branch has
diverged, by looking at the incoming/outgoing information that it shows as ↑3↓7.
2. by examining the error that comes back when the push has failed.

The second situation should happen only rarely, because lazygit fetches every
minute by default, so the ↑3↓7 information is usually up to date. It might not
be if the user turned off auto-fetch (or increased the auto-fetch interval).
However, in this case it's almost always harmful to prompt the user to
force-push, because we know that the reason for diverging is that something was
pushed to the remote, and we would wipe it out by force-pushing. In such a
situation, the more likely user action is to pull the remote changes and then
push normally again.

So just remove the second prompt, and replace it by a better error message when
we detect that updates were rejected remotely.

A little bit of history archeology reveals that the second prompt was added at a
time where we didn't have the first one yet, so at that time it made sense to
have it; but when the first prompt was added, we should have removed the second.
2024-03-17 07:38:58 +01:00
..
helpers Add commit menu entry "Add co-author" 2024-03-11 09:18:55 +01:00
attach.go Begin refactoring gui 2023-04-30 13:19:52 +10:00
base_controller.go Begin refactoring gui 2023-04-30 13:19:52 +10:00
basic_commits_controller.go Disallow cherry-picking merge commits 2024-02-10 11:27:28 +01:00
bisect_controller.go Set groundwork for better disabled reasons with range select 2024-01-23 13:03:37 +11:00
branches_controller.go Display more keybindings on-screen 2024-01-28 08:33:13 +11:00
command_log_controller.go Enforce single-item selection in various actions 2024-01-19 10:50:49 +11:00
commit_description_controller.go Add a commit menu to the commit message panel 2024-03-11 09:18:40 +01:00
commit_message_controller.go Add a commit menu to the commit message panel 2024-03-11 09:18:40 +01:00
commits_files_controller.go Fix range select bug 2024-02-13 09:10:15 -06:00
common.go lots of changes 2023-04-30 13:19:53 +10:00
confirmation_controller.go Show mode-specific keybinding suggestions 2024-01-28 08:33:13 +11:00
context_lines_controller.go Improve keybinding descriptions 2024-01-28 08:12:01 +11:00
custom_command_action.go Fix order problems when saving custom commands history 2024-02-16 13:31:37 +01:00
custom_patch_options_menu_action.go Improve keybinding descriptions 2024-01-28 08:12:01 +11:00
diffing_menu_action.go fix: typo EnteRefName 2023-06-28 18:54:21 +06:00
files_controller.go Display more keybindings on-screen 2024-01-28 08:33:13 +11:00
filter_controller.go Introduce filtered list view model 2023-07-03 12:54:13 +10:00
filtering_menu_action.go Add author filtering to commit view 2024-02-21 09:58:09 +01:00
git_flow_controller.go Set groundwork for better disabled reasons with range select 2024-01-23 13:03:37 +11:00
global_controller.go Show mode-specific keybinding suggestions 2024-01-28 08:33:13 +11:00
jump_to_side_window_controller.go Enforce single-item selection in various actions 2024-01-19 10:50:49 +11:00
list_controller.go Disable range-select in menu and suggestions view 2024-01-19 10:50:49 +11:00
list_controller_trait.go Set groundwork for better disabled reasons with range select 2024-01-23 13:03:37 +11:00
local_commits_controller.go Allow deleting update-ref todos 2024-03-16 22:01:13 +01:00
local_commits_controller_test.go Keep the same line selected after squashing fixup commits 2024-03-09 07:55:22 +01:00
menu_controller.go Show mode-specific keybinding suggestions 2024-01-28 08:33:13 +11:00
merge_conflicts_controller.go Display more keybindings on-screen 2024-01-28 08:33:13 +11:00
options_menu_action.go Do not include keybindings from another view in keybindings menu 2024-01-15 20:08:11 +11:00
patch_building_controller.go Display more keybindings on-screen 2024-01-28 08:33:13 +11:00
patch_explorer_controller.go Display more keybindings on-screen 2024-01-28 08:33:13 +11:00
quit_actions.go Clear range select upon pressing 'escape' 2024-01-19 10:47:21 +11:00
reflog_commits_controller.go Set groundwork for better disabled reasons with range select 2024-01-23 13:03:37 +11:00
remote_branches_controller.go Display more keybindings on-screen 2024-01-28 08:33:13 +11:00
remotes_controller.go Display more keybindings on-screen 2024-01-28 08:33:13 +11:00
screen_mode_actions.go Remove special code to rerender views on screen mode change 2023-10-16 09:03:07 +02:00
scroll_off_margin.go Add scrollOffEnabled config 2023-08-21 09:03:45 +02:00
scroll_off_margin_test.go Add tests for scroll-off margin of zero 2023-08-21 08:10:28 +02:00
search_controller.go Introduce filtered list view model 2023-07-03 12:54:13 +10:00
search_prompt_controller.go Enforce single-item selection in various actions 2024-01-19 10:50:49 +11:00
side_window_controller.go Enforce single-item selection in various actions 2024-01-19 10:50:49 +11:00
snake_controller.go Enforce single-item selection in various actions 2024-01-19 10:50:49 +11:00
staging_controller.go Make ctrl-f available in staging view 2024-03-02 10:12:03 +01:00
stash_controller.go Display more keybindings on-screen 2024-01-28 08:33:13 +11:00
status_controller.go Display more keybindings on-screen 2024-01-28 08:33:13 +11:00
sub_commits_controller.go Set groundwork for better disabled reasons with range select 2024-01-23 13:03:37 +11:00
submodules_controller.go Show all submodules recursively 2024-03-07 20:16:28 +01:00
suggestions_controller.go Set groundwork for better disabled reasons with range select 2024-01-23 13:03:37 +11:00
switch_to_diff_files_controller.go Avoid crash when hitting enter on an update-ref todo 2024-02-16 13:06:24 +01:00
switch_to_sub_commits_controller.go Set groundwork for better disabled reasons with range select 2024-01-23 13:03:37 +11:00
sync_controller.go Don't ask to force-push if the remote rejected updates 2024-03-17 07:38:58 +01:00
tags_controller.go Display more keybindings on-screen 2024-01-28 08:33:13 +11:00
toggle_whitespace_action.go Extract a SaveAppStateAndLogError function 2023-09-04 17:50:49 +02:00
types.go introduce Ref interface 2022-04-02 17:04:42 +11:00
undo_controller.go Enforce single-item selection in various actions 2024-01-19 10:50:49 +11:00
vertical_scroll_controller.go lots of changes 2023-04-30 13:19:53 +10:00
workspace_reset_controller.go Reset origin when clearing view 2023-08-08 22:01:43 +10:00
worktree_options_controller.go Set groundwork for better disabled reasons with range select 2024-01-23 13:03:37 +11:00
worktrees_controller.go Display more keybindings on-screen 2024-01-28 08:33:13 +11:00