Skip to content

Redesign install.sh onboarding to be repo-agnostic#4

Merged
guodong-sq merged 1 commit intomainfrom
update-install-script-and-remove-java-monorepo-specifics
Feb 9, 2026
Merged

Redesign install.sh onboarding to be repo-agnostic#4
guodong-sq merged 1 commit intomainfrom
update-install-script-and-remove-java-monorepo-specifics

Conversation

@guodong-sq
Copy link
Copy Markdown
Collaborator

@guodong-sq guodong-sq commented Jan 29, 2026

Replace hardcoded java-monorepo defaults with a user-centric flow that:

  • Asks which repository to manage first
  • Auto-detects default branch from origin/HEAD or main/master
  • Derives all paths from repo location (e.g., myrepo -> myrepo-master, myrepo-worktrees)
  • Shows derived config and allows customization
════════════════════════════════════════════════════════════════════════════════
  Repository Setup
════════════════════════════════════════════════════════════════════════════════

Which repository do you want to manage with worktrees?

Enter the path to your existing git repository.
Example: ~/Development/myrepo

Repository path: ~/Development/java             <--- user input

Detected repository:
  Path:   /Users/guodong/Development/java
  Remote: [remote-ssh-path]
  Branch: master (default branch)

Derived configuration:

  The worktree toolkit will set up the following structure:

  Active symlink:      /Users/guodong/Development/java
     Your IDE opens this path. It's a symlink that can point to any worktree.

  Main repository:     /Users/guodong/Development/java-master
     Your current repo will be moved here (the "master" worktree).

  Worktrees directory: /Users/guodong/Development/java-worktrees
     New worktrees will be created here.

  IntelliJ metadata:   /Users/guodong/.config/wt/idea-files/java
     Shared .ijwb files for instant project switching.

  Default branch:      master
     Used when creating new worktrees.

Use this configuration? [Y/n] n               <--- user input

You can customize each value. Press Enter to keep the default.

Active symlink path [/Users/guodong/Development/java]:
...

@HamptonMakes
Copy link
Copy Markdown
Collaborator

So I was wondering. if it shoudl be like...

java/base
java/worktrees/blah
java/java

HamptonMakes
HamptonMakes previously approved these changes Jan 29, 2026
Comment thread install.sh
# ─────────────────────────────────────────────────────────────────────────────
echo
echo "Detected repository:"
echo " Path: $repo_path"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

love this.

@guodong-sq
Copy link
Copy Markdown
Collaborator Author

So I was wondering. if it shoudl be like...

java/base java/worktrees/blah java/java

we could skip auto-deriving paths entirely and just prompt for each path individually. That way users can choose whichever structure fits their setup. What do you think?

Replace hardcoded java-monorepo defaults with a user-centric flow that:
  - Asks which repository to manage first
  - Auto-detects default branch from origin/HEAD or main/master
  - Derives all paths from repo location (e.g., myrepo -> myrepo-master, myrepo-worktrees)
  - Shows derived config and allows customization

Move installation directory from ~/.config/wt to ~/.wt

- Change INSTALL_DIR to ~/.wt for better visibility and alignment
  with tools like ~/.cargo, ~/.rustup, ~/.pyenv
- Store worktree data in ~/.wt/repos/<name>/{base,worktrees,idea-files}
- Update all fallback paths in bin/wt-*, lib/*, completion/*, wt.sh
- Add cleanup logic to detect and remove old ~/.config/wt installation
- Use PID+unix timestamp for temp directory during migration to handle nested moves
- Update README.md documentation paths
@guodong-sq guodong-sq force-pushed the update-install-script-and-remove-java-monorepo-specifics branch from 15c755c to 607bb31 Compare February 9, 2026 02:13
@guodong-sq guodong-sq merged commit 556dc97 into main Feb 9, 2026
1 check passed
@guodong-sq guodong-sq deleted the update-install-script-and-remove-java-monorepo-specifics branch February 9, 2026 02:14
guodong-sq added a commit that referenced this pull request Feb 9, 2026
Conflict resolution:
- bin/wt-ijwb-export, bin/wt-ijwb-import: Deleted (PR #5 replaces
  with generic wt-metadata-export/import)
- install.sh: Merged PR #4's ~/.wt/repos/<name>/ path scheme with
  PR #5's metadata detection and selection features

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
guodong-sq added a commit that referenced this pull request Feb 9, 2026
Update fallback path from ~/.config/wt/ to ~/.wt/ to match
PR #4's path scheme update.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

2 participants