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

feature: Add new crate gix-macros #992

Merged
merged 29 commits into from
Sep 7, 2023
Merged

Commits on Aug 26, 2023

  1. Add new crate gix-macros

    proc-macro crates, it provides `momo` for de-monomorphization for now.
    
    Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
    NobodyXu committed Aug 26, 2023
    Configuration menu
    Copy the full SHA
    6dae9e9 View commit details
    Browse the repository at this point in the history
  2. Apply momo to mod gix::discover

    to:
     - `ThreadSafeRepository::discover_opts`
     - `ThreadSafeRepository::discover_with_environment_overrides_opts`
    
    Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
    NobodyXu committed Aug 26, 2023
    Configuration menu
    Copy the full SHA
    58fbb08 View commit details
    Browse the repository at this point in the history
  3. Apply momo to mod gix::init

    to:
     - `ThreadSafeRepository::init`
     - `ThreadSafeRepository::init_opts`
    
    Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
    NobodyXu committed Aug 26, 2023
    Configuration menu
    Copy the full SHA
    46a9dfe View commit details
    Browse the repository at this point in the history
  4. Apply momo to gix::object::tree

    to:
     - `Tree<'_>::lookup_entry_by_path`
     - `Tree<'_>::peel_to_entry_by_path`
    
    Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
    NobodyXu committed Aug 26, 2023
    Configuration menu
    Copy the full SHA
    d835526 View commit details
    Browse the repository at this point in the history
  5. Apply momo to mod gix::open::repository

    to:
     - `ThreadSafeRepository::open_opts`
     - `ThreadSafeRepository::open_with_environment_overrides`
    
    Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
    NobodyXu committed Aug 26, 2023
    Configuration menu
    Copy the full SHA
    3ce0144 View commit details
    Browse the repository at this point in the history
  6. Apply momo to gix::pathspec

    to:
     - `Pathspec<'_>::pattern_matching_relative_path`
     - `Pathspec<'_>::is_included`
    
    Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
    NobodyXu committed Aug 26, 2023
    Configuration menu
    Copy the full SHA
    767ec2d View commit details
    Browse the repository at this point in the history
  7. Apply momo to gix::reference

    to:
     - `set_target_id`
     - `Platform<'_>::prefixed`
    
    Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
    NobodyXu committed Aug 26, 2023
    Configuration menu
    Copy the full SHA
    3c205ab View commit details
    Browse the repository at this point in the history
  8. Apply momo to mod remote::connection::fetch::receive_pack

    to `receive`
    
    Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
    NobodyXu committed Aug 26, 2023
    Configuration menu
    Copy the full SHA
    ea5c2db View commit details
    Browse the repository at this point in the history
  9. Apply momo to mod gix::repository

    to:
     - `Repository::transport_options`
     - `Repository::find_object`
     - `Repository::try_find_object`
     - `Repository::find_head`
     - `Repository::try_find_head`
     - `Repository::tag`
     - `Repository::tag_reference`
     - `Repository::try_find_remote`
     - `Repository::try_find_remote_without_url_rewrite`
     - `Repository::rev_parse`
     - `Repository::worktree_stream`
    
    Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
    NobodyXu committed Aug 26, 2023
    Configuration menu
    Copy the full SHA
    5a50537 View commit details
    Browse the repository at this point in the history
  10. Fix clippy lints in gix/src/repository/remote.rs

    Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
    NobodyXu committed Aug 26, 2023
    Configuration menu
    Copy the full SHA
    ff210d8 View commit details
    Browse the repository at this point in the history

Commits on Aug 28, 2023

  1. Manually de-momo Repository::try_find_remote_{without_url_rewrite}

    Since the `try_find_remote_inner` is already a separate function,
    there's no need to use `momo`.
    
    Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
    NobodyXu committed Aug 28, 2023
    Configuration menu
    Copy the full SHA
    e760225 View commit details
    Browse the repository at this point in the history

