{"thread":{"id":"29426","subject":"What does \"modified\" in git status mean?","startedAt":"2012-01-22T16:57:52Z","lastAt":"2012-01-24T18:57:16Z","messageCount":4,"participants":["Mikolas","Seth Robertson","Phillip Susi","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"182941","messageId":"loom.20120122T174204-274@post.gmane.org","threadId":"29426","inReplyTo":null,"subject":"What does \"modified\" in git status mean?","fromName":"Mikolas","fromEmail":"mikolas.janota@gmail.com","sentAt":"2012-01-22T16:57:52Z","receivedAt":"2012-01-22T16:57:52Z","isPatch":false,"sender":{"key":"mikolas.janota@gmail.com","avatar":null},"body":"I am using git version 1.7.5.1 under cygwin and I'm getting behavior that I'm \nnot understanding.\n\nWhen I do 'git status' in the root directory of the repository, it shows no \ndifference. Once I cd to a subdirectory, it starts showing modifications. \nHowever, 'git diff' shows nothing. \n\nSo it looks something like this:\n$ git status\n# On branch master\nnothing to commit (working directory clean)\n\n$ cd foo\n$ git status\n# On branch master\n# Changes not staged for commit:\n#   (use \"git add <file>...\" to update what will be committed)\n#   (use \"git checkout -- <file>...\" to discard changes in working directory)\n#\n#       modified:   ../foo/bar\n\n$ git diff\n$\n\nI put the following in my gitconfig but that doesn't seem to be doing much.\n[core]\n       trustctime = false\n       autocrlf = input\n\nSo my questions are \n1) Is there some way how to tell status to tell me *why* the files are marked \nas modified?\n2) Is it normal that git status behaves differently in different directories?\n\n--mikolas\n\n\n\n \n"},{"id":"182943","messageId":"201201221756.q0MHuWmL003864@no.baka.org","threadId":"29426","inReplyTo":"loom.20120122T174204-274@post.gmane.org","subject":"Re: What does \"modified\" in git status mean?","fromName":"Seth Robertson","fromEmail":"in-gitvger@baka.org","sentAt":"2012-01-22T17:56:32Z","receivedAt":"2012-01-22T17:56:32Z","isPatch":false,"sender":{"key":"in-gitvger@baka.org","avatar":null},"body":"\nIn message <loom.20120122T174204-274@post.gmane.org>, Mikolas writes:\n\n    1) Is there some way how to tell status to tell me *why* the files\n    are marked as modified?\n\nNot as such.  However, I do have a script which, when run from the\nroot of the working directory, manually compares the on-disk files to\nwhat is checked into git.  This would detect any whitespace or smudge\nrelated changes, or of course any normal user changes.\n\ngit ls-tree --name-only -r HEAD | while read path; do if [ ! -f \"$path\" ]; then continue; fi; sha1=`git show \"HEAD:$path\" | sha1sum | awk '{print $1;}'`; sha2=`sha1sum \"$path\" | awk '{print $1;}'`; if [ $sha1 != $sha2 ]; then echo \"<$sha1> <$sha2> $path\"; fi; done\n\n\n    2) Is it normal that git status behaves differently in different directories?\n\nI would say not, but perhaps you have a .gitattributes in that\ndirectory? (Which would be a bug) Could you try with a more recent\nversion of git?\n\n\t\t\t\t\t-Seth Robertson\n"},{"id":"182979","messageId":"4F1DBE04.6040200@ubuntu.com","threadId":"29426","inReplyTo":"loom.20120122T174204-274@post.gmane.org","subject":"Re: What does \"modified\" in git status mean?","fromName":"Phillip Susi","fromEmail":"psusi@ubuntu.com","sentAt":"2012-01-23T20:07:32Z","receivedAt":"2012-01-23T20:07:32Z","isPatch":false,"sender":{"key":"psusi@ubuntu.com","avatar":null},"body":"-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n\nOn 1/22/2012 11:57 AM, Mikolas wrote:\n> I am using git version 1.7.5.1 under cygwin and I'm getting\n> behavior that I'm not understanding.\n> \n> When I do 'git status' in the root directory of the repository, it\n> shows no difference. Once I cd to a subdirectory, it starts showing\n> modifications. However, 'git diff' shows nothing.\n> \n> So it looks something like this: $ git status # On branch master \n> nothing to commit (working directory clean)\n> \n> $ cd foo $ git status # On branch master # Changes not staged for\n> commit: #   (use \"git add <file>...\" to update what will be\n> committed) #   (use \"git checkout -- <file>...\" to discard changes\n> in working directory) # #       modified:   ../foo/bar\n> \n> $ git diff $\n> \n> I put the following in my gitconfig but that doesn't seem to be\n> doing much. [core] trustctime = false autocrlf = input\n\nautocrlf is basically broken, don't use it.\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v2.0.17 (MingW32)\nComment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/\n\niQEcBAEBAgAGBQJPHb4EAAoJEJrBOlT6nu75NmsIALPYuRTdGPLigxmiAWfH4e/i\nd516AR8AgkWtJzK3TbaD2HxgnQK9dmWYysppT7WR2SetrBrpsEUvQnw0b3jUewkb\nlL97cEcDfiYbKXnkpfHRtAawUIXhrQeT/8XpOrvc7d8wPCWt4Zd7hrLo3TTuBGmN\ntQcJtUqPwxreUYWOR5dPMV3oaeclptavEoeGc+2BlTiAuti6aw89G7lRvgVZQDGr\ny0uCL4QIyOuMU9xUaeiFm/pCqY5MWSTs6Nv3mnAiw6PwK+aR1OcUkJjRw6dM6xWY\n7futPNLEph8fptltaLhzMoeSzct3vNd+Al7synmOTh8bGitJeyaiCZOR55CG/eY=\n=i8Zy\n-----END PGP SIGNATURE-----\n"},{"id":"183025","messageId":"20120124185716.GA5546@sigill.intra.peff.net","threadId":"29426","inReplyTo":"loom.20120122T174204-274@post.gmane.org","subject":"Re: What does \"modified\" in git status mean?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-01-24T18:57:16Z","receivedAt":"2012-01-24T18:57:16Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sun, Jan 22, 2012 at 04:57:52PM +0000, Mikolas wrote:\n\n> So it looks something like this:\n> $ git status\n> # On branch master\n> nothing to commit (working directory clean)\n> \n> $ cd foo\n> $ git status\n> # On branch master\n> # Changes not staged for commit:\n> #   (use \"git add <file>...\" to update what will be committed)\n> #   (use \"git checkout -- <file>...\" to discard changes in working directory)\n> #\n> #       modified:   ../foo/bar\n\nModified files appearing only in some calls to status is definitely odd,\nand may be a bug. How close is this to your actual invocation?\n\nIn particular, if \"foo/bar\" is modified, and you do \"cd foo && git\nstatus\", then the relative path shown by \"git status\" should be simply\n\"bar\", not \"../foo/bar\". If you did \"cd other && git status\", then I\nwould expect it to say \"../foo/bar\".\n\nSo was the directory you entered the same as the one that contains the\n(supposedly) modified file, yielding the output above?\n\nIf that is the case, then I might suspect it has to do with path\nnormalization and case sensitivity. It might be worth seeing if you can\nreproduce the problem with a more recent version of git. In particular,\nv1.7.8 and later shipped with my 2548183 (fix phantom untracked files\nwhen core.ignorecase is set, 2011-10-06), which fixes some weird bugs\nsurrounding case-insensitive file lookup.\n\n(Actually, even if that is not the case, it would be worth upgrading and\nseeing if the bug is reproducible).\n\n> So my questions are \n> 1) Is there some way how to tell status to tell me *why* the files are marked \n> as modified?\n\nTypically you would ask \"diff\" for more details. But since \"diff\" is not\nreporting anything, that isn't helpful (and is probably indicative of a\nbug).\n\n> 2) Is it normal that git status behaves differently in different directories?\n\nNo.\n\n-Peff\n"}]}