{"thread":{"id":"10119","subject":"git-diff not showing changes (corrupt repo?)","startedAt":"2007-10-02T18:55:16Z","lastAt":"2007-10-03T04:38:56Z","messageCount":8,"participants":["Dan Zwell","Junio C Hamano","Jeff King","Linus Torvalds"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"54580","messageId":"47029414.3080100@gmail.com","threadId":"10119","inReplyTo":null,"subject":"git-diff not showing changes (corrupt repo?)","fromName":"Dan Zwell","fromEmail":"dzwell@gmail.com","sentAt":"2007-10-02T18:55:16Z","receivedAt":"2007-10-02T18:55:16Z","isPatch":false,"sender":{"key":"dzwell@gmail.com","avatar":null},"body":"Hi,\nA small personal git repository has started lying to me about changed \nfiles. git-diff sometimes tells me that the index has no changes from \nHEAD, while other commands (git-status, at least) seem to tell the \ntruth. It is the same after I commit the new changes--at that point, \n\"git-diff-tree HEAD^ HEAD -p\" spits out a nice patch, but \"git-diff \nHEAD^ HEAD\" gives nothing.\n\nI have tried git versions 1.5.1.6-1.5.3.3, and they all act the same, so \nI think the repository is corrupt. Does sound familiar to anybody? If \nthis is user error (for example, \"git-reset --hard HEAD^\" on a branch \nthat had already been pulled into another branch), I can restore from a \nrecent backup and redo some changes, but I would like to help \ntroubleshoot this behavior if it is a git bug. Is this a known behavior? \ngit-fsck doesn't reveal anything amiss, besides dangling objects. Does \nanybody know anything about this situation or what can cause it?\n\n\nExample of behavior:\n\n$ git status\n# On branch bak_linear-checks3\nnothing to commit (working directory clean)\n$ echo \"test\" >> Makefile\n$ git status\n# On branch bak_linear-checks3\n# Changed but not updated:\n#   (use \"git add <file>...\" to update what will be committed)\n#\n#       modified:   Makefile\n#\nno changes added to commit (use \"git add\" and/or \"git commit -a\")\n$ git diff\n$\n\nThanks,\nDan\n"},{"id":"54584","messageId":"7vbqbhl44h.fsf@gitster.siamese.dyndns.org","threadId":"10119","inReplyTo":"47029414.3080100@gmail.com","subject":"Re: git-diff not showing changes (corrupt repo?)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-10-02T19:15:42Z","receivedAt":"2007-10-02T19:15:42Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Dan Zwell <dzwell@gmail.com> writes:\n\n> ... It is the same after I commit the new changes--at that point,\n> \"git-diff-tree HEAD^ HEAD -p\" spits out a nice patch, but \"git-diff\n> HEAD^ HEAD\" gives nothing.\n\nThis part is most interesting.  They are both about comparing\ntwo commits and do not interact with anything in the work tree\nnor your index.\n\n> I have tried git versions 1.5.1.6-1.5.3.3, and they all act the same,\n\nDo you mean 1.5.1.5 was Ok?  Can you bisect it?\n\n> so I think the repository is corrupt. Does sound familiar to anybody?\n\nNot to me; and I do not think repository is corrupt from the two\n\"HEAD^ vs HEAD\" diff.  There is something entirely different\ngoing on.\n\n> ... I can\n> restore from a recent backup and redo some changes, but I would like\n> to help troubleshoot this behavior if it is a git bug.\n\nThanks.\n"},{"id":"54585","messageId":"20071002191737.GB7901@coredump.intra.peff.net","threadId":"10119","inReplyTo":"47029414.3080100@gmail.com","subject":"Re: git-diff not showing changes (corrupt repo?)","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2007-10-02T19:17:37Z","receivedAt":"2007-10-02T19:17:37Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Oct 02, 2007 at 01:55:16PM -0500, Dan Zwell wrote:\n\n> A small personal git repository has started lying to me about changed files. \n> git-diff sometimes tells me that the index has no changes from HEAD, while \n> other commands (git-status, at least) seem to tell the truth. It is the same \n\nPerhaps you are confused by the fact that \"git-diff\" with no options\nshows the difference between the index and the working tree? Did you try\n\"git-diff --cached\"?\n\n> after I commit the new changes--at that point, \"git-diff-tree HEAD^ HEAD -p\" \n> spits out a nice patch, but \"git-diff HEAD^ HEAD\" gives nothing.\n\nThat doesn't seem right. Can you reproduce this, or at least show us the\ncommand you used?\n\n> $ git status\n> # On branch bak_linear-checks3\n> nothing to commit (working directory clean)\n> $ echo \"test\" >> Makefile\n> $ git status\n> # On branch bak_linear-checks3\n> # Changed but not updated:\n> #   (use \"git add <file>...\" to update what will be committed)\n> #\n> #       modified:   Makefile\n> #\n> no changes added to commit (use \"git add\" and/or \"git commit -a\")\n> $ git diff\n> $\n\nOK, that does seem wrong. If you run git-diff-files, does it produce the\nexpected output?\n\n-Peff\n"},{"id":"54643","messageId":"470309D5.702@gmail.com","threadId":"10119","inReplyTo":"7vbqbhl44h.fsf@gitster.siamese.dyndns.org","subject":"Re: git-diff not showing changes (corrupt repo?)","fromName":"Dan Zwell","fromEmail":"dzwell@gmail.com","sentAt":"2007-10-03T03:17:41Z","receivedAt":"2007-10-03T03:17:41Z","isPatch":false,"sender":{"key":"dzwell@gmail.com","avatar":null},"body":"Junio C Hamano wrote:\n > Dan Zwell <dzwell@gmail.com> writes:\n >\n >> ... It is the same after I commit the new changes--at that point,\n >> \"git-diff-tree HEAD^ HEAD -p\" spits out a nice patch, but \"git-diff\n >> HEAD^ HEAD\" gives nothing.\n >\n > This part is most interesting.  They are both about comparing\n > two commits and do not interact with anything in the work tree\n > nor your index.\n >\n > ... Can you bisect it?\n >\nI bisected twice to be sure, and have CC'd Martin Waitz on this (the \nissue is that some of my changes in a local repo are not being displayed \nby git-diff, either before or after they are committed, but git-status, \ngit-whatchanged, and git-diff-tree all see that changes have been \ncommitted, and git-diff-files does see uncommitted changes).\n\ne88ee2915493213ea0d0be64c542c090fefd4b33 is first bad commit\ncommit e88ee2915493213ea0d0be64c542c090fefd4b33\nAuthor: Martin Waitz <tali@admingilde.org>\nDate:   Tue Oct 10 21:16:25 2006 +0200\n\n     paginate git-diff by default\n\nI discovered this problem on my 64 bit machine, but the problem does not \noccur on my 32 bit machine. That is not the only difference between the \ntwo computers, but it seems the most obvious culprit. The 64 bit machine \nmay have different libraries than the other, as they are running \ndifferent distros.\n\nI noticed that this is a rather old (and very small) patch, and I don't \nquite understand how it could cause this problem. I could not revert the \npatch to fix the problem. I placed a stripped down version of the \nrepository here: http://zwell.net/git-error.tar.gz. The problem is very \neasy to observe on my machine, though it looks like some machines do not \nexhibit it. What else can I do to help?\n\nDan\n"},{"id":"54644","messageId":"20071003032331.GA11638@coredump.intra.peff.net","threadId":"10119","inReplyTo":"470309D5.702@gmail.com","subject":"Re: git-diff not showing changes (corrupt repo?)","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2007-10-03T03:23:31Z","receivedAt":"2007-10-03T03:23:31Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Oct 02, 2007 at 10:17:41PM -0500, Dan Zwell wrote:\n\n> e88ee2915493213ea0d0be64c542c090fefd4b33 is first bad commit\n> commit e88ee2915493213ea0d0be64c542c090fefd4b33\n> Author: Martin Waitz <tali@admingilde.org>\n> Date:   Tue Oct 10 21:16:25 2006 +0200\n>\n>     paginate git-diff by default\n\nThe only thing this patch does is run the pager, so presumably git-diff\n_is_ generating output, but calling the pager is broken for some reason.\nWhat is the value of $GIT_PAGER and $PAGER on the broken and working\nmachines? Can you confirm that the pager works on both machines?\n\n> I discovered this problem on my 64 bit machine, but the problem does not \n> occur on my 32 bit machine. That is not the only difference between the two \n> computers, but it seems the most obvious culprit. The 64 bit machine may \n> have different libraries than the other, as they are running different \n> distros.\n\nI couldn't reproduce on my 32-bit or 64-bit machine (the former running\nDebian unstable, the latter Debian stable). But given the patch you\nbisected to, I think it is more likely that your pager is broken on the\n64-bit machine.\n\n-Peff\n"},{"id":"54645","messageId":"alpine.LFD.0.999.0710022041340.3579@woody.linux-foundation.org","threadId":"10119","inReplyTo":"470309D5.702@gmail.com","subject":"Re: git-diff not showing changes (corrupt repo?)","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2007-10-03T03:44:01Z","receivedAt":"2007-10-03T03:44:01Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Tue, 2 Oct 2007, Dan Zwell wrote:\n>\n> I bisected twice to be sure, and have CC'd Martin Waitz on this (the issue is\n> that some of my changes in a local repo are not being displayed by git-diff,\n> either before or after they are committed, but git-status, git-whatchanged,\n> and git-diff-tree all see that changes have been committed, and git-diff-files\n> does see uncommitted changes).\n> \n> e88ee2915493213ea0d0be64c542c090fefd4b33 is first bad commit\n\nYou most likely have a very buggy \"less\".\n\nTry this:\n\n\techo hello | less -FRSX\n\non the command line. Do you see the \"hello\"?\n\n(The above is assuming you haven't set GIT_PAGER, PAGER or the LESS \nvariables manually to something else)\n\n\t\tLinus\n"},{"id":"54646","messageId":"470313D0.7020808@gmail.com","threadId":"10119","inReplyTo":"20071003032331.GA11638@coredump.intra.peff.net","subject":"Re: git-diff not showing changes (corrupt repo?)","fromName":"Dan Zwell","fromEmail":"dzwell@gmail.com","sentAt":"2007-10-03T04:00:16Z","receivedAt":"2007-10-03T04:00:16Z","isPatch":false,"sender":{"key":"dzwell@gmail.com","avatar":null},"body":"Jeff King wrote:\n > On Tue, Oct 02, 2007 at 10:17:41PM -0500, Dan Zwell wrote:\n >\n >> e88ee2915493213ea0d0be64c542c090fefd4b33 is first bad commit\n >> commit e88ee2915493213ea0d0be64c542c090fefd4b33\n >> Author: Martin Waitz <tali@admingilde.org>\n >> Date:   Tue Oct 10 21:16:25 2006 +0200\n >>\n >>     paginate git-diff by default\n >\n > The only thing this patch does is run the pager, so presumably git-diff\n > _is_ generating output, but calling the pager is broken for some reason.\n > What is the value of $GIT_PAGER and $PAGER on the broken and working\n > machines? Can you confirm that the pager works on both machines?\n >\n\nYou're absolutely right, my pager was being called and exiting. My \nsystem configuration must be dodgy, because \"echo hi | less \n--quit-if-one-screen\" does not display anything unless it in run in \n\"screen\". But that's not git's fault, and I just need different options, \nfor now. Thanks a lot for helping me solve this.\n\nDan\n\n >\n > -Peff\n >\n"},{"id":"54651","messageId":"20071003043856.GC11905@coredump.intra.peff.net","threadId":"10119","inReplyTo":"470313D0.7020808@gmail.com","subject":"Re: git-diff not showing changes (corrupt repo?)","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2007-10-03T04:38:56Z","receivedAt":"2007-10-03T04:38:56Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Oct 02, 2007 at 11:00:16PM -0500, Dan Zwell wrote:\n\n> You're absolutely right, my pager was being called and exiting. My system \n> configuration must be dodgy, because \"echo hi | less --quit-if-one-screen\" \n> does not display anything unless it in run in \"screen\". But that's not git's \n\nThis is obviously getting into less debugging (about which I know\nlittle), but it's possible that you have a bogus TERM setting.\n\n> fault, and I just need different options, for now. Thanks a lot for helping \n> me solve this.\n\nThank you for providing such helpful details. It really makes a\ndifference.\n\n-Peff\n"}]}