Git Product home page Git Product logo

Comments (13)

stormasm avatar stormasm commented on August 22, 2024 1

@melMass I am seeing this bug on my mac Apple M1 Pro Ventura. @amtoine told me you had a mac (I think) so I would be curious to know if you are seeing the bug as well...
Thanks ! ๐Ÿ˜„

from nu-git-manager.

stormasm avatar stormasm commented on August 22, 2024 1

@melMass Thanks for testing it out when you get some free time...

If we can get confirmation that it happens on your mac as well then we will have more information
and I will know its just not my machine or some weird configuration on my machine.

from nu-git-manager.

stormasm avatar stormasm commented on August 22, 2024 1

@melMass @amtoine Ok so I spent awhile going over all of this stuff again and going with the default configuration etc...

What I did was install nupm and setup nupm as advertised first prior to installing nu-git-manager.
That may have been the magic sauce.

And the cache is now being created fine without crashing nushell...

The following sequence all works fine prior to cloning any repos

nupm install --path --force .
use nu-git-manager *
gm list
gm update-cache
gm list
gm status

At this point in time the cache exists....

However, when I

gm clone <some github repo>

and then run the command

gm update-cache

It crashes nushell at the same line of code as before

gm status

Shows the cache as false

~/.cache/nu-git-manager> 

is still there as before but cache.nuon is not there

from nu-git-manager.

stormasm avatar stormasm commented on August 22, 2024 1

Let me do some more work on my end chasing down possibly what is going on ๐Ÿ˜„

from nu-git-manager.

amtoine avatar amtoine commented on August 22, 2024

@stormasm
thanks for reporting this ๐Ÿ™

can you confirm you can reproduce, after updating nu-git-manager, when following the steps below? ๐Ÿ˜‡

  1. define the reproduction environment
const REPRO_ENV = { GIT_REPOS_HOME: /tmp/repos/, GIT_REPOS_CACHE: /tmp/repos.cache }
  1. clean the repro
with-env $REPRO_ENV {
    gm status | select root.path cache.path | values | each {
        if ($in | path exists) { rm --recursive --force --verbose $in }
    }
}
  1. clone a repo
