Answer the question
In order to leave comments, you need to log in
How to visualize GIT commit graph using php?
there is php.
There is an array with commits from GIT, honestly parsed "git log" and slightly combed out:
[#ID#] => array (
[HASH] => #HASH#
[PARRENTS] => array (
[0] => #PARRENT_HASH_0#
...
[N] => #PARRENT_HASH_N#
)
[CHILDS] => array (
[0] => #CHILD_HASH_0#
...
[N] => #CHILD_HASH_N#
)
)
Answer the question
In order to leave comments, you need to log in
git log --graph --oneline
?
UPD. So this is a completely different question.
1) We count the number of days and commits in them. As a result, we get a number that will be the width of the image in points
2) We count the number of branches. Get the height of the image in pixels.
3) Draw commits depending on their branch (row) and date/serial number in the day (column)
4) Merge commits within the same branch
5) For commits with multiple descendants, merge to the corresponding branches (do not forget about the offset in the column)
And here Lots of room for optimizations and improvements
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question