Skip to content

Mac: fs.watch() not detecting changes to file from git operation #5039

Closed
@bpasero

Description

@bpasero

I am on Mac OS X 10.11.1 with node.js 4.1.1. I also tried with node.js 5.x:

Steps:

  • create a folder with one file in it and enable git in that folder
  • commit to master
  • create other branch, make some changes to the file and commit to other branch
  • switch between the branches while checking the output of the following script:
var fs = require("fs");

var watcher = fs.watch('<path to file>');
watcher.on('change', function(eventtype) {
    console.log(eventtype);
});

=> I get a rename event for the first time I switch to the other branch. After that, the events stop when switching branches.

Metadata

Metadata

Assignees

No one assigned

    Labels

    fsIssues and PRs related to the fs subsystem / file system.macosIssues and PRs related to the macOS platform / OSX.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions