Skip to content

scripts : add wc2wt.sh - create worktree from current HEAD#22513

Merged
ggerganov merged 2 commits into
masterfrom
gg/wc2wt-script
Apr 30, 2026
Merged

scripts : add wc2wt.sh - create worktree from current HEAD#22513
ggerganov merged 2 commits into
masterfrom
gg/wc2wt-script

Conversation

@ggerganov
Copy link
Copy Markdown
Member

Overview

Add scripts/wc2wt.sh — a companion to pr2wt.sh for local development. Takes a branch name (e.g. gg/new-feature) and creates a git worktree on a new branch from the current HEAD, without needing any GitHub API calls or remote forks.

Usage:

./scripts/wc2wt.sh gg/new-feature
./scripts/wc2wt.sh gg/new-feature "bash -l"

Requirements

@ggerganov ggerganov marked this pull request as ready for review April 29, 2026 11:00
Add a script to create a git worktree on a new branch from the current
HEAD. Similar to pr2wt.sh but for local development branches instead of
PRs.

Usage:
  ./scripts/wc2wt.sh gg/new-feature
  ./scripts/wc2wt.sh gg/new-feature "bash -l"

Assisted-by: llama.cpp:local pi
Copy link
Copy Markdown
Member

@CISC CISC left a comment

Choose a reason for hiding this comment

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

Why wc? :)

Comment thread scripts/wc2wt.sh Outdated
# sanitize branch name for directory name (replace / with -)
dir_suffix=$(echo "$BRANCH" | tr '/' '-')

git branch -D "$BRANCH" 2> /dev/null
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
git branch -D "$BRANCH" 2> /dev/null
git branch -d "$BRANCH" 2> /dev/null || {
echo "error: $BRANCH already exists with unmerged changes"
exit 1
}

Looks a bit dangerous, do we really want to unconditionally delete the branch?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Maybe remove this line all together because it never actually succeeds when a worktree with the specified branch name exists:

 14:31:18  git branch -D "gg/test"
error: cannot delete branch 'gg/test' used by worktree at '/llama.cpp-gg-test'

@ggerganov
Copy link
Copy Markdown
Member Author

wc: not ideal - from "working copy"?

@CISC
Copy link
Copy Markdown
Member

CISC commented Apr 29, 2026

wc: not ideal - from "working copy"?

Ok, makes sense, I have no better suggestion. :)

@github-actions github-actions Bot added the script Script related label Apr 29, 2026
@ggerganov ggerganov merged commit 27aef3d into master Apr 30, 2026
2 checks passed
@ggerganov ggerganov deleted the gg/wc2wt-script branch April 30, 2026 06:20
tekintian added a commit to tekintian/llama.cpp that referenced this pull request May 1, 2026
* 'master' of github.com:tekintian/llama.cpp: (659 commits)
  ggml-webgpu: Improve performance of mat-vec and mat-mat for MUL_MAT_ID (ggml-org#22464)
  Update llama-mmap to use ftello/fseeko (ggml-org#22497)
  common : check for null getpwuid in hf-cache (ggml-org#22550)
  vulkan: add get/set tensor 2d functions (ggml-org#22514)
  spec: fix argument typo (ggml-org#22552)
  ci : bump ty to 0.0.33 (ggml-org#22535)
  vendor : update cpp-httplib to 0.43.2 (ggml-org#22548)
  CUDA: fix tile FA kernel on Pascal (ggml-org#22541)
  scripts : add wc2wt.sh - create worktree from current HEAD (ggml-org#22513)
  add fast matmul iquants (ggml-org#22504)
  spec : fix draft model checkpoints (ggml-org#22521)
  spec : fix vocab compat checks in spec example (ggml-org#22426)
  common : do not pass prompt tokens to reasoning budget sampler (ggml-org#22488)
  hexagon: make vmem and buffer-size configurable (ggml-org#22487)
  CUDA: fuse SSM_CONV + ADD(bias) + SILU (ggml-org#22478)
  spec : disacard last drafted token with low prob (ggml-org#22506)
  sync : ggml
  ggml : bump version to 0.10.1 (ggml/1469)
  webui: fix slow mic stop and WAV encode (ggml-org#22480)
  ggml-cpu : disable tiled matmul on AIX to fix page boundary segfault (ggml-org#22293)
  ...

# Conflicts:
#	.gitignore
rsenthilkumar6 pushed a commit to rsenthilkumar6/llama.cpp that referenced this pull request May 1, 2026
…22513)

* scripts : add wc2wt.sh - create worktree from current HEAD

Add a script to create a git worktree on a new branch from the current
HEAD. Similar to pr2wt.sh but for local development branches instead of
PRs.

Usage:
  ./scripts/wc2wt.sh gg/new-feature
  ./scripts/wc2wt.sh gg/new-feature "bash -l"

Assisted-by: llama.cpp:local pi

* cont : no need to try to delete the branch
samuraieng pushed a commit to samuraieng/llama.cpp that referenced this pull request May 6, 2026
…22513)

* scripts : add wc2wt.sh - create worktree from current HEAD

Add a script to create a git worktree on a new branch from the current
HEAD. Similar to pr2wt.sh but for local development branches instead of
PRs.

Usage:
  ./scripts/wc2wt.sh gg/new-feature
  ./scripts/wc2wt.sh gg/new-feature "bash -l"

Assisted-by: llama.cpp:local pi

* cont : no need to try to delete the branch
ljubomirj pushed a commit to ljubomirj/llama.cpp that referenced this pull request May 6, 2026
…22513)

* scripts : add wc2wt.sh - create worktree from current HEAD

Add a script to create a git worktree on a new branch from the current
HEAD. Similar to pr2wt.sh but for local development branches instead of
PRs.

Usage:
  ./scripts/wc2wt.sh gg/new-feature
  ./scripts/wc2wt.sh gg/new-feature "bash -l"

Assisted-by: llama.cpp:local pi

* cont : no need to try to delete the branch
meh pushed a commit to meh/llama.cpp that referenced this pull request May 10, 2026
…22513)

* scripts : add wc2wt.sh - create worktree from current HEAD

Add a script to create a git worktree on a new branch from the current
HEAD. Similar to pr2wt.sh but for local development branches instead of
PRs.

Usage:
  ./scripts/wc2wt.sh gg/new-feature
  ./scripts/wc2wt.sh gg/new-feature "bash -l"

Assisted-by: llama.cpp:local pi

* cont : no need to try to delete the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

script Script related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants