-
-
Notifications
You must be signed in to change notification settings - Fork 625
Use gitoxide
in get_status
#2673
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
base: master
Are you sure you want to change the base?
Conversation
2916a78
to
1b3694b
Compare
With this change, when `get_status` is run in a sub-directory, it also returns matches in sub-directories that don’t share a prefix with the sub-directory it is being run in.
@@ -123,6 +123,44 @@ pub enum Error { | |||
#[from] gix::object::find::existing::with_conversion::Error, | |||
), | |||
|
|||
/// | |||
#[error("gix::pathspec::init::Error error: {0}")] | |||
GixPathspecInit(#[from] Box<gix::pathspec::init::Error>), |
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.
I am wondering if this should be moved into a separate GixError
Type to keep the Cambrian explosion under control with all these gix errors?
@@ -56,6 +56,13 @@ pub fn untracked_files_config_repo( | |||
} | |||
} | |||
|
|||
// This does not reflect how git works according to its docs that say: "If this variable is not |
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.
good catch, we should put a reminder into your tracker issue to clean that up eventually
asyncgit/src/sync/status.rs
Outdated
@@ -134,59 +177,93 @@ pub fn get_status( | |||
) -> Result<Vec<StatusItem>> { | |||
scope_time!("get_status"); | |||
|
|||
let repo = repo(repo_path)?; | |||
let repo: gix::Repository = |
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.
maybe we should make this a helper method as we want to make sure we always use a consistent same way to create this repo using discover_with_environment_overrides
, right? we have introduced this mouthful already in a few places
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.
just a few questions and nits, other looks good to go to me
Great suggestions! I’ve added them as items to the tracking issue to unblock this PR. Also, I’ve already implemented one of them. :-) |
Update 2025-07-06
I’ve been using this branch daily for the last week. I found one issue that I’ve addressed in a separate commit. I think it’s now ready for review!
Initial description
This is a draft PR. I think that, at this point, most of the initial work of porting is done. I’m going to be using this branch as my daily driver throughout the week to find any issues there might still be left. I’m planning on marking it as ready for review at the end of the week.
This PR changes
asyncgit::sync::get_status
to usegitoxide
. As a side-effect, it letsgitoxide
handle readingstatus.showUntrackedFiles
. The resulting behaviour, with respect tostatus.showUntrackedFiles
, is closer to what git does than it was before this PR. I’ve updated 2 tests according to the new behaviour.