{"action":"created","issue":{"url":"https://api.github.com/repos/fireball-x/fire-watch/issues/1","labels_url":"https://api.github.com/repos/fireball-x/fire-watch/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/fireball-x/fire-watch/issues/1/comments","events_url":"https://api.github.com/repos/fireball-x/fire-watch/issues/1/events","html_url":"https://github.com/fireball-x/fire-watch/pull/1","id":97784618,"number":1,"title":"normalize the start root path and fix mtime bug","user":{"login":"yorkie","id":1935767,"avatar_url":"https://avatars.githubusercontent.com/u/1935767?v=3","gravatar_id":"","url":"https://api.github.com/users/yorkie","html_url":"https://github.com/yorkie","followers_url":"https://api.github.com/users/yorkie/followers","following_url":"https://api.github.com/users/yorkie/following{/other_user}","gists_url":"https://api.github.com/users/yorkie/gists{/gist_id}","starred_url":"https://api.github.com/users/yorkie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yorkie/subscriptions","organizations_url":"https://api.github.com/users/yorkie/orgs","repos_url":"https://api.github.com/users/yorkie/repos","events_url":"https://api.github.com/users/yorkie/events{/privacy}","received_events_url":"https://api.github.com/users/yorkie/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"jwu","id":174891,"avatar_url":"https://avatars.githubusercontent.com/u/174891?v=3","gravatar_id":"","url":"https://api.github.com/users/jwu","html_url":"https://github.com/jwu","followers_url":"https://api.github.com/users/jwu/followers","following_url":"https://api.github.com/users/jwu/following{/other_user}","gists_url":"https://api.github.com/users/jwu/gists{/gist_id}","starred_url":"https://api.github.com/users/jwu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwu/subscriptions","organizations_url":"https://api.github.com/users/jwu/orgs","repos_url":"https://api.github.com/users/jwu/repos","events_url":"https://api.github.com/users/jwu/events{/privacy}","received_events_url":"https://api.github.com/users/jwu/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-07-28T19:35:12Z","updated_at":"2015-07-31T17:19:23Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/fireball-x/fire-watch/pulls/1","html_url":"https://github.com/fireball-x/fire-watch/pull/1","diff_url":"https://github.com/fireball-x/fire-watch/pull/1.diff","patch_url":"https://github.com/fireball-x/fire-watch/pull/1.patch"},"body":"该PR分别有两处更新：\r\n\r\n1. 标准化了`start`函数的第一个路径参数，此前，当第一个参数为一个目录路径并且末尾是斜杠（/）时，会报错，我更新了一个单测例子来测试这种情况：https://github.com/yorkie/fire-watch/blob/normalize/input/test/test.js#L407\r\n\r\n2. 通过设置`preserveTimestamps`为false来修正测试用例中关于`fsExtra.copySync`的用法。在`fs-extra`的[行26至28](https://github.com/jprichardson/node-fs-extra/blob/master/lib/copy-sync/copy-file-sync.js#L26-L28)中，如果`preserveTimestamps`设置为`true`（默认值），该模组也会自动地将`ctime`复制到`dest`所指定的文件。这也解释了为何我们单测中总是得到相同的`mtime`值的原因：\r\n\r\n> 由于`preserveTimestamps`默认为`true`，所以我们总是从`foobar.js.meta`文件中拷贝`mtime`值并设置到新的`foobar.js`文件中，然后我们在测试过程中并未对`meta`文件进行任何更新（据我所看），因此`mtime`的值就总是一样的（甚至是在不同的单测中）。\r\n\r\n需要注意的是，如果用户将`mtime`的值同样拷贝到`dest`中，我认为这种情况下，`fire-watch`不应该对其进行监听，不过是否可以将`preserveTimestamps`的默认值在`fire-fs`中改为`false`呢？\r\n\r\nR= @jwu "},"comment":{"url":"https://api.github.com/repos/fireball-x/fire-watch/issues/comments/126756633","html_url":"https://github.com/fireball-x/fire-watch/pull/1#issuecomment-126756633","issue_url":"https://api.github.com/repos/fireball-x/fire-watch/issues/1","id":126756633,"user":{"login":"yorkie","id":1935767,"avatar_url":"https://avatars.githubusercontent.com/u/1935767?v=3","gravatar_id":"","url":"https://api.github.com/users/yorkie","html_url":"https://github.com/yorkie","followers_url":"https://api.github.com/users/yorkie/followers","following_url":"https://api.github.com/users/yorkie/following{/other_user}","gists_url":"https://api.github.com/users/yorkie/gists{/gist_id}","starred_url":"https://api.github.com/users/yorkie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yorkie/subscriptions","organizations_url":"https://api.github.com/users/yorkie/orgs","repos_url":"https://api.github.com/users/yorkie/repos","events_url":"https://api.github.com/users/yorkie/events{/privacy}","received_events_url":"https://api.github.com/users/yorkie/received_events","type":"User","site_admin":false},"created_at":"2015-07-31T17:19:23Z","updated_at":"2015-07-31T17:19:23Z","body":"使用的是nodejs的内部函数：https://iojs.org/api/fs.html#fs_fs_futimessync_fd_atime_mtime"}}