nabijaczleweli / cargo-update

A cargo subcommand for checking and applying updates to installed executables
MIT License
1.22k stars 42 forks source link

Support net.git-fetch-with-cli as cargo does? #163

Closed PureWhiteWu closed 2 years ago

PureWhiteWu commented 3 years ago

See https://github.com/rust-lang/cargo/issues/2078.

I met the errors below when I'm using the internal registry based on gitlab(url is https://gitlab.example.com/namespace/internal-index, rsproxy.cn is a mirror of crates.io, just ignore it):

    Updating registry 'https://gitlab.example.com/namespace/internal-index'
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { code: -1, klass: 0, message: "no authentication available: failed to authenticate when downloading repository https://gitlab.example.com/namespace/internal-index (tried ssh-agent, but none of the following usernames worked: \"git\")" }', /home/purewhite/.cargo/registry/src/rsproxy.cn-8f6827c7555bfaf8/cargo-update-7.0.1/src/ops/mod.rs:1150:39
stack backtrace:
   0: rust_begin_unwind
             at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/panicking.rs:515:5
   1: core::panicking::panic_fmt
             at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/core/src/panicking.rs:92:14
   2: core::result::unwrap_failed
             at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/core/src/result.rs:1355:5
   3: cargo_update::ops::update_index
   4: cargo_install_update::actual_main
   5: cargo_install_update::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Seems that cargo-update is using libgit2 for index updating, which may cause problems in some cases.

Is there any plan to support net.git-fetch-with-cli?

nabijaczleweli commented 2 years ago

There, uh, wasn't, because I hadn't known it existed (well, it didn't exist when I wrote it)! But yes, this seems entirely feasible to implement.

PureWhiteWu commented 2 years ago

There, uh, wasn't, because I hadn't known it existed (well, it didn't exist when I wrote it)! But yes, this seems entirely feasible to implement.

Thank you very much, I think this is really necessary in our case. Sorry for not familiar with git, so maybe I'm not able to help with the implementation.

nabijaczleweli commented 2 years ago

Can you try current HEAD (at least 4717cb92400067cddf75e5d14a00d13bd4ac8340)?

PureWhiteWu commented 2 years ago

Wow, great! I will try this later when I arrived at company.

PureWhiteWu commented 2 years ago

Can you try current HEAD (at least 4717cb9)?

It works fine! Thank you very much!

nabijaczleweli commented 2 years ago

Great! Released in v8.0.0.