Skip to content

ConfigStep: use full hook path for fsmonitor#340

Merged
derrickstolee merged 1 commit into
microsoft:masterfrom
derrickstolee:fsmonitor-fullpath
Feb 24, 2020
Merged

ConfigStep: use full hook path for fsmonitor#340
derrickstolee merged 1 commit into
microsoft:masterfrom
derrickstolee:fsmonitor-fullpath

Conversation

@derrickstolee
Copy link
Copy Markdown
Contributor

@derrickstolee derrickstolee commented Feb 24, 2020

Resolves #338.

This appears to be the issue:

  1. Someone runs scalar register in a repository that has worktrees.
  2. The worktrees start to use the core.fsmonitor config setting.
  3. The worktree tries to execute from .git/hooks/query-watchman, but that is not a path relative to the worktree.

This fixes the configs setting.

I've tested this on my Windows machine with a worktree of git/git.

Cc: @kewillford the expert on fsmonitor. As a longer plan, we should consider adding tests that cover the case for worktrees.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Copy link
Copy Markdown
Member

@kewillford kewillford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems this is the issue and the fact that we set core.fsmonitor to .git/hooks/.... I don't know why this wasn't using find_hook to begin with since it is in the hooks directory. Maybe it was to have the flexibility of setting the core.fsmonitor to any location and not have to put it in the hooks directory of the repository? Since that seems to be the case, this change makes sense to me.

And I agree that there needs to be more test cases around worktrees.

@derrickstolee derrickstolee merged commit b3b15fe into microsoft:master Feb 24, 2020
@derrickstolee
Copy link
Copy Markdown
Contributor Author

And I agree that there needs to be more test cases around worktrees.

I added #341 to track this work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

query-watchman error when working in a worktree

2 participants