Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git node release --promote doesn't support worktrees #906

Open
targos opened this issue Feb 13, 2025 · 3 comments
Open

git node release --promote doesn't support worktrees #906

targos opened this issue Feb 13, 2025 · 3 comments

Comments

@targos
Copy link
Member

targos commented Feb 13, 2025

On my computer, I have several git worktrees (one for main, one for each release line, etc).

The promotion fails on the "cherry-pick to main" step, because I'm running it from the v23.x worktree and main is checked out in another one:

✔ Cherry-pick release commit to the default branch? Yes
fatal: 'main' is already used by worktree at '/Users/mzasso/git/nodejs/node'
Error: git checkout,main failed: 128
    at ChildProcess.<anonymous> (file:///Users/mzasso/.volta/tools/image/packages/@node-core/utils/lib/node_modules/@node-core/utils/lib/run.js:45:21)
    at ChildProcess.emit (node:events:507:28)
    at maybeClose (node:internal/child_process:1101:16)
    at ChildProcess._handle.onexit (node:internal/child_process:305:5)
    at Process.callbackTrampoline (node:internal/async_hooks:130:17) {
  code: 128,
  messageOnly: true
}

I don't know if that can be fixed.

@richardlau
Copy link
Member

The tool could run/parse the output of git worktree list --porcelain and potentially switch directories (but it should ask just in case the user is in the middle of work in the worktree for the main branch).

@richardlau
Copy link
Member

(FWIW I haven't tried the promote tooling from ncu, but I do use git worktrees and have always had to switch from my release line specific worktree to my main worktree to do the merges back to main.)

@aduh95
Copy link
Contributor

aduh95 commented Feb 13, 2025

I’ve never even heard of git work trees, so that might explain the lack of support – I still haven’t figured out why everyone is using branches on their local clones, so by all means don’t wait on me 😅

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

No branches or pull requests

3 participants