-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make the force push confirmation button configurable #2009
Comments
Yes please! Force pushing is way too easy to do accidentally with potentially dire consequences. |
Maybe this should be a separate discussion but putting it here since it's related to "push safety": I think |
Ah, another one claiming this. No it's not. See the discussion starting here.
Which isn't worth anything, because lazygit fetches in the background (by default), which means you will fetch your co-worker's commits without realizing it, and You want |
@James-Firth for the record, not everybody agrees with Stefen, for example see video of Scott Chancon I linked here. Lazygit already uses |
I don't see how Scott Chancon is disagreeing with @stefanhaller is saying. It's not that --force-with-lease is never useful, it just simply forces you to be up-to-date with your fetch before you are allowed to force push . Since lazygit is always fetching in the background and keeping your remote heads up-to-date, --force-with-lease adds little or no value in this particular case since your remote tracking branches will always be-up-to-date, and hence like @stefanhaller said, will in almost all cases happily let you blow away the remote changes on a force. |
Thank you for this. Well this is much more palatable, Stefen wrote:
When Stefen was talking about "Many people in the git community" it did not sound like he had this particular case in mind. It sounded more, like he thought that |
@stefanhaller I just started using lazygit about a week ago (it seems great!) so I didn't know it auto-fetched when I suggested that flag. I don't believe my personal VS Code or Sublime Merge settings have that so in those cases it works well for me. I also didn't know about @AndrewSav I'll have to give that a watch, thanks for the link! @AndrewSav apologies for hijacking the Issue, I was trying to not bloat the Issue log. @stefanhaller Feel free to mark my posts as Off-Topic so it doesn't clutter this any more. |
Of note, Stefan's guidance re: Likewise, the docs mention that
So despite attempts to put guard rails around |
Yes, the docs have a lengthy section about background fetches. That's good, but background fetches are not the only problem with
I am pretty convinced that most average git users will not be aware of these subtleties, and will just use
Ah, thanks for reminding me of this. Turns out I was wrong here again, apologies for that: I wrongly thought that And before somebody asks why lazygit doesn't use |
Is your feature request related to a problem? Please describe.
Force pushing is a destructive operation. Currently the
enter
is used to confirm it. I've force pushed with lazygit on accident before, when I was going too fast or was clumsy.Describe the solution you'd like
The consequences of mistakenly force pushing (e.g. if the user did not carefully read the dialog) could be dire, while the consequences of cancelling are mild, therefore it would be nice if we could configure the confirmation button to something unusual to our liking, e.g. the
f
key.Describe alternatives you've considered
An easier to implement option would be simply changing the hardcoded
enter
button to another hardcoded button, but that would be backward incompatible and could upset some people.Additional context
Converted from discussions.
The text was updated successfully, but these errors were encountered: