Allow to pin commit graph branch order #4828

Closed
opened 2025-11-02 06:04:03 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @hokoo on GitHub (Feb 10, 2020).

How I can to pin master - final - dev - etc branches from left to right? It is very discourages when branches is dancing.

Originally created by @hokoo on GitHub (Feb 10, 2020). How I can to pin master - final - dev - etc branches from left to right? It is very discourages when branches is dancing.
GiteaMirror added the type/proposal label 2025-11-02 06:04:03 -06:00
Author
Owner

@guillep2k commented on GitHub (Feb 10, 2020):

You mean in the commit graph?

image

There's none that I know of.

@guillep2k commented on GitHub (Feb 10, 2020): You mean in the commit graph? ![image](https://user-images.githubusercontent.com/18600385/74188653-a7c27600-4c2d-11ea-8fb8-b544e356722c.png) There's none that I know of.
Author
Owner

@hokoo commented on GitHub (Feb 10, 2020):

You mean in the commit graph?

Yes, about commit graph. There is no point in the existence of the commit graph when branch ordering is absent.

The same goes for color choice. It should be possible to pin the branch color.

@hokoo commented on GitHub (Feb 10, 2020): > You mean in the commit graph? Yes, about commit graph. There is no point in the existence of the commit graph when branch ordering is absent. The same goes for color choice. It should be possible to pin the branch color.
Author
Owner

@zeripath commented on GitHub (Jul 4, 2020):

Pinning the color is difficult - fundamentally we don't get any identifier for these flows so we cannot simply set a color for them based on their identifier.

Even if we parse the flows on the server, we can't guarantee the same colors - we would need to come up with some unique identifier for a flow: [from commit, to commit, ending as a commit?] is the only identifier I can think of but without the whole graph you can't assign those.

I guess if we switch from drawing and generating the flows in a single pass to creating flow objects that have all the co-ordinates and symbols that represent the flow - we can then assign the flows colors more easily. Then we can store and pass the colors that go over the page - however if you get a commit in the interim that is likely to bugger up the coloring I guess the pages would have to have to have a last commitid - but then things like https://try.gitea.io/ahaha/glu/graph around 51e429e which doesn't have a commitid might cause trouble if it is on a page edge.

The flow generating code at present presumes a bottom up generation of flows - it would be possible to switch this round to parse from top to bottom - but I suspect that is not going to get us far.

hmm... I think storing the full graph on the flows would be helpful in any case because then you could do things like highlight all the commits on a flow.

It should be noted that a flow is not a git branch - a git branch is simply a pointer to a commit - and the mainline history of a branch isn't stored in any way - in that given two parents of a git commit I there is no information as to which was previously labelled the head of the branch. In this graph coloring scheme we always choose the color of the most leftmost flow in to a node - we could equally choose the most right-hand but then the most left-hand flow would always be changing color as things are merged into it.

@zeripath commented on GitHub (Jul 4, 2020): Pinning the color is difficult - fundamentally we don't get any identifier for these flows so we cannot simply set a color for them based on their identifier. Even if we parse the flows on the server, we can't guarantee the same colors - we would need to come up with some unique identifier for a flow: [from commit, to commit, ending as a commit?] is the only identifier I can think of but without the whole graph you can't assign those. I guess if we switch from drawing and generating the flows in a single pass to creating flow objects that have all the co-ordinates and symbols that represent the flow - we can then assign the flows colors more easily. Then we can store and pass the colors that go over the page - however if you get a commit in the interim that is likely to bugger up the coloring I guess the pages would have to have to have a last commitid - but then things like https://try.gitea.io/ahaha/glu/graph around 51e429e which doesn't have a commitid might cause trouble if it is on a page edge. The flow generating code at present presumes a bottom up generation of flows - it would be possible to switch this round to parse from top to bottom - but I suspect that is not going to get us far. hmm... I think storing the full graph on the flows would be helpful in any case because then you could do things like highlight all the commits on a flow. It should be noted that a flow is not a git branch - a git branch is simply a pointer to a commit - and the mainline history of a branch isn't stored in any way - in that given two parents of a git commit I there is no information as to which was previously labelled the head of the branch. In this graph coloring scheme we always choose the color of the most leftmost flow in to a node - we could equally choose the most right-hand but then the most left-hand flow would always be changing color as things are merged into it.
Author
Owner

@silverwind commented on GitHub (Jul 11, 2020):

If branch name can not be used for flow color, I suggest a static set of color assigned left-to-right. For example, 16 colors generated using https://medialab.github.io/iwanthue/:

light (for dark theme):

#ed5a8b
#66e049
#db62d6
#b7e83e
#8683ee
#e1d037
#4be9b7
#ea6542
#57e185
#db9333
#42af69
#afa63a
#95e57b
#d4e572
#4da841
#7db233

dark (for light theme):

#ce4751
#499a37
#a846e5
#8f9121
#5d45d1
#c67d28
#5d7ce2
#e33a28
#5742a1
#c45327
#872ea6
#af2f63
#d747ce
#e64996
#bf6fce
#982e85

Note the example colors don't match in light/dark. Probably better to define them in hsl notation for easy lightness adjustment.

@silverwind commented on GitHub (Jul 11, 2020): If branch name can not be used for flow color, I suggest a static set of color assigned left-to-right. For example, 16 colors generated using https://medialab.github.io/iwanthue/: light (for dark theme): ``` #ed5a8b #66e049 #db62d6 #b7e83e #8683ee #e1d037 #4be9b7 #ea6542 #57e185 #db9333 #42af69 #afa63a #95e57b #d4e572 #4da841 #7db233 ```` dark (for light theme): ```` #ce4751 #499a37 #a846e5 #8f9121 #5d45d1 #c67d28 #5d7ce2 #e33a28 #5742a1 #c45327 #872ea6 #af2f63 #d747ce #e64996 #bf6fce #982e85 ```` Note the example colors don't match in light/dark. Probably better to define them in `hsl` notation for easy lightness adjustment.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#4828