samber / git-contrib-graph

📊 Displays a github-like contribution graph, of every contributors of a repository
10 stars 11 forks source link

Add PoC of commit count image #15

Open FrontSide opened 5 years ago

FrontSide commented 5 years ago

This proof of concepts shows the creation of line graphs depicting the number of commits of an author per active day.

Upon using the command line flag --img, one graph exported to a .png file per author will be created.

Note that the addition adds the dependence to the following go package:

Known limitations:

Signed-off-by: David david@isan.engineer

samber commented 5 years ago

This library looks nice !

Could you copy/paste a produced image here please ? ;)

What do you think about returning an error if --full-graph isn't provided ? 🤔

samber commented 5 years ago

Could you aggregate data (sum of additions and deletions) when INTERVAL is equal to week or month ?

This should draw a better graph when repository is older than 2y !

I think you can re-use getIntervalContribs().

samber commented 5 years ago

This PR need a rebase on master ;)

FrontSide commented 5 years ago

Could you copy/paste a produced image here please ? ;)

I added one to the repo. But sure, here is one example graph of the repo that's featured in the README:

What do you think about returning an error if --full-graph isn't provided ?

That would make sense if omitting it means that days without contributions would be missing from the image (that would be deceiving). Maybe we should make that the default for --img though and also suppress console output unless maybe a --print-to-console flag is also given. Or maybe I'm just misunderstanding what the --full-graph flag is supposed to do.

Could you aggregate data (sum of additions and deletions) when INTERVAL is equal to week or month ?

Sound like a great idea. Maybe we should open an issue for that and allow PRs based on the work I've done here. This PR is really meant as a "Minimal Viable Product" if you will.

Great project btw.

samber commented 5 years ago

--full-graph argument displays days without contributions.

But you're right, we can set --full-graph to true when --img is provided.

We can add support for different intervals in a different PR.

FrontSide commented 5 years ago

rebased