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

Add support for pathspecs to iter_gitdiff() #747

Merged
merged 7 commits into from
Jul 16, 2024
Merged

Add support for pathspecs to iter_gitdiff() #747

merged 7 commits into from
Jul 16, 2024

Conversation

mih
Copy link
Member

@mih mih commented Jul 15, 2024

Towards #598

mih added 7 commits July 15, 2024 14:37
This is anticipating the implementation of a pathspec enabled reporting
pattern that follows the model of `iter_gitworktree`.
When adding pathspec support, we need to be able to collect information
which submodules have already been reported on. This is best done in a
lean wrapper, and this change is preparing for that.
The implementation largely follows the pattern used in
`iter_gitworktree()`. It concludes a series of refactoring that aligned
both implementations.

A top-level helper is monitored for reports on submodules. If pathspecs
are giving, an additional query, unconstrained by pathspecs, is made to
discover any submodules modified. For each such submodule, the given
pathspecs are ported to the scope of the submodule, and if matching,
a pathspec-constrained is generated for that submodule too.

In this fashion, `iter_gitdiff()` can report on pathspec-constrained
matches, where the constrained does not necessarily match the submodule
root.
Copy link

codecov bot commented Jul 15, 2024

Codecov Report

Attention: Patch coverage is 94.73684% with 2 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@de8855a). Learn more about missing BASE report.
Report is 33 commits behind head on main.

Files with missing lines Patch % Lines
datalad_next/iter_collections/gitdiff.py 93.75% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #747   +/-   ##
=======================================
  Coverage        ?   92.32%           
=======================================
  Files           ?      185           
  Lines           ?    14184           
  Branches        ?     2129           
=======================================
  Hits            ?    13095           
  Misses          ?      821           
  Partials        ?      268           

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

@mih mih merged commit e582c27 into datalad:main Jul 16, 2024
8 of 9 checks passed
@mih mih deleted the gitdiff branch July 16, 2024 06:57
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.

1 participant