repo-visualizer icon indicating copy to clipboard operation
repo-visualizer copied to clipboard

Add option to not commit

Open j3parker opened this issue 2 years ago • 5 comments

Committing the file back to the repo automatically is very handy, but it would be nice if this could be disabled.

We have a large mono-repo and we would only use this diagram for our main branch, so we would be happy storing this (potentially large and frequently changing) file outside of git, at the expense that when we link to it from our markdown docs it would only ever show the latest version. I imagine this would be preferable for most people but that's just speculation.

Would you accept a patch for this?

j3parker avatar Aug 06 '21 14:08 j3parker

If you only want the diagram for the main branch, I think you could configure the GitHub action to only trigger on changes to that branch and/or exclude it from running on any other branch.

simzou avatar Aug 06 '21 16:08 simzou

This is about how it always tries to commit and push the output.

We can prevent the push from working, and it sounds like the action will (possibly unintentionally) ignore this error (see #9), but we would like to the tool to not try in the first place.

Generally I think users would not expect this behaviour, and if it were me building something from scratch I would not have this behaviour by default (or at all -- it will interact poorly with some people's branch protection rules etc.) But that would be a breaking change, so I would understand if there was more hesitance to change the default (vs. just adding a flag.)

j3parker avatar Aug 06 '21 17:08 j3parker

Seems to me it might also make sense to commit the output to a different repo (the one hosting the project website for instance), so having this easily configurable would be a plus ?

martin-frbg avatar Aug 06 '21 21:08 martin-frbg

It may be already possible -- do point out to me if so :) -- but maybe the diagram could be stored to GitHub Actions or something? I can see the image can be useful on local machine, but option to have an updated diagram on project README.md without the separate commits could be nice too.

veikkoeeva avatar Aug 09 '21 20:08 veikkoeeva

I've taken a stab at this in #34, not sure if that was going in the direction people intended.

ageorgou avatar Aug 22 '21 10:08 ageorgou