Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dev/wt.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#
# ## Forge platform
#
# Name the forge explicitly for SSH aliases or self-hosted instances, where it can't be detected from the remote URL:
# The forge is read from the remote's hostname: any host carrying `github`, `gitlab`, or `gitea` anywhere in it, plus the Azure DevOps service domains. Name the forge explicitly for a host carrying none of those, such as a Forgejo instance at `forge.example.com`:
#
# [forge]
# platform = "github" # or "gitlab", "gitea" (experimental), "azure-devops" (experimental)
Expand Down
2 changes: 1 addition & 1 deletion docs/content/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ url = "http://localhost:{{ branch | hash_port }}"

## Forge platform

Name the forge explicitly for SSH aliases or self-hosted instances, where it can't be detected from the remote URL:
The forge is read from the remote's hostname: any host carrying `github`, `gitlab`, or `gitea` anywhere in it, plus the Azure DevOps service domains. Name the forge explicitly for a host carrying none of those, such as a Forgejo instance at `forge.example.com`:

```toml
[forge]
Expand Down
2 changes: 1 addition & 1 deletion plugins/worktrunk/skills/worktrunk/reference/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ url = "http://localhost:{{ branch | hash_port }}"

## Forge platform

Name the forge explicitly for SSH aliases or self-hosted instances, where it can't be detected from the remote URL:
The forge is read from the remote's hostname: any host carrying `github`, `gitlab`, or `gitea` anywhere in it, plus the Azure DevOps service domains. Name the forge explicitly for a host carrying none of those, such as a Forgejo instance at `forge.example.com`:

```toml
[forge]
Expand Down
2 changes: 1 addition & 1 deletion skills/worktrunk/reference/config.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2401,7 +2401,7 @@ url = "http://localhost:{{ branch | hash_port }}"

## Forge platform

Name the forge explicitly for SSH aliases or self-hosted instances, where it can't be detected from the remote URL:
The forge is read from the remote's hostname: any host carrying `github`, `gitlab`, or `gitea` anywhere in it, plus the Azure DevOps service domains. Name the forge explicitly for a host carrying none of those, such as a Forgejo instance at `forge.example.com`:

