git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Confusing error message

From
Phil Hord <phil.hord@gmail.com>
Date
Jun 14, 2012, 22:54 UTC
Message-ID
<CABURp0qE+qJjyrhRFb8-gWucM0=3TpYwDBsnbCPrZNVe3QGQBQ@mail.gmail.com>

I messed something up during a rebase in a moved file (probably because I had rename detection turned off). So now I want to fix it.

I think I have the commit amended right, but to be sure I want to diff the old file and the new file.

  $ git diff newfile HEAD^:oldfile
  fatal: Path 'oldfile' exists, but not 'oldfile'.
  Did you mean 'HEAD^:oldfile' aka 'HEAD^:./oldfile'?

This was confusing, so I tried different variants. This one produced no output, suggesting no differences:

  $ git diff -- newfile HEAD^:oldfile
But this one shows me that there are differences:
  $ git diff HEAD^:oldfile newfile
And so did this one:
  $ git show HEAD -M

Am I spelling the syntax wrong? Is the <ref>:<path> syntax not allowed on diff? If so, why all the inconsistency?

In case I am misreading something here, here is the unmolested command and output I am using:

$ git diff Tasker_Servers/Server_Common/GuiConfig.h HEAD^:./Tasker_Servers/Server_CommonGui/GuiConfig.h fatal: Path 'Tasker_Servers/Server_CommonGui/GuiConfig.h' exists, but not 'Tasker_Servers/Server_CommonGui/GuiConfig.h'. Did you mean 'HEAD^:Tasker_Servers/Server_CommonGui/GuiConfig.h' aka 'HEAD^:./Tasker_Servers/Server_CommonGui/GuiConfig.h'? $ git --version git version 1.7.11.rc3.219.g94bee05

Phil
Next: Junio C Hamano
Message 1 of 3 in “Confusing error message”
  1. Phil HordJun 14, 2012
  2. Junio C HamanoJun 14, 2012
  3. Junio C HamanoJun 14, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.