gitgraph.js
gitgraph.js copied to clipboard
Support octopus merge ('merge' with more than two parents)
I guess more then two parents not suppored because of syntax - from_branch.merge(to_branch)
, while git use git merge from_branch from_branch ...
.
There is some limitation in this lib that may to stop me from implementing that feature?
I have personally never use this command in real life ^^ But we can probably include this in the v2, I just need to try locally to see how this command behave 😄
We can modify this function to accept multiple branches, it should be not so complicated.
Please note that I prefer add this feature to the v2.0.0, we try to stop adding feature to the legacy version ;)
Some refs about this octopus merge:
Commits, usually other branch heads, to merge into our branch. Specifying more than one commit will create a merge with more than two parents (affectionately called an Octopus merge).
https://git-scm.com/docs/git-merge
Turning this into a feature request. Thanks for suggestion @spiridoncha.
I'm planning to use this library in a git-based solution I'm building, but the lack of this feature is a deal-breaker for the project here :(
I guess I'd have to fork and implement it somehow if I really need that, right? Please, let me know if I can help somehow and if you would be accepting PRs for that. I'm happy to work on v2 if there is a version stable enough I can use it in the project here.
Hi @brunojcm 👋
Hmmm yep indeed we're not working on this issue right now. But PRs are welcomed if you want to dig into it, we'll review / merge / release it 👌
We didn't yet released a release candidate for v2 so it might be risky to implement there as it's not stable yet. If you plan to use it in following weeks / months, it's best to do it on v1. Then we'll port the feature on v2 when it's out.
@brunojcm It's stable enough and well tested :angel: if you want to implement this octopus merge, I will choose the v2. Furthermore, it can be very interesting to have a real project as integration test 💯
Please note that I have less risk aversion than @nicoespeon 😈
@fabien0102 and @nicoespeon, I finally started trying running the v2 here locally, but I'm having some problems. First time trying to work with a lib outside npm in an Angular project, so sorry if my questions are two dumb.
- Is v2 supposed to work with angular 2 at all? I managed to add the core module in
tsconfig.app.json
path:
"paths": {
"gitgraph.js": [
"C:\\Users\\medeb8\\git\\gitgraph.js\\packages\\gitgraph-core\\lib"
]
},
I also managed to write some code using the core objects inside an angular component:
let gitGraph = new GitgraphCore()
let m = gitGraph.branch('master')
m.commit()
But nothing renders in the canvas and, to be honest, I'm not surprised. I'm pretty sure the answer to this question is "no" and we need a gitgraph-angular
rendering module, but, as I said, I cannot confirm that 100%.
- How hard would that be to have a
gitgraph-angular
? Is that in the v2 short-term plans?
@brunojcm indeed, gitgraph-core
is the core lib which doesn't do the actual rendering. It's framework agnostic. But you need an Angular component to use it and do the rendering: the gitgraph-angular
lib.
The good news is that @dolanmiu is working on that here: https://github.com/nicoespeon/gitgraph.js/pull/212 You can get insights about it in the related issue: https://github.com/nicoespeon/gitgraph.js/issues/208
Didn't have time to do a proper review of the PR yet, but at least it seems to render stuff. You can probably try to use it. Though it won't be really stable.