Skip to content

Names are words, every search lets you pick, setup keeps rules it didn't write - #5

Merged
ashtonian merged 1 commit into
masterfrom
names-as-words
Oct 14, 2026
Merged

ashtonian merged 1 commit into
masterfrom
names-as-words

Conversation

@ashtonian

Copy link
Copy Markdown
Owner

Why

Searching an org for a team's repos by name caught every name that merely contained the term: *billing* matches rebilling. Narrowing the result meant starting the search over. Repos added later with clone --save could also be rewritten by the next gitten setup.

Changes

  • Names are words. A name filter without wildcards matches whole words of the repo's name. billing matches billing-api, team-billing and BillingPortal, but not rebilling. Words split at punctuation, camelCase, and where letters meet digits. With *, ? or [...] it's still a glob over the whole name.
  • Pick from the list. Setup's preview now says how many repos each name matched, and offers three choices: track them all, pick from the list (a checklist with every match ticked), or change the search. gitten clone with a selection asks the same on a terminal before cloning. Repos you untick go in the rule's new skip:, matched by exact name, and new matches still arrive.
  • Setup keeps rules it didn't write. Each tracked owner now remembers its rule, an owner can have several, and setup only edits rules for an organization, a group, or the account's own repos. Search rules and other users' rules are left as they are. Before, a re-run could take a search rule for your own repos and rewrite it, or merge two rules for one org into one.
  • Smaller output fixes. clone says what it searches and where (Searching acme's repos on github.com...), and discover's preview mentions clone ... --save for tracking more.
  • Docs. The README gets a Finding your repos walkthrough, first time and later, plus a "Matching names" table that a test checks against the matcher. SPEC, config.example.yaml and the examples are updated too.

Test plan

  • go test -race ./..., vet, gofmt, golangci-lint, and the full e2e suite run uncached.
  • Unit tests:
    • name matching, including every row of the README table;
    • skip filtering and validation;
    • a re-run keeps a search rule, another user's rule, and a second rule for an org, and removes only an untracked owner's rule;
    • tracksFor, matchCounts, and trackLabel with skip.
  • Drove the real wizard in a pseudo-terminal: preview with by name: gitten 1, pkg 1, then pick from the list and untick one. The review showed skip: [gitten], and the clone question said 1 repo.
  • Live against GitHub: clone --org charmbracelet --name bubbletea matches bubbletea and bubbletea-app-template, not bubbles.

…n't write

A name filter without a wildcard matches whole words of a repo's name:
billing matches billing-api, team-billing and BillingPortal but not
rebilling, which a substring glob caught. Words split at punctuation,
camelCase and where letters meet digits; with *, ? or [...] it is still
a glob over the whole name.

Setup's preview says how many repos each name matched, so one that
catches more than meant stands out, and offers three ways on: track them
all, pick from the list -- a checklist with every match ticked -- or
choose again. clone with a selection asks the same before cloning
anything on a terminal, and names what it searches and where. Repos
picked off go in their rule's skip: left out by exact name, while new
matches still arrive.

Re-running setup read every rule of an account's provider as one of its
owners: a rule clone --save added for a search or another user was
taken for the account's own repos and rewritten, and two rules for one
organization collapsed into one. A track now remembers its rule, an
owner can have several, and setup edits only the rules for an
organization, a group or the account's own repos, leaving the rest as
they are.

discover's preview also says how to track more. The README opens a
walkthrough of finding repos, the first time and later, with a table of
what a name matches that the tests hold it to; SPEC, config.example and
the examples say the same.
@ashtonian
ashtonian merged commit 3f13b2d into master Oct 14, 2026
5 checks passed
@ashtonian
ashtonian deleted the names-as-words branch October 14, 2026 22:13
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.

1 participant