can1357/oh-my-pi · warning · Error

`{operation}` is not supported on a {} repository

Error message

`{operation}` is not supported on a {} repository

What it means

pi-vcs's VcsError::Unsupported signals that a requested VCS operation has no implementation on the detected backend. Some operations (e.g. staged diffs) only make sense in git, which has an index; a Jujutsu workspace has no index, so the operation is refused instead of silently returning wrong data. The message interpolates the backend kind (`git` or `jj`) and the operation name.

Source

Thrown at crates/pi-vcs/src/error.rs:101

	/// Filesystem error outside any more specific failure mode.
	#[error(transparent)]
	Io(#[from] std::io::Error),

	/// An underlying gix / jj-lib failure that has no dedicated variant.
	#[error("{context}: {message}")]
	Backend {
		/// Operation being performed (`"git status"`, `"jj snapshot"`, …).
		context: &'static str,
		/// Backend error rendered as text (full source chain).
		message: String,
	},

	/// The operation was canceled via its interrupt flag.
	#[error("operation canceled")]
	Canceled,
	/// The operation has no implementation on this backend (e.g. staged diffs
	/// on a Jujutsu workspace, which has no index).
	#[error(
		"`{operation}` is not supported on a {} repository",
		match backend {
			crate::VcsKind::Git => "git",
			crate::VcsKind::Jj => "jj",
		}
	)]
	Unsupported {
		/// Operation or feature name as exposed to JS (camelCase).
		operation: &'static str,
		/// Backend that lacks it.
		backend:   crate::VcsKind,
	},
}

impl Error {
	/// Wrap an arbitrary backend error with the operation it occurred in.
	pub fn backend(context: &'static str, err: impl std::fmt::Display) -> Self {
		Self::Backend { context, message: err.to_string() }

View on GitHub (pinned to 9690622007)

Solutions

  1. Check the repository backend before invoking the operation (e.g. skip or degrade when VcsKind is Jj).
  2. Use a backend-neutral alternative (e.g. working-copy diff instead of a staged/index diff) that both git and jj implement.
  3. If you own the caller, gate the UI/command so it is hidden or labeled N/A for jj repositories.

Example fix

// before
const diff = await vcs.stagedDiff();
// after
if (vcs.kind === "jj") {
  const diff = await vcs.workingCopyDiff(); // index-free equivalent
} else {
  const diff = await vcs.stagedDiff();
}
Defensive patterns

Strategy: validation

Validate before calling

if (vcs.kind === VcsKind.Jj && operationNeedsIndex) {
  // skip or use workingCopyDiff()
}

Try / catch

try {
  await vcs.stagedDiff();
} catch (err) {
  if (err instanceof VcsError && err.kind === Unsupported) {
    return await vcs.workingCopyDiff();
  }
  throw err;
}

Prevention

When it happens

Trigger: Calling an operation such as staged diff (`git diff --cached` equivalent) on a Vcs instance whose backend is VcsKind::Jj; any Vcs trait method routed to a backend that returns Unsupported for that operation.

Common situations: Running the tool in a jj-managed repo (jj colocated with git or pure jj workspace) while code paths assume git semantics; generic tooling that enumerates VCS operations without checking backend capabilities first.

Related errors


AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31). Data as JSON: /api/errors/1b6a8f7d4fb6c03f. Report an issue: GitHub.