mv prints absolute path instead of binary name on error
uutils mv:
$ mv foo Foo
/run/current-system/sw/bin/mv: cannot move 'foo' to a subdirectory of itself, 'Foo/foo'
GNU mv:
$ mv foo Foo
mv: cannot move 'foo' to a subdirectory of itself, 'Foo/foo'
uutils coreutils mv 0.0.30
I can't reproduce the test case here, but there is some difference in how the error message is displayed.
With uutils:
$ target/debug/mv a a
target/debug/mv: ...
With GNU:
$ /bin/mv a a
mv: ...
It looks like show! (and less directly, show_error!) is being used incorrectly here, and we should be manually specifying mv over the binary name. @sylvestre is it worth looking into other utils' behavior (or do you know off the top of your head) and potentially making another version of show_error!?
Oh, for the test case you need a case insensitive (sigh) filesystem. I'm on MacOS.
/bin/mv on MacOS guards against this case (there's a special code path to make it work), but GNU coreutils doesn't so we should get an identical error
I adjusted the test case to be case insensitive, and I do get the same error as you wrote, although it's elided in my previous comment. However, I couldn't reproduce uutils mv printing an absolute path unless it was specified in the command. I think the actual issue here is that GNU mv will never print a path, only the final component (If I move /bin/mv to ./mv2 and produce an error, GNU mv prints mv2).