Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete corrupted git repos #494

Merged
merged 1 commit into from
Aug 28, 2022
Merged

Delete corrupted git repos #494

merged 1 commit into from
Aug 28, 2022

Conversation

kornelski
Copy link
Member

No description provided.

@@ -1386,3 +1396,17 @@ fn local_is_send_sync() {
fn is<T: Send + Sync>() {}
is::<Local>();
}


fn rm_directory(path_to_delete: &Path) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm always a bit scared seeing such functions. Get we make add some check here, that the directory is a subdirectory (has a prefix) of the dirs we expect to delete stuff in?

dpc
dpc previously approved these changes Aug 28, 2022
@dpc
Copy link
Collaborator

dpc commented Aug 28, 2022

What's with you changes never passing rustfmt check? :D

@kornelski
Copy link
Member Author

I think rustfmt is a deeply flawed tool that often makes code less readable, and therefore is unfit to be applied unconditionally to everything.

@dpc dpc merged commit 132fca4 into master Aug 28, 2022
@dpc
Copy link
Collaborator

dpc commented Aug 28, 2022

Oooooh. :D

@kornelski kornelski deleted the borkedgit branch August 28, 2022 17:28
@thomasjfox
Copy link
Contributor

I think rustfmt is a deeply flawed tool that often makes code less readable, and therefore is unfit to be applied unconditionally to everything.

what I love about rustfmt is no more arguing about code style: A project sets it once and can forget about it. Or every organization wide code looks the same, no matter which project. Best invention since sliced bread, IMHO ^^ Also I can write code in the IDE without having to spend brain cycles on indentation / formatting at all and concentrate on the logic. rustfmt runs automatically on save. For me it's a huge productivity win in the end, I can concentrate on the important stuff during code review.

Anyway, on a more serious side:

  • when is the git cleanup supposed to run? When I run "crev repo fetch all", I see a lot of repos with github auth failures. I was under the impression the new code should fix this?
  • May be it would be good to have a CHANGELOG.md entry for this new feature?

Or is the code just supposed to clean completely corrupted (=borked) git repos?

Current output:

$ cargo crev repo fetch all 2>&1 |grep ERROR
ERROR: Error: Failed to fetch https://github.com/AlekSi/crev-proofs: remote authentication required but no callback set; class=Http (34); code=Auth (-16)
ERROR: Error: Failed to fetch https://github.com/vctibor/crev-proofs: remote authentication required but no callback set; class=Http (34); code=Auth (-16)
ERROR: Error: Failed to fetch https://github.com/senden9/crev-proofs: remote authentication required but no callback set; class=Http (34); code=Auth (-16)
ERROR: Error: Failed to fetch https://gitlab.com/SostheneGuedon/crev-proofs: remote authentication required but no callback set; class=Http (34); code=Auth (-16)
ERROR: Error: Failed to fetch https://github.com/victorkoenders/crev-proofs: remote authentication required but no callback set; class=Http (34); code=Auth (-16)
ERROR: Error: Failed to fetch https://github.com/toasteater/crev-proofs: remote authentication required but no callback set; class=Http (34); code=Auth (-16)

@dpc
Copy link
Collaborator

dpc commented Aug 30, 2022

ERROR: Error: Failed to fetch https://github.com/AlekSi/crev-proofs: remote authentication required but no callback set; class=Http (34); code=Auth (-16)

This error is about not being able to fetch given repository, not that it is corrupted locally.

I'm not sure what to do about it. Probably hide behind some toggle. Seems like it bother people, but on the other hand it is a useful information in case someone was wondering why they can't get data from a certain id/url.

PRs welcome. :)

@kornelski
Copy link
Member Author

For these I think some kind of exponential backoff would be appropriate. Remember how many fetches failed, and then don't try to fetch them for a while.

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.

None yet

3 participants