[WIP] Alternative workflow: Native git worktree add support for multi IDE project workflow#9
Draft
bezhermoso wants to merge 3 commits intoblock:mainfrom
Draft
[WIP] Alternative workflow: Native git worktree add support for multi IDE project workflow#9bezhermoso wants to merge 3 commits intoblock:mainfrom
git worktree add support for multi IDE project workflow#9bezhermoso wants to merge 3 commits intoblock:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
WIP!
I want to take advantage of the smart, efficient things this tool does to make Bazel workflows more manageable when using worktrees for huge repos. However I'm not sure I want to adopt
wtin its entirety yet.The workflow I'd like to support is:
First, supporting regular
git worktree addworkflows makes it this available in other tools like Conductor, and other tools that creates worktrees as part of their flow. I personally uselazygitfor a lot of Git things half the time, including dealing with worktrees.(Caveat: I haven't tested Conductor with these changes quite yet. Planning to in the next few days).Second, some people (like me) prefer to keep different IDE windows for the various threads I'm working on vs "switching context" on a single IDE window. This alone is probably achievable in the normal
wtworkflow, but that only works when creating/managing worktrees throughwt add/switchetc.Note
Update: I was able to test this w/ Conductor. It looks like Conductor creates worktrees in a way that skips any hooks (many reasons why they want to do this). But they support running custom scripts every after new worktree:

Adding
wt bazel-symlinks --main-repo ~/Development/javawould achieve the desired effect.Setup
This is the required setup to make this possible:
1.) Add a
post-checkouthook in the main repo that runs the desired logic (wt bazel-symlinks ...) when a new subtree is created.2.) Add a
post-checkouthook to copy.bazelbsp/to the new worktree. This directory contains the project view file e.g. contains allowlist of bazel targets for the project.(I'm not sure (2) is necessarily required, because it only helps for the multi-IDE window workflow.)
The
wt print-bazel-print-post-checkout-hooksubcommand helps w/ the installation of the hook e.g.wt print-bazel-print-post-checkout-hook > .git/hooks/post-checkout chmod +x .git/hooks/post-checkoutThings to Figure Out
.ijwbvault (e.g. useijwb-{import-export}) for this workflow i.e. nohazel-symlinkssubcommand)?