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

Re: git-diff not showing changes (corrupt repo?)

From
Jeff King <peff@peff.net>
Date
Oct 2, 2007, 19:17 UTC
Message-ID
<20071002191737.GB7901@coredump.intra.peff.net>
In-Reply-To
<47029414.3080100@gmail.com>
On Tue, Oct 02, 2007 at 01:55:16PM -0500, Dan Zwell wrote:
> A small personal git repository has started lying to me about changed files. 
> git-diff sometimes tells me that the index has no changes from HEAD, while 
> other commands (git-status, at least) seem to tell the truth. It is the same 

Perhaps you are confused by the fact that "git-diff" with no options shows the difference between the index and the working tree? Did you try "git-diff --cached"?

> after I commit the new changes--at that point, "git-diff-tree HEAD^ HEAD -p" 
> spits out a nice patch, but "git-diff HEAD^ HEAD" gives nothing.

That doesn't seem right. Can you reproduce this, or at least show us the command you used?

Show 14 quoted lines
> $ git status
> # On branch bak_linear-checks3
> nothing to commit (working directory clean)
> $ echo "test" >> Makefile
> $ git status
> # On branch bak_linear-checks3
> # Changed but not updated:
> #   (use "git add <file>..." to update what will be committed)
> #
> #       modified:   Makefile
> #
> no changes added to commit (use "git add" and/or "git commit -a")
> $ git diff
> $

OK, that does seem wrong. If you run git-diff-files, does it produce the expected output?

-Peff
Previous: Linus Torvalds
Message 8 of 8 in “git-diff not showing changes (corrupt repo?)”
  1. Dan ZwellOct 2, 2007
  2. Junio C HamanoOct 2, 2007
  3. Dan ZwellOct 3, 2007
  4. Jeff KingOct 3, 2007
  5. Dan ZwellOct 3, 2007
  6. Jeff KingOct 3, 2007
  7. Linus TorvaldsOct 3, 2007
  8. Jeff KingOct 2, 2007

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.