Skip to content

fix(key): refuse a numbered fallback key longer than 64 characters - #525

Draft
roschaefer wants to merge 2 commits into
mainfrom
fix/64-fallback-key-length
Draft

roschaefer wants to merge 2 commits into
mainfrom
fix/64-fallback-key-length

Conversation

@roschaefer

@roschaefer roschaefer commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

When every candidate key of an upstream is taken, git-splice appends -2,
-3 and so on to the last candidate. Candidates can be 60 characters long,
so from -1000 on the key grew past the 64 characters a key may have. It
was still recorded in the repository's config, and from then on every
command refused that config until the key was renamed by hand.

Such a key is now refused before it is recorded, so the config stays
usable, and the refusal says how to record a key by hand. Shortening the
candidate to fit was tried and dropped: more code than a case that needs
999 taken keys is worth.

Fixes #64

When every candidate key of an upstream is taken, git-splice appends -2,
-3 and so on to the last candidate. Candidates can be 60 characters long,
so from -1000 on the key grew past the 64 characters a key may have. It
was still recorded in the repository's config, and from then on every
command refused that config until the key was renamed by hand.

The candidate is now cut short by the number's length before the number
is appended, dropping a '.', '_' or '-' left at the cut, and a key that
still isn't valid is refused instead of recorded.

Fixes #64
@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 41 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: dc24f1f0-e41a-49d6-a7a1-99c102fb7da1
Commits

Reviewing files that changed from the base of the PR and between cb3f483 and a535ebb.

Files selected for processing: 2

  • docs/tests/key.bats
  • src/repo.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Shortening the candidate handled an edge case that takes 999 taken
keys: more code than the case is worth. Refusing before recording keeps
the config readable, and a key recorded by hand is picked up as usual.
@roschaefer roschaefer changed the title fix(key): keep a numbered fallback key within 64 characters fix(key): refuse a numbered fallback key longer than 64 characters Nov 19, 2026

This branch has not been deployed

No deployments
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.

A numbered fallback key can exceed 64 characters, and then every command refuses the config

1 participant