{"thread":{"id":"47899","subject":"Bug Report: git status triggers a file change event","startedAt":"2018-02-22T03:29:32Z","lastAt":"2018-02-23T12:18:39Z","messageCount":4,"participants":["Raining Chain","Jonathan Nieder","Stefan Beller","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"339898","messageId":"CAPaSTm=Vhg+S0Cf7rkcvXKH1eaEbw5aGOfCmtU7K3D+1kc-pGg@mail.gmail.com","threadId":"47899","inReplyTo":null,"subject":"Bug Report: git status triggers a file change event","fromName":"Raining Chain","fromEmail":"rainingchain@gmail.com","sentAt":"2018-02-22T03:29:26Z","receivedAt":"2018-02-22T03:29:32Z","isPatch":false,"sender":{"key":"rainingchain@gmail.com","avatar":null},"body":"On Windows 10, git version 2.16.2.windows.1, running the command\n\ngit status\n\nwill trigger a file change event to file C:\\myPath\\.git  \"Attributes changed.\"\n\nThis causes problems when using scripts that detect file changes such\nas tsc -w (Typescript compiler) and using softwares that regularly\ncall git status such as VisualStudioCode.\n\nThanks.\n"},{"id":"339899","messageId":"20180222052227.GA133592@aiede.svl.corp.google.com","threadId":"47899","inReplyTo":"CAPaSTm=Vhg+S0Cf7rkcvXKH1eaEbw5aGOfCmtU7K3D+1kc-pGg@mail.gmail.com","subject":"Re: Bug Report: git status triggers a file change event","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2018-02-22T05:22:27Z","receivedAt":"2018-02-22T05:23:15Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"+git-for-windows\nHi,\n\nRaining Chain wrote:\n\n> On Windows 10, git version 2.16.2.windows.1, running the command\n>\n> git status\n>\n> will trigger a file change event to file C:\\myPath\\.git  \"Attributes changed.\"\n>\n> This causes problems when using scripts that detect file changes such\n> as tsc -w (Typescript compiler) and using softwares that regularly\n> call git status such as VisualStudioCode.\n>\n> Thanks.\n\nCan you say more about how \"tsc -w\" reacts to the file change?  Is there\na way to tell it to exclude particular files from the files it watches?\n\nThanks,\nJonathan\n"},{"id":"339930","messageId":"CAGZ79kZBrG7uQ5KOrpdkkhzet7chJhxVsKjTnVMQTrSGFAMZhw@mail.gmail.com","threadId":"47899","inReplyTo":"20180222052227.GA133592@aiede.svl.corp.google.com","subject":"Re: Bug Report: git status triggers a file change event","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2018-02-22T18:18:40Z","receivedAt":"2018-02-22T18:18:47Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Wed, Feb 21, 2018 at 9:22 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> +git-for-windows\n> Hi,\n>\n> Raining Chain wrote:\n>\n>> On Windows 10, git version 2.16.2.windows.1, running the command\n>>\n>> git status\n>>\n>> will trigger a file change event to file C:\\myPath\\.git  \"Attributes changed.\"\n>>\n>> This causes problems when using scripts that detect file changes such\n>> as tsc -w (Typescript compiler) and using softwares that regularly\n>> call git status such as VisualStudioCode.\n>>\n>> Thanks.\n\nDoes\nhttps://github.com/git/git/commit/27344d6a6c8056664966e11acf674e5da6dd7ee3\nhelp?\n\n>\n> Can you say more about how \"tsc -w\" reacts to the file change?  Is there\n> a way to tell it to exclude particular files from the files it watches?\n>\n> Thanks,\n> Jonathan\n"},{"id":"340017","messageId":"nycvar.QRO.7.76.6.1802231315480.56@ZVAVAG-6OXH6DA.rhebcr.pbec.zvpebfbsg.pbz","threadId":"47899","inReplyTo":"CAGZ79kZBrG7uQ5KOrpdkkhzet7chJhxVsKjTnVMQTrSGFAMZhw@mail.gmail.com","subject":"Re: Bug Report: git status triggers a file change event","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2018-02-23T12:18:16Z","receivedAt":"2018-02-23T12:18:39Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi all,\n\nOn Thu, 22 Feb 2018, Stefan Beller wrote:\n\n> On Wed, Feb 21, 2018 at 9:22 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> > +git-for-windows\n\nFirst of all, this is clearly not a Windows-specific problem, as the index\nfile *is* updated, and that is simply the same behavior as on Linux/macOS.\n\n> > Raining Chain wrote:\n> >\n> >> On Windows 10, git version 2.16.2.windows.1, running the command\n> >>\n> >> git status\n> >>\n> >> will trigger a file change event to file C:\\myPath\\.git  \"Attributes\n> >> changed.\"\n\nCorrect, because .git\\index changed.\n\n> >> This causes problems when using scripts that detect file changes such\n> >> as tsc -w (Typescript compiler) and using softwares that regularly\n> >> call git status such as VisualStudioCode.\n\nVisual Studio Code most likely does not look at .git for worktree changes.\n\nAs to the Typescript compiler: it should only look for .ts files, I would\nbe very surprised if it was confused by .git's filesystem attributes\nchanging!\n\nIf tsw is still confused, try adding\n\n\t\"exclude\": [\n\t    \".git\"\n\t]\n\nto your tsconfig.json.\n\nCiao,\nJohannes\n"}]}