Skip to content

Have gix-filter depend on gix-packetline-blocking unaliased #1940

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 1 commit into from
Apr 8, 2025

Conversation

EliahKagan
Copy link
Member

@EliahKagan EliahKagan commented Apr 8, 2025

This removes the gix-packetline-blocking/futures-lite "ghost feature" added in d5dd239 (#1939), and instead:

  • Changes gix-filter to depends on gix-packetline-blocking without aliasing it gix-packetline.
  • Replaces uses of gix_packetline with gix_packetline_blocking in the code of gix-filter.

Thus, this replaces the solution in #1939 for the problem discussed in #1929 (comment) with a different solution that avoids carrying a "ghost feature."

In contrast, the long-standing gix-packetline-blocking/async-io feature added in be4de0d (#1123), though it should not be used, is not removed, because:

  • It is referenced in attributes in gix-packetline-blocking code (because gix-packetline-blocking/src is copied from gix-packetline/src via etc/copy-packetline.sh).
  • For that reason, removing it would cause the clippy run in the CI lint job to fail, as well as likely making various other reasonable operations fail.

This PR proposes the alternative alluded to in #1939. As they are described in #1929 (comment), this replaces way (1) with way (2). At the time it seemed like combining them, i.e. way (3), could make sense, but I think the phantom nature of the feature, together with how gix-filter seems to be the only user of gix-packetline-blocking, indicates that it shouldn't be carried if it's not actually being used.

The reason I didn't go with this initially is that I am not sure I understand why gix-packetline-blocking was aliased gix-packetline when given as a dependency of gix-filter. If it was solely for the convenience of being able to write gix_packetline instead of gix_packetline_blocking, then I think the change here is an improvement. If there are deeper reasons, however, then I am not sure.

I think this could be done with use gix_packetline_blocking as gix_packetline;, but it didn't look like it would be better: it would have to be written in multiple places in the same file, due to the scope of use declarations in files that define multiple nested modules. (And maybe also related to special semantics for #[from]? But I am not sure about that.)

This removes the `gix-packetline-blocking/futures-lite` "ghost
feature" added in d5dd239 (GitoxideLabs#1939), and instead:

- Changes `gix-filter` to depends on `gix-packetline-blocking`
  without aliasing it `gix-packetline`.

- Replaces uses of `gix_packetline` with `gix_packetline_blocking`
  in the code of `gix-filter`.

Thus, this replaces the solution in GitoxideLabs#1939 for the problem discussed
in GitoxideLabs#1929 (comment)
with a different solution that avoids carrying a "ghost feature."

In contrast, the long-standing `gix-packetline-blocking/async-io`
feature added in be4de0d (GitoxideLabs#1123), though it should not be used,
is *not* removed, because:

- It is referenced in attributes in `gix-packetline-blocking` code
  (because `gix-packetline-blocking/src` is copied from
  `gix-packetline/src` via `etc/copy-packetline.sh`).

- For that reason, removing it would cause the `clippy` run in the
  CI `lint` job to fail, as well as likely making various other
  reasonable operations fail.
@EliahKagan EliahKagan marked this pull request as ready for review April 8, 2025 01:50
@EliahKagan EliahKagan requested a review from Byron April 8, 2025 01:50
@Byron
Copy link
Member

Byron commented Apr 8, 2025

Thanks so much, you are on fire!

The reason I didn't go with this initially is that I am not sure I understand why gix-packetline-blocking was aliased gix-packetline when given as a dependency of gix-filter. If it was solely for the convenience of being able to write gix_packetline instead of gix_packetline_blocking, then I think the change here is an improvement. If there are deeper reasons, however, then I am not sure.

Indeed, this was only for convenience, but given that it needs the blocking implementation, the code may as well reflect it.
Thus, this is certainly the preferred solution.

@Byron Byron enabled auto-merge April 8, 2025 02:04
@Byron Byron merged commit b34bdfa into GitoxideLabs:main Apr 8, 2025
21 of 22 checks passed
@EliahKagan EliahKagan deleted the run-ci/ghost-feature-next branch April 8, 2025 02:09
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.

2 participants