-
Notifications
You must be signed in to change notification settings - Fork 54
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
create 'Repository' enum and move Index enum downwards #50
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #50 +/- ##
=========================================
+ Coverage 0.00% 0.15% +0.15%
=========================================
Files 50 48 -2
Lines 1988 1918 -70
=========================================
+ Hits 0 3 +3
+ Misses 1988 1915 -73
Continue to review full report at Codecov.
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the wait.
I am on board with the idea and I find the implementation here rather convincing, I don't have many remarks to make.
Don't worry about the 2018-style of imports, I've done the same in some places as well (like in src/logs.rs
).
I am also on board with moving the index-related config to the index module, it is also what I did in #46 where I moved the index config in the alexandrie-index
crate.
One funny thing, though, is that there are many different types named either Repo
or Repository
now:
alexandrie::index::repository::{Repo, Repository}
alexandrie::index::repository::git2::Repository
alexandrie::index::repository::cli::Repository
alexandrie::db::Repo<T>
git2::Repository
(the one from the externalgit2
crate)
And the worse thing is that I don't even know how to rename most of these things.
I guess we could rename crate::db::Repo<T>
to crate::db::Database<T>
, at least this would isolate Repository
as an Index
-related term within Alexandrie.
I guess that naming is, indeed, rather hard in computer science.
Indeed it is rather hard! The idiom i use is that a name should be the most logical and descriptive name it can be local to the containing module. Then, when referring to those types from other modules you can either use the qualified name, or rename the import as required. By that measure I totally agree with you that the current names i've got here are not quite right though. |
i'm re-worked the names slightly, mainly by making sure each instance of There's another option here, in this diff the only purpose that the |
this is a first draft of the changes we discussed regarding moving the enum in the index 'downwards'.
Since the file management is shared between the two index strategies, it's really only the repository management which is configurable, so this is isolated as an enum (rather than the entire index).
This is a work in progress, but ready for initial review