You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When working on a local branch, I should be able to get a clear understanding of the commits I've made and how that compares to master or any other target branch. I can understand how I've diverged from a branch and, if I'm behind that branch by any number of commits, I can pull that branch's commits into my branch.
notifications around diverging from master branch and proactively detecting merge conflicts is in a later release
Design time! 😄 Here are a couple problems we are aiming to solve with comparing between two branches:
There currently isn't a way to see how far we've diverged from a branch. As a result, it's easy for our working branch to diverge from a default branch (such as master) over time.
There's no easy to see what kind of changes are about to be brought in. This also adds to the difficulty of not being able to see if there are any overlapping work.
started off with a version where I played around with a graph/timeline/subway map visualization to show which commits existed on which branch. The goal at the time was to be able to visualize the result of a merge (as well as understand which specific commits would be brought in:
After some discussion, we've agreed on some of the limitations of that design:
The graph doesn't offer any value and (not seen in the crop) doesn't accurately represent events such as merges.
We're not convinced of the value of showing all of the commits
We're losing precious horizontal space
Fast-forward a few rounds of back and forth designing, we landed on a flow on what we think comparing (and merging upstream changes) could look like:
Comparing & Merging Flow
When it's time to see how far a working branch has diverged from another, the developer will click into the "Compare" tab (formerly "History"). When there's initially no branch being compared to, we'll display the working branch's history.
Clicking on the "Choose a branch..." will open a little dropdown where the developer can search for a branch to compare.
After selecting a branch, the list will filter down to only the commits that the working branch is missing from the target branch. From there, the developer can choose to merge those commits into their working branch, or they can stop comparing by selecting "None" in the branch dropdown.
Another problem we plan on tackling for 1.1 is merge conflict. We thought that the merge section could be an opportunity to surface a conflict ahead of time instead of presenting an error after clicking "merge." We will still allow them to attempt a merge, and we'll then kick off into the merge conflict resolution flow.
For some additional context, here's @niik on the state of the design.
Just a quick update here. We still have some work to do here. Those mocks are some initial explorations but we don't feel like we're done or that we've addressed the whole problem yet. Please bear with us as we try to figure this out.
I think all those mocks address the case where my comparison branch is ahead of my branch. I'm curious if you've thought about the flip side where my branch is ahead.
Our current thinking around this is that the notification part (which haven't been described fully yet) will focus on the behind scenario. We want to focus on the forward momentum primarily. That said we absolutely want the compare view to be able to answer the questions you've described here but our current thinking is that it will be an explicit action and not something where the app automatically informs you of what's been going on in your branch.
So, to summarize. Our main focus here is the scenario where something has happened on master and you don't necessarily know about it. We want to surface that you're no longer up to date and easily see what's changed as well as provide a way to get up to date quickly. Once that's fully fleshed out we'll look at other workflows that the compare tab can help out with.
Here's a design update on showing relationship between branches. The previous design back mostly focused around the scenario where you were behind a target branch. This next iteration of designs will support both scenarios where you're behind and ahead.
We've replaced the "History" title with "Compare" to better represent the functionality of this view.
The Default View
By default, when you're not comparing a branch, the compare view will show all the commits in your branch. This will be exactly like how the history view works currently.
Branch selector
NOTE: I'm currently exploring different ways of showing branch information in this view so this may change soon No longer exploring. This is what I've committed on:
When you start typing in the "Compare a branch..." text field, we'll drop down a list of branches to choose from. There will also be information around how many commits your branch has diverged from other branches.
Compare View
Behind View
The behind view shows the commits that are missing from your branch that exist in the target branch. This will help you understand what changes can be brought into your branch and give you the ability to stay up to date as you continue working.
Just like the previous designs, you'll also be able to bring these changes into your branch using a merge button.
Ahead View
The ahead view shows all the commits that exist only in your branch and not the target branch. The commits in the list will be similar to the commits as if you were to open up a pull request.
Reacted by Neha Batra, Jed Fox, Agisilaos Tsarampoulidis and Tiernan L
Adding a couple questions I have off the top of my head:
Are the terms "Behind" and "Ahead" intuitive for those who aren't familiar with Git? Could we improve that?
There are people who found the comparison graph useful. I'd love more thoughts on how people integrate comparison graphs or git branch graphs in their workflows. I'm particularly interested with the problems people ran into and how the comparison graph was able to solve that.
By default, when you're not comparing a branch, the compare view will show all the commits in your branch. This will be exactly like how the history view works currently.
@donokuda, if I understand correctly, the history view in the desktop app currently shows all of your commits in your branch + all commits from wherever you branched off of. The new one is showing all the commits in your branch only, yeah? this would be a slight change in behavior
@nerdneha just FYI - I've made a minor change to the issue description to indicate when this can be used:
When I create a new branch, I should be able to get a clear understanding of the commits I've made and how that compares to master or any other target branch.
becomes
When working on a local branch, I should be able to get a clear understanding of the commits I've made and how that compares to master or any other target branch.
Reacted by Neha Batra and Agisilaos Tsarampoulidis
changed the title [-][Feature] Relationship between branches "lite" tracking[/-][+][Feature Tracker] Relationship between branches "lite" tracking[/+]on Mar 19, 2018
changed the title [-][Feature Tracker] Relationship between branches "lite" tracking[/-][+][Feature Tracker - RBB] Relationship between branches "lite" tracking[/+]on Mar 19, 2018
I have an additional idea for the "branch relationship visual overview". It could be nice if the visual overview would also be interative. E.g. right click on a commit to create a new branch from there. Maybe even a drag function where you can drag a commit back to the master branch. I remember when I first tried Github, this was the first thing I tried when searching for the "creating new branch function tab.
Activity
iAmWillShepherd commentedon Feb 7, 2018
For some additional context, here's @donokuda's mockups from #2639
iAmWillShepherd commentedon Feb 7, 2018
For some additional context, here's @niik on the state of the design.
donokuda commentedon Feb 8, 2018
Here's a design update on showing relationship between branches. The previous design back mostly focused around the scenario where you were behind a target branch. This next iteration of designs will support both scenarios where you're behind and ahead.
We've replaced the "History" title with "Compare" to better represent the functionality of this view.
The Default View
By default, when you're not comparing a branch, the compare view will show all the commits in your branch. This will be exactly like how the history view works currently.
Branch selector
NOTE:
I'm currently exploring different ways of showing branch information in this view so this may change soonNo longer exploring. This is what I've committed on:When you start typing in the "Compare a branch..." text field, we'll drop down a list of branches to choose from. There will also be information around how many commits your branch has diverged from other branches.
Compare View
Behind View
The behind view shows the commits that are missing from your branch that exist in the target branch. This will help you understand what changes can be brought into your branch and give you the ability to stay up to date as you continue working.
Just like the previous designs, you'll also be able to bring these changes into your branch using a merge button.
Ahead View
The ahead view shows all the commits that exist only in your branch and not the target branch. The commits in the list will be similar to the commits as if you were to open up a pull request.
donokuda commentedon Feb 8, 2018
Adding a couple questions I have off the top of my head:
j-f1 commentedon Feb 8, 2018
Article by @tonsky for inspiration: http://tonsky.me/blog/reinventing-git-interface/
nerdneha commentedon Feb 13, 2018
@donokuda, if I understand correctly, the history view in the desktop app currently shows all of your commits in your branch + all commits from wherever you branched off of. The new one is showing all the commits in your branch only, yeah? this would be a slight change in behavior
donokuda commentedon Feb 13, 2018
To clarify, the default view (i.e., no branch compared) is all of your commits in your branch + all commits from wherever you branched off of.
[-]Relationship between branches "lite" tracking[/-][+][Feature] Relationship between branches "lite" tracking[/+]shiftkey commentedon Feb 21, 2018
@nerdneha just FYI - I've made a minor change to the issue description to indicate when this can be used:
becomes
mathieudutour commentedon Feb 24, 2018
If I can add something: when on a branch that is linked to a PR, I think the default state should be the comparison with the base of the PR
[-][Feature] Relationship between branches "lite" tracking[/-][+][Feature Tracker] Relationship between branches "lite" tracking[/+][-][Feature Tracker] Relationship between branches "lite" tracking[/-][+][Feature Tracker - RBB] Relationship between branches "lite" tracking[/+][-][Feature Tracker - RBB] Relationship between branches "lite" tracking[/-][+][Feature Tracker - RBB] Compare Branches Feature tracker[/+]iAmWillShepherd commentedon May 3, 2018
Closing this now that the compare branches feature is merged and available in the demo. All further tracking for releasing this is in #3955.
JanderHungrige commentedon Jun 18, 2018
Hi, thanks for the great work.
I have an additional idea for the "branch relationship visual overview". It could be nice if the visual overview would also be interative. E.g. right click on a commit to create a new branch from there. Maybe even a drag function where you can drag a commit back to the master branch. I remember when I first tried Github, this was the first thing I tried when searching for the "creating new branch function tab.