Skip to content

Conversation

schoentoon
Copy link
Contributor

When testing this, it turned out I had a couple of repositories starred that got removed (but were still getting returned by Github their API). With this option I can just skip over those repositories, rather than stop and not back up any other pending repositories. I put the default on false to retain original behavior, although in my opinion having this on by default would be more useful.

@ChappIO
Copy link
Owner

ChappIO commented Apr 19, 2022

Good suggestion, however this option may be misleading. What it really does is ignore any clone error. I will pick up your suggestion and think about maybe a better name for it.

Another thing that comes to mind is: You'd probably want to know about these right? Would it make sense to dump a list of failed repos to a logfile somewhere or simply logging to console would be enough?

@schoentoon
Copy link
Contributor Author

Logging in general could be improved in my opinion. Using something like logrus could be used to easily differentiate between errors and the "Discovered " log calls for example.

@ChappIO
Copy link
Owner

ChappIO commented Apr 19, 2022

Fair enough, I initially set up this tool for personal use and never thought other people would use it. I am familiar with logrus and might make a release to improve logging and make it more configurable.

For now, I will be okay with this PR provided you change a few things:

  1. Rename the option to "fail-at-end"
  2. Make sure the binary actually fails with an error code if a repo has failed to clone
  3. Document the option in the readme

If you don't have the time to do this, let me know and I will pick it up.

@schoentoon
Copy link
Contributor Author

I'll pick this up after dinner, so in a few hours. Expect another pull request later as well with a flag to do bare clones rather than actually check out the repositories (something I just noticed while taking a proper look at the go-git documentation.

@ChappIO
Copy link
Owner

ChappIO commented Apr 19, 2022

Great! I will take a look tomorrow then.

Using this option it will continue with all repositories even when
encountering an error. It will only exit with an error after processing
all repositories.
@ChappIO ChappIO merged commit 18d0eed into ChappIO:main Apr 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants