-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Attach newly created branch to commit in gitgraph #5279
Comments
I think this will change the rendering, although this is a nice feature. My thoughts that there are plenty of git visualization tools (gitg, gitk) and we can re-implement the whole rendering. But this is not really quick. Could you elaborate more on how then the graph should look like? Branches names are currently aligned, where should we put them and how to distinguish them from commit messages? |
I came here seeking a similar capability, so I'm now also thinking about how it could/should look like. I think the problem is that even though we often think about branches as parallel tracks onto which commits can be made (and it's definitely useful in many applications to visualize them as such); Git has no concept of these "tracks" — a branch is just a pointer to a specific commit. Sometimes (as in the OP's case, or if we merge two branches into each other), multiple branches will be pointing to the same commit. One idea to solve this without breaking the existing visuals is to offer an alternative way of showing the branch names. The
I would argue that "pointers" could be a sensible default because it's closer to what Git is actually doing, but I understand the value in the "tracks" model for people doing release management graphs and the like. |
Visually, I think it could suffice for branch pointers to look similar to the tag pointers, but with a differently styled box. I would personally be okay with setting |
Proposal
Currently branching a commit on gitgraph which has no commits on it does not render it. This can be confusing as branches with pointers at different commits cannot be differentiated. Would be nice to have some indicator such as a tag of some sort.
In this example, feat-1 should be currently pointing to the commit "initial commit" while feat-2 is at "working on DB"
Example
gitGraph
commit id:"initial commit"
branch feat-1
checkout main
commit id: "working on DB"
branch feat-2
Screenshots
The text was updated successfully, but these errors were encountered: