-
Notifications
You must be signed in to change notification settings - Fork 458
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
UX of virtual branch commit states (discussion) #3121
Comments
@krlvi I should perhaps know the answer by now, but what is the difference between "upstream commits" and commits on "remote branch"? |
I view the current state as a UI (UX) bug. In terms of what goes in each group:
(very likely the way we have the distinction now is something for us to fully redo) |
Trying to illustrate, let's say you start a new branch and commit twice (A and B), you have two "local" commits: Then you push the branch to GitHub, now those commits are on the server as well, so we let you know that by labeling them as being on the "remote branch": Ok, now you commit on your branch again but haven't pushed it, so now your commits are in two different groups. One that is local only and one that is pushed: Finally, someone else pushes work to your GitHub branch (something not created locally by you). Now you have an "upstream" commit. Now lets say you merge in the upstream commit: Now you have a few local commits (the merged one included). Now you push, everything is "remote branch", because all the commits are on the server: |
I think this is the minimally important distinction. Is a commit:
If it's 1 only, it's in the "local" group If it's 1 and 2, it's "remote branch" group If it's only 2, it's "upstream" group We can rename them or differently visualize them, but there are practical implications to each of these groups.
|
Thanks for that illustration! I was thinking - we currently linearize the sequence, the way we show it, even when there is a merge. Perhaps that's a big source of confusion. Since we allow merges (and many people prefer it) perhaps we can try visualising it in a non-linear way. Even as a rebaser-person I'd find it perhaps useful. |
It could be interesting to pull the graph component out to the side and illustrate the topology a little bit more, rather than flattening and simplifying the relationships (esp where we have merges). It would basically be |
The one state that GB allows but is not in your list of 4 states is having pushed a commit (or several) to the remote, and then undoing those commits locally. This results effectively in state 2 but requiring a force push if no changes are made after the commits are undone (eg. you just want to change the commit message). However I think once changes are made it should probably act more like state 4? |
@KroniK907 in that case, the old commits become state 3 ("upstream") because they are on the server under that branch but not local. the new local work becomes state 1 ("local") as they are not upstream. You could merge them back in, the way they're done in the diagram, but more likely what you want to do is force push. You're correct though, when that becomes problematic is when someone else pushes on top, so you want to effectively cherry pick from upstream and then force push. |
I tried the following while my vbranch is in the 4th state (diverged)
If i log the origin one
I guess it is not showing them as separate lanes because there they are not in the same place (one is in remotes). |
your syntax what you want is: to see unique commits from both (symmetric difference). the syntax is to visualize, could do something like: git log --oneline --show-linear-break --left-right main...origin/testing |
okay, just got some help from Scott - this one gave what i wanted
|
@PavelLaptev FYI, this graph will never have more than two tips (the diverged case, state 4) |
@krlvi got it. Thank you for the explanation. I'll prepare some drafts :-) |
Drafts in Figma https://www.figma.com/file/FbeLt0yjY9RiNn8MXUXsYs/Client-Design?type=design&node-id=2100%3A42661&mode=design&t=lerXeTmJGwqsI4gg-1 We can show additional info on hover for the commit card and the avatar: |
I really like this format, but there is something that we do now that is not reflected here that could be a bit confusing, which is indicate that the upstream-only commits are not incorporated into our working directory. In our current UI, upstream-only commits are above the uncommitted changes and everything those changes depend on (ie, are merged locally) are below that block. We should indicate this somehow. here, you are interspersing the commits by time of commit, but I don't think that's nearly as important as wether it's merged into our working directory or it's remote only (ie, pending). Perhaps we force all the upstream work to the top and have a dividing line, or even move them again above the uncommitted changes section. I'm not sure what works better, but they should be a removed block that is clearly unincorporated. |
@schacon I was thinking that the red/orange color, together with the the absence of a merge of the two tracks indicates upstream only. Do you mean always keeping the upstream bit on the top to further highlight that like this mockup 👇 ? I think one less nice thing in this arrangement is that newest commits (one created locally) wont be rendered on the top but maybe thats ok? |
Exactly. I think since there's three colors, intermixing them would be confusing as to what is in your working directory and what is not. The upstream ones still need to be integrated and that should be clear. Also, we'll need a UI for that (merge/rebase these), which we're missing here. Those upstream commits are a really different animal and this interface makes them seem equivalent. |
wouldn't the button below cover those cases? it changes it's mode (merge upstream / [force]push) with an icon matching the color + highlighting the commits to be merged / pushed on hover |
Oh sorry, I missed that. Yeah, that could work. Though, can we do a mockup where we have "merge upstream" directly under the upstream group and "push to remote" under the local group? |
I would also be interested in seeing that. But I wonder if we could somehow do it with buttons that are smaller than those big full-width ones, somehow it feels that they break the continuity / flow for me when they are in between other stuff (like in the current implementation) |
Something like this (sorry for the horrible photoshop): We should always group these together, and it seems a bit clearer that there is an action that is performed on that specific group. Also, there are then fewer dropdown options and we can keep the last one easily. Like, the top would be either "Merge" or "Rebase" and the user would probably always want that option. The locals would either be "push" or "open PR" (if no PR yet) and again would always want to default to that. |
Divergence in this case is the only correct way to show it. What might be valuable is to show a partial sha in these cases (or maybe even generally?) |
In this case, if i have 10 commits that I have already pushed, and then choose to rebase my working directory, until I (force) push, I will have 20 commits on screen, with the upstream ones shown on top, right? I wonder if we can improve on that situation. Btw, what is a partial sha? |
maybe if we can match on identical message (or we could be spiffy and extract a patch-id from each, but there are corner cases that fuck both of those approaches - commit messages are generally fine and fast), we could do some viz where we collapse the rebased ones and mostly show the new ones. I think this is rather common, esp the more we add rebasing methods. |
Just showing the first 6-8 chars, rather than all 40 chars. |
Here's a crazy idea - what if we use the base as an anchor for this. When a user rebases, we show the commits only once but with nodes in both tracks (remote and local) (illustration 3.).
What we could gain from this is simpler / more compact representation, and also communicate that it's not that the commit content is different but it's the base that actually differs. WDYT? |
@krlvi are you re-discovering |
re: divergence, and re-matching / reconciling old <-> new commit SHAs: you might be interested in what git-stacked-rebase does: tl;dr: upon performing a rebase, git writes a the |
@krlvi about no.3 - rebased. Is this concept introduce ability to only rebase, right? |
hmm, this is another rebase - it's when you have performed it and your branch is still in progress, while "rebase and merge" is an operation on completion |
@kiril got it. So, if you've merged and rebased the branch, it's considered integrated. Therefore, we should also have a "Rebase branch" option, for example, in this dropdown menu. and then allow to select to which branch we want to rebase. e.g. |
Let's discuss tomorrow, I sense there is a confusion here. But in brief, the This is quite different, workflow wise, from rebasing while still working on the branch. For example our update button may perform a rebase. In the screenshot above, the "Rebase branch" is not applicable since GitButler maintains the same base for all branches in the working directory. The red "update" button in the side/Navigation is the de-factor Rebase button |
Hey! Made new design drafts here: Here are flows you can find in drafts:
|
Looking really nice @PavelLaptev! Looks accurate. I will leave some comments in figma on specific things where i had some thoughts. Also, is it worth making some kinda of design that shows the developer that part of the stuff is not on their computer. Not like the dotted line here #3121 (comment) but something 🤔 |
@krlvi gotcha, thanks! I'll address your comments |
Another question is how we want to display unfolded commits. Currently, we show it like this, in a single lane. Which works, but sometimes it feels a bit squeezed, so you need to resize the lane manually: Screen.Recording.2024-03-27.at.14.48.45.movAnother way is to show on the left, like this: Screen.Recording.2024-03-27.at.14.52.10.movWhat do you think? |
hmm, while the second option looks better, i feel that the double expand to the right makes it extra tricky to see the contents at a glance (an additional click and a long travel distance to get to the content of a file). im worried that it's already a bit tricky to navigate/scroll left/right even for simpler things like moving hunks. |
Another option could be like this to open is aside, but anyway it will take horizontal space: Screen.Recording.2024-03-27.at.15.12.46.movAnd another option where we open the commit card vertically, but show the hunk aside: Screen.Recording.2024-03-27.at.15.30.38.mov |
@krlvi I don't think that moving hunks related to this, because you can move hunks between commits. Now you can only |
We continue to discuss this on Discord here https://discord.com/channels/1060193121130000425/1060193121666863156/1222544812998397962 |
This is now implemented with v0.12.0 https://discord.com/channels/1060193121130000425/1183737922785116161/1246475064006807575 |
Background:
The nature of branches having a local and remote equivalent means that commits can be in multiple states.
I find this graphic by Julia Evans to be quite nice at illustrating this:
Problem
The lanes GitButler renders for virtual branches don’t represent the
need to pull
anddiverged
states clearlly. To illustrate this, I made a graphic showcasing the way the 4 states are shown by GitButlerCurrent state in GitButler
Below are 4 screenshots next to each other, covering the 4 states mentioned previously and how they are represented within GitButler virtual branches, alongside some commentary. I generated these states by making a commits using the GitHub website.
Comments from the graphic 👆 (the numbers in blue)
Lets discuss 💬
The purpose of this GH issue is to invite a discussion and maybe go over some drafts / ideas that come up. @schacon, @mtsgrd, @Qix- @PavelLaptev let me know if I have missed something
The text was updated successfully, but these errors were encountered: