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

nu panics when using alias 'g' for git + push. #5179

Closed
antoniocorbi opened this issue Apr 13, 2022 · 14 comments
Closed

nu panics when using alias 'g' for git + push. #5179

antoniocorbi opened this issue Apr 13, 2022 · 14 comments
Labels
🐛 bug Something isn't working
Milestone

Comments

@antoniocorbi
Copy link

antoniocorbi commented Apr 13, 2022

Hi all,

I've got an alias for git like this:

alias g = git

And when I use it for pushing changes in any git repo, like this:

g push

I always get this error (nu panics):

thread 'main' panicked at 'internal error: span missing in file contents cache', crates/nu-protocol/src/engine/engine_state.rs:474:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

It doesn't panics with other git subcommands, i.e. 'pull':

g pull

Works ok.

@fdncred
Copy link
Collaborator

fdncred commented Apr 13, 2022

can you do version | to md and paste it so we know what environment you're in? i thought the bug issue form forced that.
are you using any custom completions?

@antoniocorbi
Copy link
Author

Sure! I clicked the submit button too fast!

version branch tag short_commit commit_hash commit_date build_os rust_version cargo_version pkg_version build_time build_rust_channel features installed_plugins
0.61.0 3783c19 3783c19 2022-04-12 20:38:15 +00:00 linux-x86_64 rustc 1.60.0 (Arch Linux rust 1:1.60.0-1) cargo 1.60.0 0.61.0 2022-04-12 23:20:08 +00:00 release dataframe, default, trash, which, zip

@fdncred
Copy link
Collaborator

fdncred commented Apr 13, 2022

oh, you're on the latest in linux. i'm on the windows and get the same error.

@fdncred fdncred added the 🐛 bug Something isn't working label Apr 13, 2022
@fdncred
Copy link
Collaborator

fdncred commented Apr 13, 2022

are you using any custom completions?

@antoniocorbi
Copy link
Author

are you using any custom completions?

Nope, very new to nushell, don't know how to do that.
I do use starship as my prompt customizer.

@antoniocorbi
Copy link
Author

antoniocorbi commented Apr 13, 2022

I've just checked that starship has nothing to do with this, I mean, without the starship-prompt the error remains.
I've also experimented this error compiling myself latest nushell on a raspberry pi4 with archlinux-arm + rust 1.60.0

@fdncred
Copy link
Collaborator

fdncred commented Apr 13, 2022

i don't use starship and have the same error so i don't think it's invovled either.

@filaretov
Copy link
Contributor

filaretov commented Apr 13, 2022

This is happening because git push is a known external, if you remove that, it works. I'll look into the issue, I just worked on that part of the code.

Apparently this was a problem before the recent changes too. Generally aliasing known externals behaves weirdly (and incorrectly).

@antoniocorbi
Copy link
Author

This is happening because git push is a known external, if you remove that, it works. I'll look into the issue, I just worked on that part of the code.

Apparently this was a problem before the recent changes too. Generally aliasing known externals behaves weirdly (and incorrectly).

Thanks for the info!
I don't know if this is somehow related...as I was having this problem I dediced to define another alias for 'git push' and I did this:

alias gp  = git push

In this case I get another error when using it:

❯ gp
Error: nu::shell::external_command (https://docs.rs/nu-protocol/0.61.0/nu_protocol/enum.ShellError.html#variant.ExternalCommand)

  × External command
   ╭─[entry #3:1:1]
 1 │ gp
   · ─┬
   ·  ╰── can't run executable
   ╰────
  help: No such file or directory (os error 2)

@filaretov
Copy link
Contributor

Yeah, this is related, thanks for pointing it out!

I'll take a look over the weekend, hopefully we'll get it fixed.

@filaretov
Copy link
Contributor

@antoniocorbi could you try the latest main? I think #5213 should have fixed the issue.

@antoniocorbi
Copy link
Author

@antoniocorbi could you try the latest main? I think #5213 should have fixed the issue.

Hi @filaretov !

It seems to be working for me right now, nu --version yields 0.61.1 and both aliases alias g = ... and alias gp = ... are behaving as expected.

Thanks for your help and support.

@filaretov
Copy link
Contributor

That's great to hear! Thanks for filing the issue and have fun with nushell.

@hustcer hustcer added this to the v0.62.0 milestone Apr 17, 2022
@fdncred
Copy link
Collaborator

fdncred commented Apr 17, 2022

nice, let's close this then.

@fdncred fdncred closed this as completed Apr 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants