Skip to content

Enable running iter_annexworktree() on just-Git repos #673

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

Merged
merged 4 commits into from
Apr 26, 2024
Merged

Conversation

mih
Copy link
Member

@mih mih commented Apr 25, 2024

This fixes an obscure

iterable did not yield matching item for route-in item, cardinality mismatch?

error when attempting such a query before.

This fix is a choice. An alternative could be to error out in this case. I went for this approach, because the test is cheap, and not much more expensive than catching the previous error in a precise manner.

With this change, the items of the underlying gitworktree iterator are yielded, after funneling them through the annexworktree iteration post-processing to ensure type-alignment and other (future) side-effect. The outcome is therefore identical to items in Git yielded from an annex-enabled repository.

Closes: #670

TODO:

This fixes an obscure

`iterable did not yield matching item for route-in item, cardinality
mismatch?`

error when attempting such a query before.

This fix is a choice. An alternative could be to error out in this case.
I went for this approach, because the test is cheap, and not much more
expensive than catching the previous error in a precise manner.

With this change, the items of the underlying `gitworktree` iterator are
yielded, after funneling them through the `annexworktree` iteration
post-processing to ensure type-alignment and other (future) side-effect.
The outcome is therefore identical to items in Git yielded from an
annex-enabled repository.

Closes: datalad#670
@mih mih requested a review from christian-monch April 25, 2024 15:16
Copy link
Contributor

@christian-monch christian-monch left a comment

Choose a reason for hiding this comment

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

There is only one comment about "Yields" in doc-string, besides that it looks good to me.

@mih
Copy link
Member Author

mih commented Apr 25, 2024

Test failure is #674

mih added 3 commits April 26, 2024 08:09
It is likely useful to collect such functionality in a dedicated place
and a reusable form. Running such code repeatedly might be wasteful, so
eventually some kind of capability inference/caching layer could be
built. However, such layer would still use these basic helpers and
providing them avoid forcing client code to use heavy cannons in cases
where they are not needed.
@mih mih merged commit 57d73ca into datalad:main Apr 26, 2024
5 of 6 checks passed
@mih mih deleted the bf-670 branch April 26, 2024 18:54
@mih mih added this to the 1.4 milestone May 7, 2024
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.

ls-file-collection annexworktree: iterable did not yield matching item for route-in item
2 participants