Skip to content
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

Allow to pin commit graph branch order #10217

Closed
hokoo opened this issue Feb 10, 2020 · 4 comments · Fixed by #12142
Closed

Allow to pin commit graph branch order #10217

hokoo opened this issue Feb 10, 2020 · 4 comments · Fixed by #12142
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@hokoo
Copy link

hokoo commented 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.

@guillep2k
Copy link
Member

You mean in the commit graph?

image

There's none that I know of.

@hokoo
Copy link
Author

hokoo commented 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 hokoo changed the title Allow to pin graph branch order Allow to pin commit graph branch order Feb 11, 2020
@lunny lunny added the type/proposal The new feature has not been accepted yet but needs to be discussed first. label Feb 13, 2020
@zeripath
Copy link
Contributor

zeripath commented 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.

@silverwind
Copy link
Member

silverwind commented 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.

@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants