Add update_on_worktree_change
config option, and depreacte update_on_change_command
#94
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request allows for more control over what happens when the current working directory is changed to the specified worktree. A workaround was mentioned in #13 , but it isn't ideal since
git-worktree
would always run the code to open the current buffer in the specified worktree. With the changes in this PR, the workaround can be achieved without running unnecessary code.No breaking changes are introduced, and users won't experience any different behavior with their current configs. But the assumption was made that this would lead to the eventual deprecation of
on_change_command
. This can be discussed, because I don't feel strongly about it.I use
auto-session
for managing sessions, but any session-manager/code can be used here. A sample configuration is below.