Skip to content

Add cross-repo id resolution + bw config set prefix with alias tracking#123

Merged
jallum merged 6 commits into
mainfrom
distill/cross-repo-prefix
May 9, 2026
Merged

Add cross-repo id resolution + bw config set prefix with alias tracking#123
jallum merged 6 commits into
mainfrom
distill/cross-repo-prefix

Conversation

@jallum

@jallum jallum commented Apr 24, 2026

Copy link
Copy Markdown
Owner

Cross-repo issue resolution via registry prefix lookup. bw show r0-abc from any repo resolves r0 to the registered repo and opens that store. -C accepts a prefix as shorthand for the full path. bw config set prefix tracks old prefixes as aliases so cross-repo refs survive renames. Prefixes are resolved live from each repo's .bwconfig, not cached in the registry.

@jallum jallum marked this pull request as draft April 24, 2026 11:32
@jallum jallum force-pushed the distill/cross-repo-prefix branch from 670af61 to 9e66207 Compare April 24, 2026 11:56
@jallum jallum force-pushed the distill/recap branch 2 times, most recently from a82273e to f1c0bb6 Compare April 24, 2026 13:18
@jallum jallum force-pushed the distill/cross-repo-prefix branch from 9e66207 to ae165a8 Compare April 24, 2026 13:18
@jallum jallum force-pushed the distill/cross-repo-prefix branch from ae165a8 to a94d956 Compare April 25, 2026 01:44
@jallum jallum force-pushed the distill/cross-repo-prefix branch 2 times, most recently from ff34349 to 061a26a Compare April 26, 2026 14:36
@jallum jallum force-pushed the distill/cross-repo-prefix branch from 061a26a to 9053db5 Compare May 7, 2026 12:16
@jallum jallum marked this pull request as ready for review May 7, 2026 12:32
@iautom8things iautom8things force-pushed the distill/cross-repo-prefix branch from 9053db5 to 45a1d7b Compare May 7, 2026 13:16
@iautom8things iautom8things self-requested a review May 8, 2026 16:16

@iautom8things iautom8things left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm good to merge this, as well, after #122 lands. I've been testing it locally and it looks good. 🚀 🚀 🚀

Base automatically changed from distill/recap to main May 9, 2026 18:14
iautom8things and others added 5 commits May 9, 2026 14:15
Teach the id resolver to consult the registry when a prefix doesn't
belong to the current repo:
- ec-42 in repo with prefix "bw" resolves to the repo registered under
  prefix "ec", as long as the prefix is unambiguous
- Ambiguous prefixes (multiple repos claim it) produce a clear error
  pointing at both paths
- -C now accepts either a path or a registered prefix/alias, so
  `bw -C ec list` works from anywhere
Let users rename a repo's prefix without losing history or breaking
cross-repo references:
- Open issues are renamed in place (filenames + content updated)
- Closed issues keep their original IDs so git history stays intact
- The old prefix is recorded as an alias in .bwconfig, so cross-repo
  lookups for old IDs continue to resolve
- Aliases are skipped when another repo has since claimed the old
  prefix, avoiding ambiguity errors on rename
Staticcheck flags containsStr, contains (treefs_test.go) and
isPrefixCandidate (cross_repo.go) as U1000. The treefs helpers were
orphaned when "Record unblocked events" swapped to errors.Is. The
prefix-candidate check is no longer called from the -C path after
the registry-backed resolver landed.
It never modifies the global config — the two-value return was
unnecessary ceremony from the rebase.
config set prefix is now a plain SetConfig like any other key —
no issue renaming, no alias bookkeeping, no collision detection
for aliases. Removes config_prefix.go, Aliases/SetAliases from
repo, and alias support from the registry and cross-repo resolver.
@jallum jallum force-pushed the distill/cross-repo-prefix branch from 45a1d7b to 4a22240 Compare May 9, 2026 18:16
@jallum jallum merged commit 202cadc into main May 9, 2026
1 check passed
@jallum jallum deleted the distill/cross-repo-prefix branch May 9, 2026 20:37
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

Successfully merging this pull request may close these issues.

2 participants