{"thread":{"id":"36309","subject":"Found a \"bug\" in git 1.9.0 but can't reproduce it without copyrighted source code.","startedAt":"2014-03-28T00:45:54Z","lastAt":"2014-03-28T02:06:42Z","messageCount":7,"participants":["yun sheng","Trần Ngọc Quân","Jonathan Nieder"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"237963","messageId":"CA+fYBFdzC-_B2Qfk8Hg0pLUNy4oayySs+8B3vWq7uuBeAx9eJQ@mail.gmail.com","threadId":"36309","inReplyTo":null,"subject":"Found a \"bug\" in git 1.9.0 but can't reproduce it without copyrighted source code.","fromName":"yun sheng","fromEmail":"uewing@gmail.com","sentAt":"2014-03-28T00:45:54Z","receivedAt":"2014-03-28T00:45:54Z","isPatch":false,"sender":{"key":"uewing@gmail.com","avatar":"https://gravatar.com/avatar/383dcafbd4d25e3cb9e4a320a8e386edf3999953b5965935c81f09d0b223b282?d=mp&s=160"},"body":"Hi,\n\nI found git sometimes can't detect working trees changes. But I can\nonly reproduce this problem on several specific files, unfortunately\nthese files are copyrighted source files so I can't send them to you.\nIs there anything I can do to narrow the problem and finally reproduce\nthe bug without these commercial files?\n\nI posted a question on stackoverflow which shows the process.\n\nhttp://stackoverflow.com/questions/22684163/cant-reproduce-a-bug-in-git-without-a-specific-file\n\nActually what I'm doing is:\n\ngit init\n\" copy the first version of file into the working tree.\ngit add .\ngit commit -m 'init'\n\" copy and replace the file into working tree.\ngit status\n\nand nothing is reported by git.\n\nthese two files have the same timestamp, the same size, bug slightly\ndifferent contents. These files were generated by `git difftool -d` I\njust manually copied them out from the temp directory just for future\nreview.\n\nGit I'm using is msysgit 1.9.0 on windows 7\n\nBest regards,\nSheng Yun\n"},{"id":"237965","messageId":"5334CA94.7070708@gmail.com","threadId":"36309","inReplyTo":"CA+fYBFdzC-_B2Qfk8Hg0pLUNy4oayySs+8B3vWq7uuBeAx9eJQ@mail.gmail.com","subject":"Re: Found a \"bug\" in git 1.9.0 but can't reproduce it without copyrighted source code.","fromName":"Trần Ngọc Quân","fromEmail":"vnwildman@gmail.com","sentAt":"2014-03-28T01:04:20Z","receivedAt":"2014-03-28T01:04:20Z","isPatch":false,"sender":{"key":"vnwildman@gmail.com","avatar":"https://avatars.githubusercontent.com/u/508758?v=4"},"body":"On 28/03/2014 07:45, yun sheng wrote:\n> Hi,\n>\n> I found git sometimes can't detect working trees changes. But I can\n> only reproduce this problem on several specific files, unfortunately\n> these files are copyrighted source files so I can't send them to you.\n> Is there anything I can do to narrow the problem and finally reproduce\n> the bug without these commercial files?\n>\n> I posted a question on stackoverflow which shows the process.\n>\n> http://stackoverflow.com/questions/22684163/cant-reproduce-a-bug-in-git-without-a-specific-file\n>\n> Actually what I'm doing is:\n>\n> git init\n> \" copy the first version of file into the working tree.\n> git add .\n> git commit -m 'init'\n> \" copy and replace the file into working tree.\n> git status\n>\n> and nothing is reported by git.\n>\n> these two files have the same timestamp, the same size, bug slightly\n> different contents. These files were generated by `git difftool -d` I\n> just manually copied them out from the temp directory just for future\n> review.\nDon't worry about copyright, please run sha1sum in order to make sure\nthe content is changed!\n>\n> Git I'm using is msysgit 1.9.0 on windows 7\nIs it Ok on Linux OS, on other git version?\n>\n> Best regards,\n> Sheng Yun\n> --\n>\n\n-- \nTrần Ngọc Quân.\n"},{"id":"237967","messageId":"20140328014022.GO15625@google.com","threadId":"36309","inReplyTo":"CA+fYBFdzC-_B2Qfk8Hg0pLUNy4oayySs+8B3vWq7uuBeAx9eJQ@mail.gmail.com","subject":"Re: Found a \"bug\" in git 1.9.0 but can't reproduce it without copyrighted source code.","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2014-03-28T01:40:22Z","receivedAt":"2014-03-28T01:40:22Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi,\n\nyun sheng wrote:\n\n> these two files have the same timestamp, the same size, bug slightly\n> different contents.\n\nHow did they get the same timestamp?\n\n[...]\n> Git I'm using is msysgit 1.9.0 on windows 7\n\nUnixy operating systems have other fields like inode number and ctime\nthat make it possible to notice that a file might have been changed\nwithout actually rereading it.  Unfortunately Git for Windows is\nlimited to what's in the WIN32_FILE_ATTRIBUTE_DATA which means the\nsize, mtime, and mode are basically all it has to go by.\n\nDo you know of some other Windows API call that could help?\n\nHope that helps,\nJonathan\n"},{"id":"237966","messageId":"CA+fYBFedYBPHLgO1mf31CuqKjWN0wbFj+Rmxq2Nm23HE0z8t_Q@mail.gmail.com","threadId":"36309","inReplyTo":"CA+fYBFdsp4z5T42wEiQ-0X88eK4UhJLx+Ofum_RYEf-g8a3SbA@mail.gmail.com","subject":"Fwd: Found a \"bug\" in git 1.9.0 but can't reproduce it without copyrighted source code.","fromName":"yun sheng","fromEmail":"uewing@gmail.com","sentAt":"2014-03-28T01:40:41Z","receivedAt":"2014-03-28T01:40:41Z","isPatch":false,"sender":{"key":"uewing@gmail.com","avatar":"https://gravatar.com/avatar/383dcafbd4d25e3cb9e4a320a8e386edf3999953b5965935c81f09d0b223b282?d=mp&s=160"},"body":"---------- Forwarded message ----------\nFrom: yun sheng <uewing@gmail.com>\nDate: Fri, Mar 28, 2014 at 9:28 AM\nSubject: Re: Found a \"bug\" in git 1.9.0 but can't reproduce it without\ncopyrighted source code.\nTo: Trần Ngọc Quân <vnwildman@gmail.com>\n\n\nThe result of sha1sum is different. Following is my console log\n\n\nC:\\shengy\\tmp\\shengyun\\git-test>git init\nInitialized empty Git repository in C:/shengy/tmp/shengyun/git-test/.git/\n\nC:\\shengy\\tmp\\shengyun\\git-test>copy\nC:\\shengy\\Dropbox\\tmp\\git-issue\\old\\epmdstyp.h\n        1 file(s) copied.\n\nC:\\shengy\\tmp\\shengyun\\git-test>git add .\n\nC:\\shengy\\tmp\\shengyun\\git-test>git commit -m 'init'\n[master (root-commit) 579385e] 'init'\n 1 file changed, 97 insertions(+)\n create mode 100644 epmdstyp.h\n\nC:\\shengy\\tmp\\shengyun\\git-test>sha1sum epmdstyp.h\nc2310fe32891dc7269298814475d0ad083c5483c *epmdstyp.h\n\nC:\\shengy\\tmp\\shengyun\\git-test>copy\nC:\\shengy\\Dropbox\\tmp\\git-issue\\new\\epmdstyp.h\nOverwrite C:\\shengy\\tmp\\shengyun\\git-test\\epmdstyp.h? (Yes/No/All): Y\n        1 file(s) copied.\n\nC:\\shengy\\tmp\\shengyun\\git-test>sha1sum epmdstyp.h\n7a98d5161b5e5ae201997b40fa5d5cebe1d14d1c *epmdstyp.h\n\nC:\\shengy\\tmp\\shengyun\\git-test>git status\nOn branch master\nnothing to commit, working directory clean\n\nC:\\shengy\\tmp\\shengyun\\git-test>\n\nOn Fri, Mar 28, 2014 at 9:04 AM, Trần Ngọc Quân <vnwildman@gmail.com> wrote:\n> On 28/03/2014 07:45, yun sheng wrote:\n>> Hi,\n>>\n>> I found git sometimes can't detect working trees changes. But I can\n>> only reproduce this problem on several specific files, unfortunately\n>> these files are copyrighted source files so I can't send them to you.\n>> Is there anything I can do to narrow the problem and finally reproduce\n>> the bug without these commercial files?\n>>\n>> I posted a question on stackoverflow which shows the process.\n>>\n>> http://stackoverflow.com/questions/22684163/cant-reproduce-a-bug-in-git-without-a-specific-file\n>>\n>> Actually what I'm doing is:\n>>\n>> git init\n>> \" copy the first version of file into the working tree.\n>> git add .\n>> git commit -m 'init'\n>> \" copy and replace the file into working tree.\n>> git status\n>>\n>> and nothing is reported by git.\n>>\n>> these two files have the same timestamp, the same size, bug slightly\n>> different contents. These files were generated by `git difftool -d` I\n>> just manually copied them out from the temp directory just for future\n>> review.\n> Don't worry about copyright, please run sha1sum in order to make sure\n> the content is changed!\n>>\n>> Git I'm using is msysgit 1.9.0 on windows 7\n> Is it Ok on Linux OS, on other git version?\n>>\n>> Best regards,\n>> Sheng Yun\n>> --\n>>\n>\n> --\n> Trần Ngọc Quân.\n>\n"},{"id":"237968","messageId":"CA+fYBFcqZtCxRjAiZk24VJutc_QT5asQU8EFRKpd0ZYqoN4=1g@mail.gmail.com","threadId":"36309","inReplyTo":"20140328014022.GO15625@google.com","subject":"Re: Found a \"bug\" in git 1.9.0 but can't reproduce it without copyrighted source code.","fromName":"yun sheng","fromEmail":"uewing@gmail.com","sentAt":"2014-03-28T01:45:27Z","receivedAt":"2014-03-28T01:45:27Z","isPatch":false,"sender":{"key":"uewing@gmail.com","avatar":"https://gravatar.com/avatar/383dcafbd4d25e3cb9e4a320a8e386edf3999953b5965935c81f09d0b223b282?d=mp&s=160"},"body":"The files get the same timestamp by using `git difftool -d` to view\ndiffs, the diff tool I use id beyond compare 3, this command would\ngenerate temp files to feed the compare program, so these files get\nthe same time stamp, I copied them out from the temp folder.\n\nI have no idea of the second quesiton, I am really not familiar with\nwindows API. Do you mean this file may have been changed without\nrereading and git can't detect it?\n\nBest regards,\nSheng Yun\n\nOn Fri, Mar 28, 2014 at 9:40 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Hi,\n>\n> yun sheng wrote:\n>\n>> these two files have the same timestamp, the same size, bug slightly\n>> different contents.\n>\n> How did they get the same timestamp?\n>\n> [...]\n>> Git I'm using is msysgit 1.9.0 on windows 7\n>\n> Unixy operating systems have other fields like inode number and ctime\n> that make it possible to notice that a file might have been changed\n> without actually rereading it.  Unfortunately Git for Windows is\n> limited to what's in the WIN32_FILE_ATTRIBUTE_DATA which means the\n> size, mtime, and mode are basically all it has to go by.\n>\n> Do you know of some other Windows API call that could help?\n>\n> Hope that helps,\n> Jonathan\n"},{"id":"237969","messageId":"20140328015921.GP15625@google.com","threadId":"36309","inReplyTo":"CA+fYBFcqZtCxRjAiZk24VJutc_QT5asQU8EFRKpd0ZYqoN4=1g@mail.gmail.com","subject":"Git doesn't notice file has changed (Re: Found a \"bug\" in git 1.9.0 but can't reproduce it without copyrighted source code.)","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2014-03-28T01:59:21Z","receivedAt":"2014-03-28T01:59:21Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"(cc-ing msysgit list, where there are more Windows-knowledgeable people)\nyun sheng wrote:\n> On Fri, Mar 28, 2014 at 9:40 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n>> yun sheng wrote:\n\n>>> these two files have the same timestamp, the same size, bug slightly\n>>> different contents.\n>>\n>> How did they get the same timestamp?\n>>\n>> [...]\n>>> Git I'm using is msysgit 1.9.0 on windows 7\n>>\n>> Unixy operating systems have other fields like inode number and ctime\n>> that make it possible to notice that a file might have been changed\n>> without actually rereading it.  Unfortunately Git for Windows is\n>> limited to what's in the WIN32_FILE_ATTRIBUTE_DATA which means the\n>> size, mtime, and mode are basically all it has to go by.\n>>\n>> Do you know of some other Windows API call that could help?\n>\n> The files get the same timestamp by using `git difftool -d` to view\n> diffs, the diff tool I use id beyond compare 3, this command would\n> generate temp files to feed the compare program, so these files get\n> the same time stamp, I copied them out from the temp folder.\n>\n> I have no idea of the second quesiton, I am really not familiar with\n> windows API. Do you mean this file may have been changed without\n> rereading and git can't detect it?\n\nSorry for the lack of clarity.  I meant that normally git detects when\na file might have been changed without actually reading the file.  To\ndo this, it uses heuristics like \"If all file attributes are\nunchanged, the file is unchanged\" which tend to work well on Unix.  My\nquestion was whether there's some similar trick that could work better\non Windows than the current code.\n\nFor example, if some interested person ports something like Facebook's\nwatchman[1] to Windows[2], then Git could take advantage of that work\nusing something like Duy's file-watcher series[3], which would be one\nway to fix this problem.\n\nThanks,\nJonathan\n\n[1] https://github.com/facebook/watchman\n[2] using FindFirstChangeNotification and ReadDirectoryChangesW, perhaps\n[3] http://thread.gmane.org/gmane.comp.version-control.git/240339/focus=241395>\n"},{"id":"237970","messageId":"CA+fYBFdK4EjUU2yVFJ27YhQMe2rcmZ=MXjxK9GsWWrvC=LvdEQ@mail.gmail.com","threadId":"36309","inReplyTo":"20140328015921.GP15625@google.com","subject":"Re: Git doesn't notice file has changed (Re: Found a \"bug\" in git 1.9.0 but can't reproduce it without copyrighted source code.)","fromName":"yun sheng","fromEmail":"uewing@gmail.com","sentAt":"2014-03-28T02:06:42Z","receivedAt":"2014-03-28T02:06:42Z","isPatch":false,"sender":{"key":"uewing@gmail.com","avatar":"https://gravatar.com/avatar/383dcafbd4d25e3cb9e4a320a8e386edf3999953b5965935c81f09d0b223b282?d=mp&s=160"},"body":"The problem is I can't reproduce this bug if create some other files\nwhich have the same size and timestamp. It only happens on several\nfiles in my project. And it's even more frustrating that I can't send\nthese files to the mailing list since it is a proprietary source file.\n\nOn Fri, Mar 28, 2014 at 9:59 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> (cc-ing msysgit list, where there are more Windows-knowledgeable people)\n> yun sheng wrote:\n>> On Fri, Mar 28, 2014 at 9:40 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n>>> yun sheng wrote:\n>\n>>>> these two files have the same timestamp, the same size, bug slightly\n>>>> different contents.\n>>>\n>>> How did they get the same timestamp?\n>>>\n>>> [...]\n>>>> Git I'm using is msysgit 1.9.0 on windows 7\n>>>\n>>> Unixy operating systems have other fields like inode number and ctime\n>>> that make it possible to notice that a file might have been changed\n>>> without actually rereading it.  Unfortunately Git for Windows is\n>>> limited to what's in the WIN32_FILE_ATTRIBUTE_DATA which means the\n>>> size, mtime, and mode are basically all it has to go by.\n>>>\n>>> Do you know of some other Windows API call that could help?\n>>\n>> The files get the same timestamp by using `git difftool -d` to view\n>> diffs, the diff tool I use id beyond compare 3, this command would\n>> generate temp files to feed the compare program, so these files get\n>> the same time stamp, I copied them out from the temp folder.\n>>\n>> I have no idea of the second quesiton, I am really not familiar with\n>> windows API. Do you mean this file may have been changed without\n>> rereading and git can't detect it?\n>\n> Sorry for the lack of clarity.  I meant that normally git detects when\n> a file might have been changed without actually reading the file.  To\n> do this, it uses heuristics like \"If all file attributes are\n> unchanged, the file is unchanged\" which tend to work well on Unix.  My\n> question was whether there's some similar trick that could work better\n> on Windows than the current code.\n>\n> For example, if some interested person ports something like Facebook's\n> watchman[1] to Windows[2], then Git could take advantage of that work\n> using something like Duy's file-watcher series[3], which would be one\n> way to fix this problem.\n>\n> Thanks,\n> Jonathan\n>\n> [1] https://github.com/facebook/watchman\n> [2] using FindFirstChangeNotification and ReadDirectoryChangesW, perhaps\n> [3] http://thread.gmane.org/gmane.comp.version-control.git/240339/focus=241395>\n"}]}