martinvonz / jj

A Git-compatible VCS that is both simple and powerful
https://martinvonz.github.io/jj/
Apache License 2.0
8.39k stars 289 forks source link

Panic for this minimal repo #1953

Closed sullyj3 closed 1 year ago

sullyj3 commented 1 year ago

Description

Inside this repo:

⮞ env RUST_BACKTRACE=1 jj status
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', lib/src/simple_op_store.rs:350:23
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic
   3: jj_lib::simple_op_store::ref_target_from_proto
   4: <jj_lib::simple_op_store::SimpleOpStore as jj_lib::op_store::OpStore>::read_view
   5: jj_lib::operation::Operation::view
   6: jj_lib::repo::RepoLoader::load_at
   7: jj_cli::cli_util::CommandHelper::workspace_helper_internal
   8: jj_cli::commands::run_command
   9: core::ops::function::FnOnce::call_once{{vtable.shim}}
  10: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
  11: jj_cli::cli_util::CliRunner::run
  12: jj::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

same for jj log.

Specifications

necauqua commented 1 year ago

On jj 0.8.0-04d120aad072762b617c46af875ab1d6f83d2ace that I have rn I get this So at least some of the improved error gives a bit more context

λ jj git clone https://github.com/sullyj3/jj-crash-repro-repo
Fetching into new repo in "/home/necauqua/jj-crash-repro-repo"
BUG: Working copy lock was dropped without being closed.
Internal error: Failed to check out commit 8a0682575ee2980ef482ad56225eb3c977922ec9: Failed to open file /home/necauqua/jj-crash-repro-repo/.jj/repo/index/e40a190e9011a7c71a08afdfb7809ccc5812ebb438e0778a37fa51f155c445d68785e8d61fdfe1ed18c00a095430d28d3ec7673eb855aa92f0531327c161039e for writing: Os { code: 17, kind: AlreadyExists, message: "File exists" }

Or can you even clone git repos with .jj folder committed?. :joy:

necauqua commented 1 year ago

Just cloning with Git and then removing the .git folder:

λ jj log
@  (r) sullyj3@gmail.com 2 hours ago bbac978
│  (empty) (no description set)
│ ◉  (n) sullyj3@gmail.com 2 hours ago @- 64bdee0
├─╯  (empty) (no description set)
◉  (l) sullyj3@gmail.com 2 hours ago main 7bca169
│  add asdf
~

I see an interesting branch name here :)

In oplog:

◉  bf56093c207b james@dorian 2 hours ago, lasted less than a microsecond
│  point branches main, @- to commit 64bdee0d88242a124f64932280538b07bb15639d
│  args: jj branch s main @-
martinvonz commented 1 year ago

We made a change to the repository format after 0.8.0. Older versions (such as 0.8.0) won't be able to read repos created with such versions. Could it be that you created that repo with a newer version and then downgraded to 0.8.0?

sullyj3 commented 1 year ago

I don't think so, but I could be wrong somehow. The only binary I've used is the one from nixpkgs revision fb942492b7accdee4e6d17f5447091c65897dde4. I started out using it in a nix shell nixpkgs#jujutsu then installed with home-manager, but I have it set up so that they use the same pinned revision.

I just double checked and the binaries installed with both methods are the same

# same result for both nix shell and home-manager version
⮞ sha1sum (realpath (which jj))
8a200782182034ec832764ad0b1ea2fa321d3196  /nix/store/031bfny391gqgafnwlnima4kqshrihql-jujutsu-0.8.0/bin/jj
necauqua commented 1 year ago

Well, whatever it is, it seems to be fixed in master

λ nix run nixpkgs#jujutsu -- log
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', lib/src/simple_op_store.rs:350:23
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

101λ jj log
@  (r) sullyj3@gmail.com 3 hours ago bbac978
│  (empty) (no description set)
│ ◉  (n) sullyj3@gmail.com 3 hours ago @- 64bdee0
├─╯  (empty) (no description set)
◉  (l) sullyj3@gmail.com 3 hours ago main 7bca169
│  add asdf
~
sullyj3 commented 1 year ago

I will switch to master! :)

sullyj3 commented 1 year ago

Yep, confirming fixed for me too.