* `git mv` has ambiguous error message for non-existing target
@ 2012-11-15 18:54 Patrick Lehner
2012-11-16 1:34 ` Junio C Hamano
0 siblings, 1 reply; 5+ messages in thread
From: Patrick Lehner @ 2012-11-15 18:54 UTC (permalink / raw)
To: git
Hey guys,
as was brought up on #github today, the "git mv" command has a bit of a
little-helping output message when the target directory (or any
intermediate directories) dont exist.
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.
Expanding the error message to "No such file or directory: 'dirb/' "
would probably clear this up.
Best regards and thanks to anyone who could improve this,
Patrick
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: `git mv` has ambiguous error message for non-existing target
2012-11-15 18:54 `git mv` has ambiguous error message for non-existing target Patrick Lehner
@ 2012-11-16 1:34 ` Junio C Hamano
2012-11-16 7:10 ` Patrick Lehner
0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2012-11-16 1:34 UTC (permalink / raw)
To: Patrick Lehner; +Cc: git
Patrick Lehner <lehner.patrick@gmx.de> writes:
> 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 directory
It doesn't mention that the problem is with 'xxx' and not 'yyy'
either.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: `git mv` has ambiguous error message for non-existing target
2012-11-16 1:34 ` Junio C Hamano
@ 2012-11-16 7:10 ` Patrick Lehner
2012-11-17 19:35 ` Junio C Hamano
0 siblings, 1 reply; 5+ messages in thread
From: Patrick Lehner @ 2012-11-16 7:10 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
But just because mv's error essage isnt very good, does that mean git
mv's error message mustn't be better? That would strike me as an odd
bit of reasoning.
On Fr 16 Nov 2012 02:34:32 CET, Junio C Hamano wrote:
> Patrick Lehner <lehner.patrick@gmx.de> writes:
>
>> 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 directory
>
> It doesn't mention that the problem is with 'xxx' and not 'yyy'
> either.
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: `git mv` has ambiguous error message for non-existing target
2012-11-16 7:10 ` Patrick Lehner
@ 2012-11-17 19:35 ` Junio C Hamano
2012-11-19 21:07 ` Patrick Lehner
0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2012-11-17 19:35 UTC (permalink / raw)
To: Patrick Lehner; +Cc: git
Patrick Lehner <lehner.patrick@gmx.de> writes:
> But just because mv's error essage isnt very good, does that mean git
> mv's error message mustn't be better?
Did I say the error message from 'mv' was not very good in the
message you are responding to (by the way, this is why you should
never top-post when you are responding to a message on this list)?
I meant to say that the message from 'mv' is good enough, so is the
one given by 'git mv'.
I wouldn't reject a patch that updates our message to something more
informative without looking at it, though.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: `git mv` has ambiguous error message for non-existing target
2012-11-17 19:35 ` Junio C Hamano
@ 2012-11-19 21:07 ` Patrick Lehner
0 siblings, 0 replies; 5+ messages in thread
From: Patrick Lehner @ 2012-11-19 21:07 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
On Sa 17 Nov 2012 20:35:09 CET, Junio C Hamano wrote:
> Patrick Lehner <lehner.patrick@gmx.de> writes:
>
>> But just because mv's error essage isnt very good, does that mean git
>> mv's error message mustn't be better?
>
> Did I say the error message from 'mv' was not very good in the
> message you are responding to (by the way, this is why you should
> never top-post when you are responding to a message on this list)?
>
> I meant to say that the message from 'mv' is good enough, so is the
> one given by 'git mv'.
>
> I wouldn't reject a patch that updates our message to something more
> informative without looking at it, though.
I apologize for top-posting -- I don't usually use mailing lists and am
not aware of the usual netiquette.
And yes, I did interpret a bit more into your reply than was there.
I wouldn't call the 'mv' error message "good enough" in this case, but
very well, opinions may very well differ. Unfortunately, I have no time
to get into the git code and contribution guidelines, so I cannot
submit a patch myself. I would appreciate if someone else who shares my
sentiment and knows their way around the git source a bit could find
the time to add this :)
Regards,
Patrick
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-11-19 21:08 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-15 18:54 `git mv` has ambiguous error message for non-existing target Patrick Lehner
2012-11-16 1:34 ` Junio C Hamano
2012-11-16 7:10 ` Patrick Lehner
2012-11-17 19:35 ` Junio C Hamano
2012-11-19 21:07 ` Patrick Lehner
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.