-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
GitGraph: line routing and colouring for branches above main #4932
Comments
+1 @guypursey for context, I was trying to write some guidance which is largely aligned to https://learn.microsoft.com/en-us/azure/devops/repos/git/git-branching-guidance?view=azure-devops#use-release-branches and other schemes which advocate release branches and depict them above |
@ijmitch Thanks for the extra context. With this in mind, do you think the point I've made about the curves still makes sense? Guess it's a design decision about whether curves and straight lines are a visual shorthand for anything semantically. I haven't found any guidance or documentation on this in the Mermaid repo so far. |
It would be ideal in my opinion if branching 'upwards' was a mirror-image of the normal 'downwards' rendering. So, yes, I mentioned the colour and was a bit lazy not to mention the curves used as well. |
Hi @guypursey, are you working on this? |
Hi @mathbraga, yes, I started work on this, as I was looking at those parts of the codebase already and drafting documentation. But I'm waiting to see if #4927 will be accepted and merged as I was building on top of the work in that PR. |
Yeah I noticed your involvement with #4927, that's why I wanted to know before diving too much into this. I did dig into this for a bit though, so I'll share some of what I found out that might help. I believe that one of the ways to solving this would be to identify when a branch is above or below
The second
to something like
Then inside I didn't really give much thought to this so there could be better solutions, just felt like leaving this here as it could help. |
Description
Branches render unexpectedly differently when they're positioned above
main
(as compared with their default position underneathmain
).This was found by @ijmitch during proposed fix for #4912.
Steps to reproduce
main
before joiningrelease-1
with a curve.a. Add following to config option on Config tab:
"gitGraph": { "mainBranchOrder": 2}
, orb Paste following line above graph code:
%%{init: {'theme': 'base', 'gitGraph': {'mainBranchOrder': 2}} }%%
main
branch instead and curves out ofmain
before joiningrelease-1
straight on.Screenshots
Here are examples with simplest possible graph for demonstration.
Example, standard with
main
as top branch:Example, standard with main as bottom branch:
Setup
Suggested Solutions
Amend conditionals around path rendering to take branch position into account, in the same way that top-to-bottom is considered separately from default left-to-right rendering.
Additional Context
Assumption: that branch curves should only apply to branches that aren't
main
.The text was updated successfully, but these errors were encountered: