martinvonz / jj

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

`jj squash xyz` no longer warns that the revision was treated as a path #3981

Open mhammond opened 5 days ago

mhammond commented 5 days ago

Description

Steps to Reproduce the Problem

  1. Execute jj squash {some_changeid} instead of the intended -r {some_change_id}

Expected Behavior

jj takes no action (assuming the changeid isn't also a valid path) and prints a warning warning: The argument "xw" is being interpreted as a path. To specify a revset, pass -r "xw" instead.

Actual Behavior

jj prints output which looks a lot like the command completed as intended.

jj 0.18.0

See also #3334 - that report is different, but there you can see how jj used to print this warning.

yuja commented 4 days ago

This is caused by https://github.com/martinvonz/jj/pull/3602#discussion_r1584862457

Maybe we'll need a different condition for the warning.

arxanas commented 3 days ago

I'll also again propose https://github.com/martinvonz/jj/issues/3809 as a more principled workaround to resolve this issue, rather than adding the warning back in a few places in a whack-a-mole fashion

emilazy commented 3 days ago

+1 for principle – though I was actually going to suggest the opposite, always using -r for revisions. That avoids any glob issues and so many commands already use -r that I think it’d be an easy adjustment. Indeed, I feel like I only ever run into this kind of issue when I’m trying to second‐guess if this is one of the few commands that want revisions directly.