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

Suggest cargo install --git when missing registry package looks like a git* URL #10522

Commits on Apr 1, 2022

  1. Fix rust-lang#10485

    Heuristically identify git URL by matching the pattern
    "git" in the domain.
    
    Add a special case error with a fixit hint to help users
    rerun the correct cargo install command
    petr-tik committed Apr 1, 2022
    Configuration menu
    Copy the full SHA
    b87ae28 View commit details
    Browse the repository at this point in the history
  2. Refactor select_dep_pkg error handling

    Create a local Error type that that wraps existing error handling code
    
    Giving the three error variants names improves readability and
    makes it easier to recognise duplicate code
    
    Move all string operations to create errors from 3
    separate bail! calls into anyhow::anyhow! calls
    that are encapsulated in the From<> impl
    petr-tik committed Apr 1, 2022
    Configuration menu
    Copy the full SHA
    174c80e View commit details
    Browse the repository at this point in the history

Commits on Apr 12, 2022

  1. Revert "Refactor select_dep_pkg error handling"

    This reverts commit 174c80e.
    petr-tik committed Apr 12, 2022
    Configuration menu
    Copy the full SHA
    869973f View commit details
    Browse the repository at this point in the history
  2. Merge remote-tracking branch 'upstream/master' into n10485_install_fr…

    …om_git_error_message_alternative_impl
    petr-tik committed Apr 12, 2022
    Configuration menu
    Copy the full SHA
    e045b4f View commit details
    Browse the repository at this point in the history

Commits on Apr 13, 2022

  1. Experiment with GitUrl to generate the suggestion

    Add a test case for a git@ repo and refactor the method to
    return Option<String> instead of bool.
    
    Reword the suggestion to follow rustc guidelines
    petr-tik committed Apr 13, 2022
    Configuration menu
    Copy the full SHA
    1c9c53b View commit details
    Browse the repository at this point in the history
  2. Fix the tests

    Make GitUrl parsing and normalisation defensive.
    
    Create a type for InstallSuggestion and pass it to the
    anyhow error message
    petr-tik committed Apr 13, 2022
    Configuration menu
    Copy the full SHA
    ef7ee2c View commit details
    Browse the repository at this point in the history

Commits on Aug 20, 2023

  1. Merge remote-tracking branch 'upstream/master' into n10485_install_fr…

    …om_git_error_message_alternative_impl
    petr-tik committed Aug 20, 2023
    Configuration menu
    Copy the full SHA
    e018509 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    283c6e8 View commit details
    Browse the repository at this point in the history

Commits on Aug 21, 2023

  1. Replace git-url-parse with gix::url::parse

    Keep the dependency try the same by leveraging
    already imported gix crate to try parsing
    a git url from a string
    petr-tik committed Aug 21, 2023
    Configuration menu
    Copy the full SHA
    ddea258 View commit details
    Browse the repository at this point in the history
  2. Limit the actionable error to install https inputs

    Since I opened the PR, cargo started supporting `crate@version`
    command-line inputs
    rust-lang@2806270
    
    and now the test input `git@bitbucket.org:jcmoyer/rust-tictactoe.git` is
    parsed as a version string, which fails
    
    the code path I added only deals with strings that weren't erroneously
    parsed as version strings, so the section I highlighted above won't be
    traversed, because `git@` strings now fail to parse as version strings
    before they get here.
    
    Delete the failing test
    petr-tik committed Aug 21, 2023
    Configuration menu
    Copy the full SHA
    f08e95b View commit details
    Browse the repository at this point in the history