Repository navigation
Description
A big theme of the past year of our work on Desktop has been working to make collaboration easier. A big part of that, and something we're still iterating on, is supporting merging work from one branch to another. However, in hearing from our users and talking to folks in the wild, we know that many workflows either require or benefit from rebasing as opposed to merging. Therefore, we'd like to make this possible in Desktop.
There are two primary problem areas we want to focus on.
-
This is the problem described in Option to rebase instead of automatically merge when pulling from upstream #3422: When I pull in Desktop, I don't want it to create a merge commit because it clutters my commit history and makes it harder to quickly discern "real" commits.
-
I'm required to (or prefer to) rebase when bringing code from one branch to another branch, and Desktop does not allow me to do this. (described in Feature request: rebase #1652)
2a. Merging brings together branches in one fell swoop, and I can't tell what code was written when chronologically.
Considerations for problem 1:
- Is this an optional selection that exists in preferences? Is there some other way to choose to rebase when pulling as opposed to pulling normally?
- What happens if there's a conflict / multiple conflicts during the pull?
Considerations for problem 2:
- How do you enter the rebase experience?
- How do we show people what commits are going to be rebased so they have comfort around what's going to happen?
- How does it work when you run into a conflict / multiple conflicts throughout the rebase?
- How do you know when you're done?
Note: We're considering interactive rebasing as out of scope for this initial iteration, and may be something we look at further along.
Next steps:
- Design prototype
- Usability testing of prototype
- Take feedback to produce designs and share
- Build and release initial iteration
Activity
billygriffin commentedon Nov 7, 2018
A couple updates on this based on initial usability testing and internal discussion with @shiftkey, @ampinsk, and me:
We discussed the concept of force pushing after a rebase, as we are rewriting history in a rebase operation and therefore the local commits will sometimes differ from the remote commits. There are a couple scenarios where this will likely need to happen, and we want to be sure to make sure people understand this before rebasing:
We also discussed the concept of "Undo," and decided that our existing behavior is still appropriate after a rebase where we're allowing the last commit to be undone but only if it's a local commit and not yet on the remote.
We also discussed the concept of git pull --rebase if there are uncommitted changes. We decided that initially we'll handle this in the same way we handle
git pullcurrently, but that there's potentially room to think about this in more detail in Improve workflows with uncommitted changes #6107. I'll update that issue with further detail.ampinsk commentedon Nov 9, 2018
Designs
Here's where we've landed so far after a quick round of usability testing!
Problem 1: Pulling with rebase
When a user has rebase set in their config, the "Pull" button will update to "Pull with rebase".
No conflicts
With no conflicts, the pull would behave as normally
With conflicts
With conflicts, we'll introduce the conflict resolution modal with updated language for this use case
Problem 2: Rebase with another branch
Branch > Rebase Current Branch....No conflicts
With conflicts
sbonami commentedon Nov 14, 2018
While not directly related to inter-branch rebasing described above, the fixup/amend (#1644) feature request may be a great addition to the larger rebase workflows being considered.
At the very least, could we consider re-opening that issue as part of the larger re-prioritization of the milestone? (I'd be happy to discuss over there, it wasn't clear if this was the right place or if rebasing workflows were intentionally more succinct; no thread-hijacking intended!)
billygriffin commentedon Nov 14, 2018
@sbonami Thanks for the courtesy, I didn't at all take it as thread hijacking. We're going to consider that separately, but having the underpinnings of rebasing in place certainly would make that easier to tackle looking forward.
Our primary goal here is to provide support for folks who either cannot (because their org mandates a rebase workflow) or choose not to use the default merge workflow, especially when pulling. I totally agree that it's reasonable to consider providing the ability to amend previous commits outside of the ability to "Undo" local commits that exists today, and we're slowly working our way through the future proposals, so we'll definitely be getting to that one and figuring out where it lies on prioritization. Thanks again for the feedback.
EwoutH commentedon Jan 21, 2019
@ampinsk Looks amazing, when do you think it will be landed?
billygriffin commentedon Jan 22, 2019
Hi @EwoutH, thanks for the feedback! We're looking to ship at least the first portion of this in 1.6.3, likely next month. We'll likely ship that (pull --rebase support) on its own to make sure we understand fully the implications, and then ship explicitly rebasing one branch onto another later.
ampinsk commentedon Jan 22, 2019
The v1 of this is going to encompass pull with rebase. Here's a prototype for how that would go if you ran into conflicts, then needed to force push:
cc @shiftkey
shiftkey commentedon Feb 27, 2019
@billygriffin there's one outstanding task in this issue body:
If you think the scope of
1.7.0covers what we're planning to ship can we close this out?billygriffin commentedon Feb 27, 2019
If you're ok with it @shiftkey, I'd love to keep this as the tracking issue for the broader set of work that's set to ship in
1.7.0, and it'll be closed then?