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

Make cleanliness checks more efficient #15

Merged
merged 1 commit into from
Jan 4, 2024
Merged

Make cleanliness checks more efficient #15

merged 1 commit into from
Jan 4, 2024

Conversation

jwodder
Copy link
Member

@jwodder jwodder commented Jan 4, 2024

Closes #14.

@jwodder jwodder added the performance Efficient use of time and space label Jan 4, 2024
Copy link

codecov bot commented Jan 4, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (53478a8) 75.79% compared to head (6a3b037) 75.74%.

Files Patch % Lines
src/backups2datalad/asyncer.py 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #15      +/-   ##
==========================================
- Coverage   75.79%   75.74%   -0.05%     
==========================================
  Files          15       15              
  Lines        2549     2544       -5     
  Branches      563      562       -1     
==========================================
- Hits         1932     1927       -5     
  Misses        458      458              
  Partials      159      159              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


return await anyio.to_thread.run_sync(_unclean)
!= ""
)
Copy link
Member

Choose a reason for hiding this comment

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

I think it would indeed be more efficient but not yet "most efficient" for the case of having heavy changes: would it result in early termination of that git status --porcelain ... on receiving any output, which already would be indicative of being dirty?

Copy link
Member Author

Choose a reason for hiding this comment

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

No. I'm not sure if changing the code to terminating git status early would result in git cleaning everything up properly.

Copy link
Member

Choose a reason for hiding this comment

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

I bet it should be fine since I believe it is typically used as git status --porcelain --untracked-files=normal --ignore-submodules=none | grep -q . which results in similar early closure of the pipe etc.

But anyways -- probably most of our cases are not that heavy on the diff here so would not really be anyhow notably different. Let's proceed.

@yarikoptic yarikoptic merged commit 1646c09 into main Jan 4, 2024
5 of 7 checks passed
@yarikoptic yarikoptic deleted the gh-14 branch January 4, 2024 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Efficient use of time and space
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make cleanliness checks more efficient
2 participants