> with-env $REPRO_ENV { gm clone https://github.com/amtoine/nu-git-manager }
Cloning into '/tmp/repos/github.com/amtoine/nu-git-manager'...
remote: Enumerating objects: 513, done.
remote: Counting objects: 100% (186/186), done.
remote: Compressing objects: 100% (87/87), done.
remote: Total 513 (delta 109), reused 133 (delta 81), pack-reused 327
Receiving objects: 100% (513/513), 125.76 KiB | 2.37 MiB/s, done.
Resolving deltas: 100% (235/235), done.
Error:   ร— cache_not_found:
  โ”‚ please run `gm update-cache` to create the cache
  1. update the cache as proposed
> with-env $REPRO_ENV { gm update-cache }
updating cache... done

Note
there a deprecation warning from Nushell in the output of the command above, but that's expected and can be ommitted

  1. it works on my side
> with-env $REPRO_ENV { gm list }
โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
0โ”‚github.com/amtoine/nu-git-manager
โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

from nu-git-manager.

stormasm avatar stormasm commented on August 22, 2024

@amtoine I followed the above steps as you proposed and here is what happens...

bottom line is that it crashes nushell ๐Ÿ‘Ž

in the exact same line of code as my previous attempt yesterday.

~/j/tmp17/nu-git-manager> use nu-git-manager *
~/j/tmp17/nu-git-manager> const REPRO_ENV = { GIT_REPOS_HOME: /tmp/repos/, GIT_REPOS_CACHE: /tmp/repos.cache }
~/j/tmp17/nu-git-manager> with-env $REPRO_ENV {
:::     gm status | select root.path cache.path | values | each {
:::         if ($in | path exists) { rm --recursive --force --verbose $in }
:::     }
::: }
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ empty list โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
~/j/tmp17/nu-git-manager> with-env $REPRO_ENV { gm clone https://github.com/amtoine/nu-git-manager }
Cloning into '/tmp/repos/github.com/amtoine/nu-git-manager'...
remote: Enumerating objects: 574, done.
remote: Counting objects: 100% (247/247), done.
remote: Compressing objects: 100% (107/107), done.
remote: Total 574 (delta 139), reused 210 (delta 115), pack-reused 327
Receiving objects: 100% (574/574), 136.27 KiB | 2.57 MiB/s, done.
Resolving deltas: 100% (265/265), done.
Error:   ร— cache_not_found:
  โ”‚ please run `gm update-cache` to create the cache


~/j/tmp17/nu-git-manager> with-env $REPRO_ENV { gm update-cache }
updating cache... Error:   ร— Deprecated option
    โ•ญโ”€[/Users/ma/j/tmp17/nu-git-manager/nu-git-manager/fs/store.nu:41:1]
 41 โ”‚     cd (get-repo-store-path)
 42 โ”‚     let heads: list<string> = glob "**/HEAD" --not [
    ยท                               โ”€โ”€โ”ฌโ”€
    ยท                                 โ•ฐโ”€โ”€ `glob --not {list<string>}` is deprecated and will be removed in 0.88.
 43 โ”‚             **/.git/**/refs/remotes/**/HEAD,
    โ•ฐโ”€โ”€โ”€โ”€
  help: Please use `glob --exclude {list<string>}` instead.


thread 'main' panicked at 'attempt to add with overflow', crates/nu-command/src/filters/range.rs:108:58
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

from nu-git-manager.

melMass avatar melMass commented on August 22, 2024

Maybe the exclude/not change is more than a future deprecation and is already defunct?

I will try to repro on windows.

from nu-git-manager.

melMass avatar melMass commented on August 22, 2024

@melMass I am seeing this bug on my mac Apple M1 Pro Ventura. @amtoine told me you had a mac (I think) so I would be curious to know if you are seeing the bug as well...

Thanks ! ๐Ÿ˜„

Yep I will properly test it out tomorrow I have the exact same config.
But I think that a panic should never happen so I wonder if this did not reveal a "bug" in nu itself

from nu-git-manager.

amtoine avatar amtoine commented on August 22, 2024

@stormasm thanks for checking with the blank $REPRO_ENV ๐Ÿ™

@melMass

Maybe the exclude/not change is more than a future deprecation and is already defunct?

i don't think this is an issue with the deprecation of glob --not => i cannot reproduce this on my machine yet i see the deprecation warning

Yep I will properly test it out tomorrow I have the exact same config.

amazing ๐Ÿ™

But I think that a panic should never happen so I wonder if this did not reveal a "bug" in nu itself

yup, i think this is a bug from Nushell, we don't even use range at all ๐Ÿ‘€

from nu-git-manager.

melMass avatar melMass commented on August 22, 2024

I started off by running

gm clone https://github.com/amtoine/nu-git-manager

Is this an example after having done all the install steps of gm and you used the gm repo url as an example?
I don't really understand the repro there.

For me after following the install instructions on mac I don't even get the update-cache command exposed:

image image

from nu-git-manager.

melMass avatar melMass commented on August 22, 2024

Ok I talked to @amtoine, the imports in the readme aren't up to date so I wasn't installing gm properly, my bad.

Now that I did it all works and I don't get any panic, I tried a few things to be sure.

I'm on nushell 0.86.0 on macOS Ventura 13.3.1
In config.nu:

use modules/nu-git-manager/nu-git-manager *

(this is just where I store my modules you path should be different)

@stormasm Do you by any chance use custom locations for the cache or the store? (GIT_REPOS_CACHE, GIT_REPOS_HOME)

from nu-git-manager.

stormasm avatar stormasm commented on August 22, 2024

Ok I talked to @amtoine, the imports in the readme aren't up to date so I wasn't installing gm properly, my bad.

Now that I did it all works and I don't get any panic, I tried a few things to be sure.

I'm on nushell 0.86.0 on macOS Ventura 13.3.1 In config.nu:

use modules/nu-git-manager/nu-git-manager *

(this is just where I store my modules you path should be different)

@stormasm Do you by any chance use custom locations for the cache or the store? (GIT_REPOS_CACHE, GIT_REPOS_HOME)

No I am not setting either of those environment variables

from nu-git-manager.

amtoine avatar amtoine commented on August 22, 2024

it turns out the issues comes from the build of @stormasm: it was in debug mode rather than in release mode ๐Ÿ˜ฎ

hopefully this will be catch in the future as we ask for the Nushell version in the bug report template ๐Ÿคž

as this is not an issue with nu-git-manager, i'll close it.
thanks y'all for looking into this and finally cracking the nut ๐Ÿ™

from nu-git-manager.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.