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

Re: What does "modified" in git status mean?

From
SRSeth Robertson <in-gitvger@baka.org>
Date
Jan 22, 2012, 17:56 UTC
Message-ID
<201201221756.q0MHuWmL003864@no.baka.org>
In-Reply-To
<loom.20120122T174204-274@post.gmane.org>
In message <loom.20120122T174204-274@post.gmane.org>, Mikolas writes:
    1) Is there some way how to tell status to tell me *why* the files
    are marked as modified?

Not as such. However, I do have a script which, when run from the root of the working directory, manually compares the on-disk files to what is checked into git. This would detect any whitespace or smudge related changes, or of course any normal user changes.

git 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
    2) Is it normal that git status behaves differently in different directories?

I would say not, but perhaps you have a .gitattributes in that directory? (Which would be a bug) Could you try with a more recent version of git?

					-Seth Robertson
Previous: MikolasNext: Phillip Susi
Message 2 of 4 in “What does "modified" in git status mean?”
  1. MikolasJan 22, 2012
  2. Seth RobertsonJan 22, 2012
  3. Phillip SusiJan 23, 2012
  4. Jeff KingJan 24, 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.