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

Enhance the gc subcommand #179

Merged
merged 2 commits into from
May 2, 2018
Merged

Enhance the gc subcommand #179

merged 2 commits into from
May 2, 2018

Conversation

neithernut
Copy link
Owner

@neithernut neithernut commented Apr 30, 2018

This patch-set introduces multiple enhancements to the git dit gc subcommand. The main goal is to enable faster/more "responsive" collection.

It also enables collection for a subset of issues. This functionality may be used in server-side hooks, greatly enhancing the performance.

Resolves #174.

We use a `FlatMap` instead. This also causes references to be
collected/printed in chunks, e.g. all references for each issue at a
time.
@neithernut
Copy link
Owner Author

I also planned to offload RefsReferringTo generation to another thread using ppipe, but I did not get it to compile, yet. Also, since I have to juggle with Mutexes, it may not be worth it. Maybe I should just use a channel, directly.

@neithernut
Copy link
Owner Author

Turns out offloading work to another thread is not an easy thing to do. Most relevant git2 types are !Send. Wrapping stuff into Mutexes doesn't really help, since we (and this includes git2-internal code) uses lots of references. According to its docs, libgit2 is thread-safe, but git2-rs doesn't tell the compiler about this (see alexcrichton/git2-rs#194).

So we have to wait until someone does the necessary work of flagging the necessary structs. Until then, it doesn't make much sense trying to implement threading-features at our level.

@neithernut neithernut requested a review from matthiasbeyer May 1, 2018 19:49
@neithernut neithernut merged commit 3f82660 into master May 2, 2018
@neithernut neithernut deleted the enhance-gc-subcommand branch May 2, 2018 07:12
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