Commits on Aug 29, 2023

  1. Remove TryInto support from gix_macros::momo

    Part of the reason is that `impl TryInto` isn't as common as `AsRef`, `AsMut` or
    `Into`, but also because its error handling logic is much harder to parse and
    replace in the inner function.
    
    Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
    NobodyXu committed Aug 29, 2023
    Configuration menu
    Copy the full SHA
    95a1626 View commit details
    Browse the repository at this point in the history
  2. Dramatically simplify gix_macros::momo

    And make applying support of `gix_macros::momo` truly painless by making
    it work out-of-the-box.
    
    Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
    NobodyXu committed Aug 29, 2023
    Configuration menu
    Copy the full SHA
    c72eaa0 View commit details
    Browse the repository at this point in the history
  3. Remove unnecessary #[allow(clippy::needless_lifetimes)]

    Thanks for new internal of `gix_macros::momo`!
    
    Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
    NobodyXu committed Aug 29, 2023
    Configuration menu
    Copy the full SHA
    e1b9d51 View commit details
    Browse the repository at this point in the history
  4. Remove unnecessary change in repository/config/transport.rs

    Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
    NobodyXu committed Aug 29, 2023
    Configuration menu
    Copy the full SHA
    86b8e50 View commit details
    Browse the repository at this point in the history
  5. feat momo: Support parsing pattern in params

    So that we can slap it on more functions.
    
    Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
    NobodyXu committed Aug 29, 2023
    Configuration menu
    Copy the full SHA
    b5f78be View commit details
    Browse the repository at this point in the history
  6. feat momo: Rm unnecessary #[allow(unused_mut)] on generated inner fn

    Now that the inner function is actually identical to the original
    function before passed into `momo`, except for visibility, function name
    and the lack of function doc.
    
    Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
    NobodyXu committed Aug 29, 2023
    Configuration menu
    Copy the full SHA
    b619456 View commit details
    Browse the repository at this point in the history
  7. Rm unnecessary #[allow(unused_mut)] put on momoed functions

    Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
    NobodyXu committed Aug 29, 2023
    Configuration menu
    Copy the full SHA
    89ae797 View commit details
    Browse the repository at this point in the history
  8. Apply momo to mod gix::create::into

    Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
    NobodyXu committed Aug 29, 2023
    Configuration menu
    Copy the full SHA
    cd3c289 View commit details
    Browse the repository at this point in the history
  9. Apply momo to mod config::snapshot::access

    Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
    NobodyXu committed Aug 29, 2023
    Configuration menu
    Copy the full SHA
    25912fe View commit details
    Browse the repository at this point in the history
  10. Apply momo to fn gix::revision::Spec::from_bstr

    Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
    NobodyXu committed Aug 29, 2023
    Configuration menu
    Copy the full SHA
    1d90301 View commit details
    Browse the repository at this point in the history
  11. Apply momo to fn gix::Remote::save_as_to

    Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
    NobodyXu committed Aug 29, 2023
    Configuration menu
    Copy the full SHA
    875c287 View commit details
    Browse the repository at this point in the history

Commits on Sep 2, 2023

  1. refactor

    Byron committed Sep 2, 2023
    Configuration menu
    Copy the full SHA
    48a2088 View commit details
    Browse the repository at this point in the history
  2. improve docs

    Byron committed Sep 2, 2023
    Configuration menu
    Copy the full SHA
    705f2f3 View commit details
    Browse the repository at this point in the history
  3. Remove TODO in gix-macros/src/lib.rs

    Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
    NobodyXu committed Sep 2, 2023
    Configuration menu
    Copy the full SHA
    c4ed7c1 View commit details
    Browse the repository at this point in the history

Commits on Sep 3, 2023

  1. Add test-suite for failure modes

    Also, discover that apparently `momo` isn't effective where it should be
    *or* the implementation is more complex.
    Byron committed Sep 3, 2023
    Configuration menu
    Copy the full SHA
    c8e7324 View commit details
    Browse the repository at this point in the history

Commits on Sep 7, 2023

  1. Fix ui test error_if_ineffective

    `ty_conversions` only cover named generics, it doesn't cover
    `impl Trait`.
    
    I also changed the span for the error to `call_site`, otherwise it would
    show that the `compile_error!` comes from the comment, which is
    impossible.
    
    Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
    NobodyXu committed Sep 7, 2023
    Configuration menu
    Copy the full SHA
    9be2622 View commit details
    Browse the repository at this point in the history
  2. Revert to use item_fn.span()

    Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
    NobodyXu committed Sep 7, 2023
    Configuration menu
    Copy the full SHA
    72545e9 View commit details
    Browse the repository at this point in the history
  3. consolidate compile tests

    Byron committed Sep 7, 2023
    Configuration menu
    Copy the full SHA
    d76efdd View commit details
    Browse the repository at this point in the history