Re: `git mv` has ambiguous error message for non-existing target
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 16, 2012, 01:34 UTC
- Message-ID
- <7vehju8h5j.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <50A53A80.4080203@gmx.de>
Patrick Lehner <lehner.patrick@gmx.de> writes:
Show 14 quoted lines
> To reproduce: > - cd into a git repo > - assuming "filea.txt" is an existing file in the CWD, and "dirb" is > neither a file nor a directory in the CWD, use the command "git mv > filea.txt dirb/filea.txt" > - this will produce an error message like `fatal: renaming 'filea.sh' > failed: No such file or directory` > > It does not mention that the problem is, in fact, the target directory > not existing. This seems to be mostly a problem for users unfamiliar > with bash/*nix console commands. Although it is documented that git mv > will not create intermediate folders (which is fine, because neither > does mv), the error message might lead to believe a problem exists > with the source file.
$ rm -fr xxx
$ >yyy
$ mv yyy xxx/yyy
mv: cannot move `yyy' to `xxx/yyy': No such file or directoryIt doesn't mention that the problem is with 'xxx' and not 'yyy' either.