From: asm warriorSent: Saturday, February 14, 2015 3:10 PMSubject: [msysGit] gitk lists my already committed files as "Uncommitted changes", but shows empty diffs
core.autocrlf=true
...
core.autocrlf=True
[core]
autocrlf = True
autocrlf = True
", and do the tests again, the issue still exists. The strange thing is that the "git bash" is already shown a clean working copy. I guess the gitk use some cached config files? So I try to close all the applications and windows on my windows desktop, and try to run gitk again, this time, I don't see the "Local uncommitted changes..." issue, I did some more tests and I don't see this issue happens again.autocrlf = True
" myself, maybe some programs like tortoisegit or git extension cause this issue. but currently I don't use those programs any more(I just uninstall them several days ago), I think the gui (gitk and git gui)supplied by Git-1.9.5-preview20141217.exe is good enough.There are definitely some fishy things going on, and there's actually a bug that I logged and started working on.
I uncovered a bunch of issues with inconsistencies in CRLF conversion that cause this problem. I do have a branch pushed up to my fork but I think it's missing a couple of commits that I have done since.
If you can reproduce it in a clean repo as a test that would be excellent.
//.ichael
--
--
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.
You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msy...@googlegroups.com
To unsubscribe from this group, send email to
msysgit+u...@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en
---
You received this message because you are subscribed to the Google Groups "Git for Windows" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
There are definitely some fishy things going on, and there's actually a bug that I logged and started working on.
I uncovered a bunch of issues with inconsistencies in CRLF conversion that cause this problem. I do have a branch pushed up to my fork but I think it's missing a couple of commits that I have done since.
If you can reproduce it in a clean repo as a test that would be excellent.
//.ichael
Sorry it's taken a while to get back to you all.
Here's the url of branch on github. It still needs some test cases to be properly accepted into the tree. I think this should all be going upstream.. just gotta get it right.
https://github.com/frogonwheels/git/tree/mrg/blame-crlf-v2
One of the reasons I held off was that I was seeing issues in gvim 'fugitive' plugin.. and found out the reason was because the input was being piped from stdin and _that_ wasn't being checked for CRLF standardisation. Fixed and pushed.
//.ichael
I'd be interested in the output to the following:
either from bash
git config -l | grep 'crlf\|eol'
or cmd
git config -l | grep 'crlf\^|eol'
or cmd (if you don't have grep in the path)
git config -l | findstr crlf && echo.-- && git config -l | findstr eol
One of the issues I found was where I had 'core.autocrlf=false' and 'core.eol=crlf'. This definitely highlighted the problem.
This came about because I had
core.autocrlf=true
in the default system config, but wanted to use 'core.eol' in a specific config.
The other thing to check is to make sure you haven't committed a file with CRLF into the repository.
You can use git ls-files -s -- <filename> to find the SHA1 of the file object.. then
git cat-file -p <sha1> | gvim - -c "set fileformat?"
should show 'fileformat=unix' at the bottom of your gvim session. (fileformat=dos means you have a problem)
Michael
I'd be interested in the output to the following:
either from bash
git config -l | grep 'crlf\|eol'
or cmd
git config -l | grep 'crlf\^|eol'
or cmd (if you don't have grep in the path)
git config -l | findstr crlf && echo.-- && git config -l | findstr eol
$ git config -l | grep 'crlf\|eol'
core.autocrlf=true
One of the issues I found was where I had 'core.autocrlf=false' and 'core.eol=crlf'. This definitely highlighted the problem.
This came about because I had
core.autocrlf=true
in the default system config, but wanted to use 'core.eol' in a specific config.
The other thing to check is to make sure you haven't committed a file with CRLF into the repository.
You can use git ls-files -s -- <filename> to find the SHA1 of the file object.. then
git cat-file -p <sha1> | gvim - -c "set fileformat?"
should show 'fileformat=unix' at the bottom of your gvim session. (fileformat=dos means you have a problem)
Michael
From: asm warrior
This last point suggests to me that part of the issue is the different ways different Git+file systems determine if the file has changed. The internal index maintains a timestamp of when it last saw the file changes. If the file has been 'touched' then Git thinks that there will be some associated changes - and in this case the only difference is the time stamp, which Git itself does not record in the repo (but it does in the index.I've forgotten what OS you are on, and what shares you may be using (another issue for file time stamps), but it could be that, especially if your tools/process keeps touching those files without really changing them.
...
# now see if there are any local changes not checked in to the index
set cmd "|git diff-files"
if {$vfilelimit($curview) ne {}} {
set cmd [concat $cmd -- $vfilelimit($curview)]
}
...
mypc@MYPC /D/temp/test-gitk-refresh (master)
$ git diff-files
mypc@MYPC /D/temp/test-gitk-refresh (master)
$ touch a.c
mypc@MYPC /D/temp/test-gitk-refresh (master)
$ git diff-files
:100644 100644 6846aa9e79874d5957d450678ac47f50513521e4 000000000000000000000000
0000000000000000 M a.c
mypc@MYPC /D/temp/test-gitk-refresh (master)
$ git status
On branch master
nothing to commit, working directory clean
mypc@MYPC /D/temp/test-gitk-refresh (master)
$ git diff-files
mypc@MYPC /D/temp/test-gitk-refresh (master)
From: asm warriorSent: Monday, February 23, 2015 5:33 AMSubject: Re: [msysGit] gitk lists my already committed files as "Uncommitted changes", but shows empty diffs