```toml
[forge]
Expand Down
21 changes: 5 additions & 16 deletions src/commands/config/show.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ use worktrunk::styling::{

use crate::cli::{SwitchFormat, version_str};
use crate::commands::configure_shell::{ConfigAction, ConfigureResult, scan_shell_configs};
use crate::commands::legacy_forge_alias_diagnostic;
use crate::commands::list::ci_status::CiToolsStatus;
use crate::help_pager::show_help_in_pager;
use crate::llm::test_commit_generation;
Expand Down Expand Up @@ -506,21 +505,11 @@ fn render_diagnostics(out: &mut String) -> anyhow::Result<()> {
}
}
None => {
if let Some(alias) = repo.legacy_forge_alias() {
writeln!(
out,
"{}",
warning_message(legacy_forge_alias_diagnostic(&alias))
)?;
} else {
writeln!(
out,
"{}",
hint_message(
"CI status requires GitHub, GitLab, Gitea, or Azure DevOps remote"
)
)?;
}
writeln!(
out,
"{}",
hint_message("CI status requires GitHub, GitLab, Gitea, or Azure DevOps remote")
)?;
}
}

Expand Down
15 changes: 0 additions & 15 deletions src/commands/list/collect/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2017,21 +2017,6 @@ pub fn collect(
return Ok(None);
}

// The old substring classifier treated branded SSH aliases such as
// `github-personal` as forges. Keep provider dispatch on the safer exact
// boundary, but explain the migration once when this collection actually
// requested CI. Do this after final table rendering so resolving the
// effective URL cannot add a git subprocess to the skeleton's critical
// path. Picker collections route through the warning stash; the statusline
// uses `populate_item`, not this path, and remains silent.
if collected.ci
&& let Some(alias) = repo.legacy_forge_alias()
{
emit_warning(
warning_message(crate::commands::legacy_forge_alias_diagnostic(&alias)).to_string(),
);
}

// Status symbols are now computed during data collection (both modes), no fallback needed

// Display collection errors/warnings (after table rendering)
Expand Down
11 changes: 0 additions & 11 deletions src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ pub(crate) use worktree::{
pub(crate) use worktrunk::shell::Shell;

use color_print::cformat;
use worktrunk::git::LegacyForgeAlias;
use worktrunk::styling::{eprintln, format_with_gutter};

pub(crate) fn flag_pair(positive: bool, negative: bool) -> Option<bool> {
Expand All @@ -82,16 +81,6 @@ pub(crate) fn flag_pair(positive: bool, negative: bool) -> Option<bool> {
}
}

/// Actionable compatibility diagnostic for branded SSH aliases that no longer
/// cross the exact-label forge-classification boundary.
pub(crate) fn legacy_forge_alias_diagnostic(alias: &LegacyForgeAlias) -> String {
let platform = alias.platform().to_string();
let host = alias.host();
cformat!(
"SSH host alias <bold>{host}</> is not auto-detected as a forge; enable CI status and <bold>wt switch --prs</> with <bold>forge.platform = \"{platform}\"</> @ <bold>.config/wt.toml</>"
)
}

/// Format command execution label with optional command name.
///
/// Examples:
Expand Down
22 changes: 0 additions & 22 deletions src/commands/picker/prs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ use unicode_width::UnicodeWidthStr;
use worktrunk::git::{ForgeKind, RefType, Repository};
use worktrunk::styling::{HINT_SYMBOL, INFO_SYMBOL, StyledLine, WARNING_SYMBOL, warning_message};

use super::super::legacy_forge_alias_diagnostic;
use super::super::list::ci_status::{
CiSource, CiStatus, GitHubComment, GitHubPrInfo, PrRef, PrStatus, ReviewState,
non_interactive_cmd, tool_available,
Expand Down Expand Up @@ -641,9 +640,6 @@ fn fetch_open_prs(repo: &Repository) -> anyhow::Result<Vec<PrEntry>> {
anyhow::bail!("--prs supports GitHub and GitLab; this repository's forge is {other}")
}
None => {
if let Some(alias) = repo.legacy_forge_alias() {
anyhow::bail!("{}", legacy_forge_alias_diagnostic(&alias));
}
anyhow::bail!("--prs could not determine the forge from the remote URL")
}
}
Expand Down Expand Up @@ -1841,24 +1837,6 @@ mod tests {
);
}

#[test]
fn fetch_open_prs_explains_legacy_forge_alias_configuration() {
let test = worktrunk::testing::TestRepo::with_initial_commit();
test.run_git(&[
"remote",
"add",
"origin",
"git@github-personal:owner/repo.git",
]);
let err = fetch_open_prs(&test.repo)
.expect_err("expected --prs to require explicit forge config");
let message = err.to_string();
assert!(
message.contains("github-personal") && message.contains("forge.platform = \"github\""),
"unexpected error: {err:#}"
);
}

#[test]
fn fetch_open_prs_bails_on_an_unsupported_forge() {
// A recognized-but-unsupported forge (here Gitea, by its host) reports
Expand Down
6 changes: 3 additions & 3 deletions src/config/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ pub struct ProjectCommitGenerationConfig {

/// Project-level forge configuration.
///
/// Names the forge explicitly, for repos where URL-based detection can't
/// determine it (e.g., SSH host aliases, GitHub Enterprise, or self-hosted
/// GitLab with custom domains).
/// Names the forge explicitly, for a remote whose hostname carries no forge
/// name for [`ForgeKind::from_host`](crate::git::ForgeKind::from_host) to read
/// (a Forgejo instance at `forge.example.com`, a company git server).
///
/// # Example
///
Expand Down
Loading
Loading