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

Re: How do I get the correct modification status after running git diff?

From
Jjateeq <jawad_atiq@hotmail.com>
Date
Mar 4, 2010, 16:11 UTC
Message-ID
<27782895.post@talk.nabble.com>
In-Reply-To
<27782430.post@talk.nabble.com>

Ok, so I think I know what I was doing wrong... i wasn't comparing the working tree with the last commit (HEAD), although I still don't know what exactly I was comparing the working tree with. On reading the manual a little more carefully, I realised the command should have been:

git diff -M --name-status HEAD

This solves the problem of newly added files, but doesn't show 'R' for renamed files even after I ask git to detect renamed files - just shows that the renamed file was deleted (doesn't detect that the new renamed file was added). So I would still appreciate some input here.

Renaming flie: mv randomfile.xml random.xml

Diffing: git diff -M --name-status HEAD

Output: D randomfile.xml

Thanks, jawad

-- 
View this message in context: http://old.nabble.com/How-do-I-get-the-correct-modification-status-after-running-git-diff--tp27782430p27782895.html
Sent from the git mailing list archive at Nabble.com.
Previous: jateeqNext: Michael J Gruber
Message 2 of 4 in “How do I get the correct modification status after running git diff?”
  1. jateeqMar 4, 2010
  2. jateeqMar 4, 2010
  3. Michael J GruberMar 4, 2010
  4. Andreas SchwabMar 4, 2010

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.