Skip to content

FR: jj status should throw an error when the fileset does not exist #6556

@NoRePercussions

Description

@NoRePercussions

Is your feature request related to a problem? Please describe.

When I run jj diff stringthatmatchesnofiles, I get

$ jj diff stringthatmatchesnofiles
Warning: No matching entries for paths: stringthatmatchesnofiles

This is helpful! It suggests that I may have made a mistake (often, specifying a change id without -r).

When I do the same for jj status, I get

$ jj st stringthatmatchesnofiles
Working copy changes:
Working copy  (@) : xxxxxxxx bbbbbbbb (no description set)
Parent commit (@-): yyyyyyyy aaaaaaaa (no description set)

It identifies that no strings match, and then prints an empty changelog.

Reproducer:

jj git init
jj diff x
jj st x

Describe the solution you'd like

It would be more helpful to show a message that identifies the issue an suggests an alternative. jj show seems best: my initial reaction to jj st when I began was that if no arguments gave me the current change, maybe a different change ID would give me another change.

$ jj st x
Warning: No matching entries for paths: x
Maybe you want 'jj show x'?

Describe alternatives you've considered

There could also be a flag on jj st to cause this behavior, but I believe that's not helpful because anyone who knows of the flag is also likely to know how to properly use it to begin with. Then the error is not helpful as a discovery tool.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions