Repository navigation
feat(list): add repo_url to JSON output - #2941
Conversation
Add a top-level `repo_url` field to `wt list --format=json` and `wt list statusline --format=json`, derived locally from the primary remote (`GitRemoteUrl::web_url` / `Repository::repo_web_url`). This converts SSH remotes to their HTTPS web URL so consumers stop shelling out to `git remote get-url` plus a hand-rolled SSH->HTTPS conversion. Also add `ci.repo_url`: the repository a PR/MR targets, derived from `ci.url` via `repo_url_from_ref_url`. In a fork checkout the primary remote points at the contributor's fork, while the PR lives on the upstream; keeping these as two fields lets a consumer pick the local repo (`repo_url`) or the PR's target repo (`ci.repo_url`) without either field lying. `web_url` feeds the parsed Azure org/project into the canonical `azure::fork_remote_url` builder, and `repo_url_from_ref_url` shares a tokenizer with `parse_ref_url`, so the per-forge URL shapes live in one place each.
|
looks good @bendrucker , thanks! @worktrunk-bot anything we need to look over in particular? is Azure treated differently from others? is there a way to totally abstract out of the specific forge here? |
|
Is Azure treated differently? Yes, materially — and it has to be. Azure URLs don't fit the standard Could the forge dispatch be abstracted away? Partially. The natural shape is a One concrete thing worth a look in this PR: there are now two independent paths from "the same PR" to a repo web URL — Otherwise the shape looks right — local-only derivation, shared tokenizer in |
|
thank you @bendrucker ! merging as experimental, haven't done quite enough checking but trust you! |
|
If there are going to be edge cases I tend to assume they're most likely with the Azure repos. If any bugs come up, happy to work on them. |
|
Was going to follow up with accepting URL on |
yes nice! (though would it need a change for the Azure format?) |
v0.56.0. `cargo semver-checks` reports a breaking library API change: the config-deprecation refactor (#2946) replaced the public `Deprecations` struct with a `Vec<DeprecationKind>` alias, removing the struct shape. Not intentional public API, but it forces a minor bump pre-1.0. ## CHANGELOG ### Improved - **`wt list` JSON output includes `repo_url`**: Each item now carries `repo_url`, the repository's web URL derived from the primary remote (absent when there's no parseable forge remote). It's the local checkout's repo — distinct from `ci.repo_url`, which is the repo a PR/MR targets. ([#2941](#2941), thanks @bendrucker) ### Fixed - **Bare-repo prompts**: Two UX fixes. `wt config create --project` run in a bare repo with no linked worktrees now explains the next step (`wt switch <branch>` first, then create from inside the worktree) instead of failing with a generic "no worktree found". And the bare-repo worktree-path prompt no longer fires for symbolic identifiers (`-`, `@`, `^`, `pr:`/`mr:`), where the example paths would be misleading — it waits for the next switch to a concrete branch name. ([#2951](#2951), thanks @ammachado) - **Context gauge spacing in the Claude Code statusline**: The context-gauge moon emoji rendered flush against the percent (`🌕42%`). Most terminals draw the emoji double-width and bleed it into the next cell, so the moon collided with the digits; it now carries a trailing space (`🌕 42%`). ([#2944](#2944)) - **Console storm on Windows**: Detached background hook processes were created with `DETACHED_PROCESS`, which could flash a burst of console windows. They now use `CREATE_NO_WINDOW` and spawn fully hidden. ([#2959](#2959), thanks @nathanbabcock) ### Documentation - **Codex commit-generation model bumped to `gpt-5.4-mini`**: The recommended `[commit.generation]` command for Codex — shown by `wt config create` and in the LLM-commits docs — now uses `gpt-5.4-mini` (was `gpt-5.1-codex-mini`). ([#2949](#2949)) ### Internal - **Config-deprecation layer refactor**: The deprecation detector now returns a `Vec<DeprecationKind>` instead of a struct of per-field flags, and the per-section config-table walks collapse into two combinators. Behavior-neutral — warning text and migration output are byte-for-byte unchanged. ([#2946](#2946)) > _This was written by Claude Code on behalf of max_
worktrunk 0.56.0 Created-by: HarmonybrewBot Commit-by: HarmonybrewBot Merged-by: HarmonybrewBot Description: Created by `brew bump` --- Created with `brew bump-formula-pr`.<details> <summary>release notes</summary> <pre>## Release Notes ### Improved - **`wt list` JSON output includes `repo_url`**: Each item now carries `repo_url`, the repository's web URL derived from the primary remote (absent when there's no parseable forge remote). It's the local checkout's repo — distinct from `ci.repo_url`, which is the repo a PR/MR targets. ([#2941](max-sixty/worktrunk#2941), thanks @bendrucker) ### Fixed - **Bare-repo prompts**: Two UX fixes. `wt config create --project` run in a bare repo with no linked worktrees now explains the next step (`wt switch <branch>` first, then create from inside the worktree) instead of failing with a generic "no worktree found". And the bare-repo worktree-path prompt no longer fires for symbolic identifiers (`-`, `@`, `^`, `pr:`/`mr:`), where the example paths would be misleading — it waits for the next switch to a concrete branch name. ([#2951](max-sixty/worktrunk#2951), thanks @ammachado) - **Context gauge spacing in the Claude Code statusline**: The context-gauge moon emoji rendered flush against the percent (`🌕42%`). Most terminals draw the emoji double-width and bleed it into the next cell, so the moon collided with the digits; it now carries a trailing space (`🌕 42%`). ([#2944](max-sixty/worktrunk#2944)) - **Console storm on Windows**: Detached background hook processes were created with `DETACHED_PROCESS`, which could flash a burst of console windows. They now use `CREATE_NO_WINDOW` and spawn fully hidden. ([#2959](max-sixty/worktrunk#2959), thanks @nathanbabcock) ### Documentation - **Codex commit-generation model bumped to `gpt-5.4-mini`**: The recommended `[commit.generation]` command for Codex — shown by `wt config create` and in the LLM-commits docs — now uses `gpt-5.4-mini` (was `gpt-5.1-codex-mini`). ([#2949](max-sixty/worktrunk#2949)) ### Internal - **Config-deprecation layer refactor**: The deprecation detector now returns a `Vec<DeprecationKind>` instead of a struct of per-field flags, and the per-section config-table walks collapse into two combinators. Behavior-neutral — warning text and migration output are byte-for-byte unchanged. ([#2946](max-sixty/worktrunk#2946)) ## Install worktrunk 0.56.0 ### Install prebuilt binaries via shell script ```sh curl --proto '=https' --tlsv1.2 -LsSf https://github.com/max-sixty/worktrunk/releases/download/v0.56.0/worktrunk-installer.sh | sh && wt config shell install ``` ### Install prebuilt binaries via powershell script ```sh powershell -ExecutionPolicy Bypass -c "irm https://github.com/max-sixty/worktrunk/releases/download/v0.56.0/worktrunk-installer.ps1 | iex"; git-wt config shell install ``` ### Install prebuilt binaries via Homebrew ```sh brew install worktrunk && wt config shell install ``` ## Download worktrunk 0.56.0 | File | Platform | Checksum | |--------|----------|----------| | [worktrunk-aarch64-apple-darwin.tar.xz](https://github.com/max-sixty/worktrunk/releases/download/v0.56.0/worktrunk-aarch64-apple-darwin.tar.xz) | Apple Silicon macOS | [checksum](https://github.com/max-sixty/worktrunk/releases/download/v0.56.0/worktrunk-aarch64-apple-darwin.tar.xz.sha256) | | [worktrunk-x86_64-apple-darwin.tar.xz](https://github.com/max-sixty/worktrunk/releases/download/v0.56.0/worktrunk-x86_64-apple-darwin.tar.xz) | Intel macOS | [checksum](https://github.com/max-sixty/worktrunk/releases/download/v0.56.0/worktrunk-x86_64-apple-darwin.tar.xz.sha256) | | [worktrunk-x86_64-pc-windows-msvc.zip](https://github.com/max-sixty/worktrunk/releases/download/v0.56.0/worktrunk-x86_64-pc-windows-msvc.zip) | x64 Windows | [checksum](https://github.com/max-sixty/worktrunk/releases/download/v0.56.0/worktrunk-x86_64-pc-windows-msvc.zip.sha256) | | [worktrunk-aarch64-unknown-linux-musl.tar.xz](https://github.com/max-sixty/worktrunk/releases/download/v0.56.0/worktrunk-aarch64-unknown-linux-musl.tar.xz) | ARM64 MUSL Linux | [checksum](https://github.com/max-sixty/worktrunk/releases/download/v0.56.0/worktrunk-aarch64-unknown-linux-musl.tar.xz.sha256) | | [worktrunk-x86_64-unknown-linux-musl.tar.xz](https://github.com/max-sixty/worktrunk/releases/download/v0.56.0/worktrunk-x86_64-unknown-linux-musl.tar.xz) | x64 MUSL Linux | [checksum](https://github.com/max-sixty/worktrunk/releases/download/v0.56.0/worktrunk-x86_64-unknown-linux-musl.tar.xz.sha256) | ### Install via Cargo ```sh cargo install worktrunk && wt config shell install ``` ### Install via Winget (Windows) ```sh winget install max-sixty.worktrunk && git-wt config shell install ``` ### Install via AUR (Arch Linux) ```sh paru worktrunk-bin && wt config shell install ``` </pre> <p>View the full release notes at <a href="https://github.com/max-sixty/worktrunk/releases/tag/v0.56.0">https://github.com/max-sixty/worktrunk/releases/tag/v0.56.0</a>.</p> </details> <hr> See merge request: Harmonybrew/homebrew-core!10277
Adds a top-level
repo_urltowt list --format=jsonandwt list statusline --format=json, derived locally from the primary remote. Consumers that want a link to the repository itself (not the PR) currently shell out togit remote get-urland convert SSH to HTTPS by hand;repo_urldoes that from the already-parsed remote.Also adds
ci.repo_url: the repository a PR/MR targets, derived fromci.url. In a fork checkout the primary remote is the contributor's fork while the PR lives upstream, so the two can differ —repo_urlnames the local repo,ci.repo_urlnames the PR target. I kept them as separate fields so neither has to guess which one the consumer meant.Notes
GitRemoteUrl::web_url()owns the per-forge shape, including the Azuredev.azure.com/*.visualstudio.comsplit; it callsazure::fork_remote_urlrather than duplicating the format.repo_url_from_ref_url()shares a tokenizer with the existingparse_ref_url, so PR/MR URL shapes live in one place.