Skip to content

Enable fetching and force-pushing more easily - #15494

Closed
sergiou87 wants to merge 3 commits into
developmentfrom
force-push-and-fetch
Closed

sergiou87 wants to merge 3 commits into
developmentfrom
force-push-and-fetch

Conversation

@sergiou87

Copy link
Copy Markdown
Member

Closes #15211
Closes #7805

Description

This PR makes two changes:

  1. Adds a Fetch item to the Repository menu, so users can fetch at any time. This is useful if you're in a state where the Fetch button has been replaced by the Pull or Push button but you still need to fetch. For example, if you have a branch that hasn't been pushed yet, you want to rebase it on top of another branch that doesn't exist or that is not updated with its upstream. NOTE: This option might go away since I implemented it on a whim, without discussing it with the team, after needing it a few times in the past.
  2. Changes the logic of the Force push item under the Repository menu, to always show up when the current branch has diverged from its upstream. The rest of places where we usually suggest to force-push will keep the existing behavior: they will only show Force push when GitHub Desktop knows the branch diverged after the user performed an operation that is usually followed by a force-push (like a rebase or amending an already pushed commit).

I'm still considering "hiding" a Force push state in the pull/push/fetch button, when its state is Pull with ahead and behind commits (i.e. in a diverged branch). Maybe pressing Alt (or Option on macOS) while hovering the pull/push/fetch button in that state 🤔

Screenshots

Screen.Recording.2022-10-20.at.18.20.59.mov

Release notes

Notes: [Improved] Add new menu option for fetching at any time, and allow force-pushing diverged branches from menu

@tidy-dev

Copy link
Copy Markdown
Contributor

Maybe pressing Alt (or Option on macOS) while hovering the pull/push/fetch button in that state

Just 2 cents with what I have been learning from accessibility. We wouldn't want to hide functionality behind a hover state; tho, I maybe it is ok given there is an alternate path -> the main menu/keyboard shortcut. However, maybe if there is a way to have a visible control while there is a divergent state that would be more ideal -> like I think there was talk of it being a dropdown button? And not solely from an accessibility stand point, it would be more discoverable too.

@anafebacus

This comment was marked as spam.

@sergiou87

sergiou87 commented Oct 21, 2022 •

Copy link
Copy Markdown
Member Author

Yes, I was counting on that being just an extra "mouse-based shortcut", and the accessibility would come from the menu item and its keyboard shortcut, exactly where it's always been (but now available more frequently) so the force push feature is not hidden.

I think the Option + something else is a common pattern in Apple's apps for these kinds of "mouse-based shortcuts", hence why I was suggesting it.

The dropdown sounds great in terms of accessibility and discoverability, if we find a nice way of fitting that behavior in the UI 🤔

@tidy-dev

Copy link
Copy Markdown
Contributor

exactly where it's always been

Touch back to discoverability. I had no idea it was there till this PR. :D I always used the force push option in the interface.

@sergiou87

Copy link
Copy Markdown
Member Author

Just went ahead and did the Option thing to switch between the Pull and Force push for diverged branches. It works even when the mouse is not on the button.

Screen.Recording.2022-10-23.at.23.13.05.mov

@sergiou87

sergiou87 commented Oct 25, 2022 •

Copy link
Copy Markdown
Member Author

Superseded by #15520 and #15521

We'll explore other options to make this new force-push (or even the fetch) available from the push-pull-fetch button (e.g. turning it into a dropdown)

@sergiou87 sergiou87 closed this Oct 25, 2022
@sergiou87
sergiou87 deleted the force-push-and-fetch branch December 18, 2024 11:15
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

Successfully merging this pull request may close these issues.

Add a "Force Push" menu item I don't seem to have a way to force a fetch

3 participants