{"thread":{"id":"32123","subject":"`git mv` has ambiguous error message for non-existing target","startedAt":"2012-11-15T18:54:56Z","lastAt":"2012-11-19T21:07:21Z","messageCount":5,"participants":["Patrick Lehner","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"203307","messageId":"50A53A80.4080203@gmx.de","threadId":"32123","inReplyTo":null,"subject":"`git mv` has ambiguous error message for non-existing target","fromName":"Patrick Lehner","fromEmail":"lehner.patrick@gmx.de","sentAt":"2012-11-15T18:54:56Z","receivedAt":"2012-11-15T18:54:56Z","isPatch":false,"sender":{"key":"lehner.patrick@gmx.de","avatar":null},"body":"Hey guys,\n\nas was brought up on #github today, the \"git mv\" command has a bit of a \nlittle-helping output message when the target directory (or any \nintermediate directories) dont exist.\n\nTo reproduce:\n- cd into a git repo\n- assuming \"filea.txt\" is an existing file in the CWD, and \"dirb\" is \nneither a file nor a directory in the CWD, use the command \"git mv \nfilea.txt dirb/filea.txt\"\n- this will produce an error message like `fatal: renaming 'filea.sh' \nfailed: No such file or directory`\n\nIt does not mention that the problem is, in fact, the target directory \nnot existing. This seems to be mostly a problem for users unfamiliar \nwith bash/*nix console commands. Although it is documented that git mv \nwill not create intermediate folders (which is fine, because neither \ndoes mv), the error message might lead to believe a problem exists with \nthe source file.\n\nExpanding the error message to \"No such file or directory: 'dirb/' \" \nwould probably clear this up.\n\nBest regards and thanks to anyone who could improve this,\nPatrick\n"},{"id":"203322","messageId":"7vehju8h5j.fsf@alter.siamese.dyndns.org","threadId":"32123","inReplyTo":"50A53A80.4080203@gmx.de","subject":"Re: `git mv` has ambiguous error message for non-existing target","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-11-16T01:34:32Z","receivedAt":"2012-11-16T01:34:32Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Patrick Lehner <lehner.patrick@gmx.de> writes:\n\n> To reproduce:\n> - cd into a git repo\n> - assuming \"filea.txt\" is an existing file in the CWD, and \"dirb\" is\n> neither a file nor a directory in the CWD, use the command \"git mv\n> filea.txt dirb/filea.txt\"\n> - this will produce an error message like `fatal: renaming 'filea.sh'\n> failed: No such file or directory`\n>\n> It does not mention that the problem is, in fact, the target directory\n> not existing. This seems to be mostly a problem for users unfamiliar\n> with bash/*nix console commands. Although it is documented that git mv\n> will not create intermediate folders (which is fine, because neither\n> does mv), the error message might lead to believe a problem exists\n> with the source file.\n\n    $ rm -fr xxx\n    $ >yyy\n    $ mv yyy xxx/yyy\n    mv: cannot move `yyy' to `xxx/yyy': No such file or directory\n\nIt doesn't mention that the problem is with 'xxx' and not 'yyy'\neither.\n"},{"id":"203333","messageId":"50A5E6D2.5060609@gmx.de","threadId":"32123","inReplyTo":"7vehju8h5j.fsf@alter.siamese.dyndns.org","subject":"Re: `git mv` has ambiguous error message for non-existing target","fromName":"Patrick Lehner","fromEmail":"lehner.patrick@gmx.de","sentAt":"2012-11-16T07:10:10Z","receivedAt":"2012-11-16T07:10:10Z","isPatch":false,"sender":{"key":"lehner.patrick@gmx.de","avatar":null},"body":"But just because mv's error essage isnt very good, does that mean git \nmv's error message mustn't be better? That would strike me as an odd \nbit of reasoning.\n\nOn Fr 16 Nov 2012 02:34:32 CET, Junio C Hamano wrote:\n> Patrick Lehner <lehner.patrick@gmx.de> writes:\n>\n>> To reproduce:\n>> - cd into a git repo\n>> - assuming \"filea.txt\" is an existing file in the CWD, and \"dirb\" is\n>> neither a file nor a directory in the CWD, use the command \"git mv\n>> filea.txt dirb/filea.txt\"\n>> - this will produce an error message like `fatal: renaming 'filea.sh'\n>> failed: No such file or directory`\n>>\n>> It does not mention that the problem is, in fact, the target directory\n>> not existing. This seems to be mostly a problem for users unfamiliar\n>> with bash/*nix console commands. Although it is documented that git mv\n>> will not create intermediate folders (which is fine, because neither\n>> does mv), the error message might lead to believe a problem exists\n>> with the source file.\n>\n>      $ rm -fr xxx\n>      $ >yyy\n>      $ mv yyy xxx/yyy\n>      mv: cannot move `yyy' to `xxx/yyy': No such file or directory\n>\n> It doesn't mention that the problem is with 'xxx' and not 'yyy'\n> either.\n>\n>\n"},{"id":"203434","messageId":"7vpq3cja4y.fsf@alter.siamese.dyndns.org","threadId":"32123","inReplyTo":"50A5E6D2.5060609@gmx.de","subject":"Re: `git mv` has ambiguous error message for non-existing target","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-11-17T19:35:09Z","receivedAt":"2012-11-17T19:35:09Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Patrick Lehner <lehner.patrick@gmx.de> writes:\n\n> But just because mv's error essage isnt very good, does that mean git\n> mv's error message mustn't be better?\n\nDid I say the error message from 'mv' was not very good in the\nmessage you are responding to (by the way, this is why you should\nnever top-post when you are responding to a message on this list)?\n\nI meant to say that the message from 'mv' is good enough, so is the\none given by 'git mv'.\n\nI wouldn't reject a patch that updates our message to something more\ninformative without looking at it, though.\n"},{"id":"203514","messageId":"50AA9F89.1050401@gmx.de","threadId":"32123","inReplyTo":"7vpq3cja4y.fsf@alter.siamese.dyndns.org","subject":"Re: `git mv` has ambiguous error message for non-existing target","fromName":"Patrick Lehner","fromEmail":"lehner.patrick@gmx.de","sentAt":"2012-11-19T21:07:21Z","receivedAt":"2012-11-19T21:07:21Z","isPatch":false,"sender":{"key":"lehner.patrick@gmx.de","avatar":null},"body":"On Sa 17 Nov 2012 20:35:09 CET, Junio C Hamano wrote:\n> Patrick Lehner <lehner.patrick@gmx.de> writes:\n>\n>> But just because mv's error essage isnt very good, does that mean git\n>> mv's error message mustn't be better?\n>\n> Did I say the error message from 'mv' was not very good in the\n> message you are responding to (by the way, this is why you should\n> never top-post when you are responding to a message on this list)?\n>\n> I meant to say that the message from 'mv' is good enough, so is the\n> one given by 'git mv'.\n>\n> I wouldn't reject a patch that updates our message to something more\n> informative without looking at it, though.\n\nI apologize for top-posting -- I don't usually use mailing lists and am \nnot aware of the usual netiquette.\n\nAnd yes, I did interpret a bit more into your reply than was there.\n\nI wouldn't call the 'mv' error message \"good enough\" in this case, but \nvery well, opinions may very well differ. Unfortunately, I have no time \nto get into the git code and contribution guidelines, so I cannot \nsubmit a patch myself. I would appreciate if someone else who shares my \nsentiment and knows their way around the git source a bit could find \nthe time to add this :)\n\nRegards,\nPatrick\n"}]}