prati0100 / git-gui

Tcl/Tk based UI for Git. I am currently acting as the project's maintainer.
160 stars 87 forks source link

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

Closed MircoBabin closed 1 year ago

MircoBabin commented 2 years ago

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 commented 2 years ago

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

MircoBabin commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

@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 commented 2 years ago

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

PhilipOakley commented 2 years ago

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 commented 2 years ago

@PhilipOakley:

I created a pull request, see https://github.com/prati0100/git-gui/pull/74

surjikal commented 2 years ago

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 commented 1 year ago

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