jj
jj copied to clipboard
jj cat -R <repository> while not in repo produces misleading error message
Description
While not in a repository, an operation like jj cat -R <repository> <file> produces an error: Error: Path "<file>" is not in the repo.
I was confused for a bit before I realized that -R doesn't change the cwd.
Steps to Reproduce the Problem
- Clone a repo with jj, e.g. https://github.com/nextest-rs/nextest
- Without cding into the new directory, run e.g.
jj cat -R nextest README.md
Expected Behavior
It is correct to fail here, but a better error message would be
I checked what Mercurial does, and it produces a much better error:
% hg cat -R hg README.rst
abort: README.rst not under root '/home/rain/dev/hg'
(consider using '--cwd hg')
(I think this kind of thing is why --cwd was added to Mercurial, so it may make sense to also add that option to jj)
Actual Behavior
A somewhat misleading error: Error: Path "README.md" is not in the repo.
Specifications
- Platform: x86_64-unknown-linux-gnu
- Version: jj 0.14.0