mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-12 00:26:24 -04:00
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. |
||
|---|---|---|
| .. | ||
| helpers | ||
| attach.go | ||
| base_controller.go | ||
| basic_commits_controller.go | ||
| bisect_controller.go | ||
| branches_controller.go | ||
| command_log_controller.go | ||
| commit_description_controller.go | ||
| commit_message_controller.go | ||
| commits_files_controller.go | ||
| common.go | ||
| confirmation_controller.go | ||
| context_lines_controller.go | ||
| custom_command_action.go | ||
| custom_patch_options_menu_action.go | ||
| diffing_menu_action.go | ||
| files_controller.go | ||
| filter_controller.go | ||
| filtering_menu_action.go | ||
| git_flow_controller.go | ||
| global_controller.go | ||
| jump_to_side_window_controller.go | ||
| list_controller.go | ||
| list_controller_trait.go | ||
| local_commits_controller.go | ||
| local_commits_controller_test.go | ||
| menu_controller.go | ||
| merge_conflicts_controller.go | ||
| options_menu_action.go | ||
| patch_building_controller.go | ||
| patch_explorer_controller.go | ||
| quit_actions.go | ||
| reflog_commits_controller.go | ||
| remote_branches_controller.go | ||
| remotes_controller.go | ||
| screen_mode_actions.go | ||
| scroll_off_margin.go | ||
| scroll_off_margin_test.go | ||
| search_controller.go | ||
| search_prompt_controller.go | ||
| side_window_controller.go | ||
| snake_controller.go | ||
| staging_controller.go | ||
| stash_controller.go | ||
| status_controller.go | ||
| sub_commits_controller.go | ||
| submodules_controller.go | ||
| suggestions_controller.go | ||
| switch_to_diff_files_controller.go | ||
| switch_to_sub_commits_controller.go | ||
| sync_controller.go | ||
| tags_controller.go | ||
| toggle_whitespace_action.go | ||
| types.go | ||
| undo_controller.go | ||
| vertical_scroll_controller.go | ||
| workspace_reset_controller.go | ||
| worktree_options_controller.go | ||
| worktrees_controller.go | ||