Open threepistons opened 2 months ago
I've hit this problem too after re-publishing my site.
mermaid.min.js:710 Uncaught (in promise) Error: Cannot merge branch 'master' into itself.
at Object.merge (mermaid.min.js:710:3360)
at Merge (mermaid.min.js:710:9334)
at parseStatement (mermaid.min.js:710:9471)
at populate (mermaid.min.js:710:9200)
at Object.parse (mermaid.min.js:710:10035)
at async Diagram.fromText (mermaid.min.js:2108:248)
at async Object.render (mermaid.min.js:2146:1187)
This worked previously but I'm not 100% which version of Mermaid I was using. I'm using a MkDocs site.
I'm also affected.
It seems that in previous versions it was possible to merge another branch so that only a merge commit was created, but with this bug it's necessary to create a "normal" commit first.
This used to work:
gitGraph
commit id: " "
branch branch2
checkout main
commit id: " "
checkout branch2
merge main
gitGraph
commit id: " "
branch branch2
checkout main
commit id: " "
checkout branch2
merge main
Now this is necessary:
gitGraph
commit id: " "
branch branch2
checkout main
commit id: " "
checkout branch2
commit id: "dummy commit"
merge main
gitGraph
commit id: " "
branch branch2
checkout main
commit id: " "
checkout branch2
commit id: "dummy commit"
merge main
Edit: Confirm broken in mermaid version 10.7.0
Description
I'm sure that this syntax used to work, because I would not have allowed a broken diagram into my documentation back in January and my diagram is broken now, so I'm raising this as a regression bug.
A common use case for Git is to have a main (or master, or develop) branch that is merged at intervals into a production (or release, or deployment) branch. A simple example of gitGraph to display this would be as follows:
In the development version of the Live Editor and in GitHub, I get "Error: Cannot merge branch 'main' into itself."
What I expect is a diagram that looks something like:
Steps to reproduce
Or go to https://develop.git.mermaid.live/edit#pako:eNqdU01PwzAM_StWzhWCa69MAg6c4FgJuYnbRiRx5aagadp_x11X2KZtCJpL82y_569sjGVHpjStzw-CfVcl0M9yjD6DdyVU5in57DHswQI-fQhQEwgFwoEc-AS5I-iF3Wiz5wS1YLIdYM1jhsyTtxXCTO6mMrPE3uUnaIYjSUsQUTln9Y5Cv8TYjuz7RDnZz2S6wg8CdG4AVENqfAuND3QieXv3lrn39oTzBD7kfdRK00LcaB2j0D9ySqxtknOZHUW8crxSxB_zjSwE3OwG9Hvmc_cX5iO2nWk45NG562gjDpnkbCH3Ab1cG8iFRq0pX23Wkvfl3an0mMIooDen672ZPCoTuK3MJOaoHvW3mGFVirQ3oLxPQlsNxzHzyzpZU2YZqTDCY9uZssEw6G3snS70ymMrGL9Rcj6zPM-Pave2tl_0yCHc for one I made earlier.
Screenshots
No response
Code Sample
Setup
Suggested Solutions
No response
Additional Context
No response