Skip to content
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

Can the "push" button optionally be removed/disabled/hidden ? #73

Closed
MircoBabin opened this issue Jan 27, 2022 · 9 comments
Closed

Can the "push" button optionally be removed/disabled/hidden ? #73

MircoBabin opened this issue Jan 27, 2022 · 9 comments

Comments

@MircoBabin
Copy link

Question/request

Is it possible to remove/hide/disable the push button via a commandline parameter ? And if not currently possible, could such functionality please be added ?

It's ok to have the "push" functionality in the menu. Because that requires extra actions to be reached. My main concern is only the "push" button because it's so prominent in the picture.

Why

I never want to use this button anymore. Because this "push" can create a merge commit if necessary. And I want linear git history.

I'm using the rebase + merge-fast-forward-only + push-fast-forward-only strategy outside of Git Gui. But i'm using Git Gui for creating commits.

Problem

Because the "push" button is so close to the "commit" button, I frequently find myself pushing the wrong button. Of course the "push" button displays a window asking for confirmation. And I can cancel that then. But on a bad day in a hurry, I don't read and just push go ahead. Resulting in the merge commit I did not want.

Screenshot

image

P.S. I'm using Microsoft Windows.

@snaewe
Copy link
Contributor

snaewe commented Jan 27, 2022

How can a 'push' create a merge commit? Only a 'pull' could do that.

@MircoBabin
Copy link
Author

I don't know when a merge commit exactly is created. Perhaps it's the server part at Bitbucket, I don't know.

I just want to get rid of the "push" button.

@gitster
Copy link
Contributor

gitster commented Jan 27, 2022

If "the server part at Bitbucket" is what creates an unwanted merge when receiving a non-fast-forward push, then I am not sure how your push-fast-forward-only strategy even works "outside of Git Gui".

I am a total newbie when it comes to git-gui (never used it for any serious work), but looking at its code, unless you allow "Force", it shouldn't allow pushing something that is not fast-forward (which hopefully would avoid letting the server side create a merge commit).

@MircoBabin
Copy link
Author

@gitster:

  1. I have specifically created a side project GitNoob https://github.com/MircoBabin/GitNoob to ensure only fast-forward-push.

  2. My request is about hiding the push button (only the button on the main screen). Not about changing/exploring/fixing git push or something like that.

Because I'm using GitNoob I never want to use the PUSH button again. But as said, the PUSH button is so close to the COMMIT button that accidentes happen. It is to easy to click the wrong button, they are only 10 pixels or so away from each other.

@bbolli
Copy link
Contributor

bbolli commented Jan 28, 2022

I usually just press Ctrl+Enter to commit and don't use the buttons at all, so I also can't miss it. ;-)

@PhilipOakley
Copy link

You could clone the git gui repo and make the [suggestable] changes yourself, and then, once proven as satisfactory, use GitHub's gui to provide a PR.

The git-gui already uses the git config system with it's own private keys, so you could add an extra key, possibly for the GitNoob system, that would allow git-gui to show/not show the Push button based on the extra git-gui flag, which could be set from GitNoob.. ? It is open source.

That said, the opinionated Git and the opinionated GitNoob may have different mental models that can't be resolved that easily. A PR would help clarify.

@MircoBabin
Copy link
Author

@PhilipOakley:

I created a pull request, see #74

@surjikal
Copy link

surjikal commented Jun 28, 2022

For what it's worth, I've never used the push button, I don't need it, and I've merged your PR in my personal git-gui fork :)

@MircoBabin
Copy link
Author

I'm closing this. It's been a year. No results or useful comments. This was a waste of my time and energy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants