{"thread":{"id":"30812","subject":"Confusing error message","startedAt":"2012-06-14T22:54:57Z","lastAt":"2012-06-14T23:18:04Z","messageCount":3,"participants":["Phil Hord","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"193675","messageId":"CABURp0qE+qJjyrhRFb8-gWucM0=3TpYwDBsnbCPrZNVe3QGQBQ@mail.gmail.com","threadId":"30812","inReplyTo":null,"subject":"Confusing error message","fromName":"Phil Hord","fromEmail":"phil.hord@gmail.com","sentAt":"2012-06-14T22:54:57Z","receivedAt":"2012-06-14T22:54:57Z","isPatch":false,"sender":{"key":"phil.hord@gmail.com","avatar":"https://avatars.githubusercontent.com/u/123908?v=4"},"body":"I messed something up during a rebase in a moved file (probably\nbecause I had rename detection turned off).  So now I want to fix it.\n\nI think I have the commit amended right, but to be sure I want to diff\nthe old file and the new file.\n\n  $ git diff newfile HEAD^:oldfile\n  fatal: Path 'oldfile' exists, but not 'oldfile'.\n  Did you mean 'HEAD^:oldfile' aka 'HEAD^:./oldfile'?\n\nThis was confusing, so I tried different variants. This one produced\nno output, suggesting no differences:\n\n  $ git diff -- newfile HEAD^:oldfile\n\nBut this one shows me that there are differences:\n\n  $ git diff HEAD^:oldfile newfile\n\nAnd so did this one:\n\n  $ git show HEAD -M\n\nAm I spelling the syntax wrong?  Is the <ref>:<path> syntax not\nallowed on diff?  If so, why all the inconsistency?\n\nIn case I am misreading something here, here is the unmolested command\nand output I am using:\n\n$ git diff Tasker_Servers/Server_Common/GuiConfig.h\nHEAD^:./Tasker_Servers/Server_CommonGui/GuiConfig.h\nfatal: Path 'Tasker_Servers/Server_CommonGui/GuiConfig.h' exists, but\nnot 'Tasker_Servers/Server_CommonGui/GuiConfig.h'.\nDid you mean 'HEAD^:Tasker_Servers/Server_CommonGui/GuiConfig.h' aka\n'HEAD^:./Tasker_Servers/Server_CommonGui/GuiConfig.h'?\n$ git --version\ngit version 1.7.11.rc3.219.g94bee05\n\nPhil\n"},{"id":"193676","messageId":"7v395xebal.fsf@alter.siamese.dyndns.org","threadId":"30812","inReplyTo":"CABURp0qE+qJjyrhRFb8-gWucM0=3TpYwDBsnbCPrZNVe3QGQBQ@mail.gmail.com","subject":"Re: Confusing error message","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-06-14T23:14:26Z","receivedAt":"2012-06-14T23:14:26Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Phil Hord <phil.hord@gmail.com> writes:\n\n> I messed something up during a rebase in a moved file (probably\n> because I had rename detection turned off).  So now I want to fix it.\n>\n> I think I have the commit amended right, but to be sure I want to diff\n> the old file and the new file.\n>\n>   $ git diff newfile HEAD^:oldfile\n>   fatal: Path 'oldfile' exists, but not 'oldfile'.\n>   Did you mean 'HEAD^:oldfile' aka 'HEAD^:./oldfile'?\n\nYou can feed two blob object names to \"git diff\", but I do not think\nthere is any provision to compare a blob object and a file in the\nworking tree.\n"},{"id":"193677","messageId":"7vy5npcwk3.fsf@alter.siamese.dyndns.org","threadId":"30812","inReplyTo":"7v395xebal.fsf@alter.siamese.dyndns.org","subject":"Re: Confusing error message","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-06-14T23:18:04Z","receivedAt":"2012-06-14T23:18:04Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Phil Hord <phil.hord@gmail.com> writes:\n>\n>> I messed something up during a rebase in a moved file (probably\n>> because I had rename detection turned off).  So now I want to fix it.\n>>\n>> I think I have the commit amended right, but to be sure I want to diff\n>> the old file and the new file.\n>>\n>>   $ git diff newfile HEAD^:oldfile\n>>   fatal: Path 'oldfile' exists, but not 'oldfile'.\n>>   Did you mean 'HEAD^:oldfile' aka 'HEAD^:./oldfile'?\n>\n> You can feed two blob object names to \"git diff\", but I do not think\n> there is any provision to compare a blob object and a file in the\n> working tree.\n\nAh, actually we do have a bolted-on hack to allow you feeding a blob\nand a file, but I think you still need to follow the command line\nconvention of subcommand name (=diff), any dashed options\n(e.g. \"-R\"), any object names (=HEAD^:oldfile) and then finally\npathnames (e.g. \"newfile\").\n\nDoes \"git diff -R HEAD^:oldfile newfile\" work?\n"}]}