completion: no directory completion for repository URLs, fixes #10460 - #10472
Open
ThomasWaldmann wants to merge 1 commit into
Open
ThomasWaldmann wants to merge 1 commit into
ThomasWaldmann wants to merge 1 commit into
Conversation
…ckup#10460 -r/--repo and --other-repo completed local directories even when the value already started with a URL scheme like ssh:// or rclone:. In fish, this offered e.g. "ssh://etc/" (fish completes the part after the ":" as a path), tcsh printed "ssh:// not found". Now, a URL scheme other than file: (the ones Location parses as a URL) gets no completion in any shell, while local paths still complete directories: - bash, zsh, fish: new _borg_complete_repo_dirs helper - tcsh: a leading completion rule completing nothing for a URL, it is used before the directory rules of the repository options. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #10472 +/- ##
==========================================
+ Coverage 88.71% 88.73% +0.01%
==========================================
Files 103 103
Lines 19392 19399 +7
Branches 3024 3025 +1
==========================================
+ Hits 17204 17214 +10
+ Misses 1518 1515 -3
Partials 670 670 ☔ View full report in Codecov by Harness. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #10460.
-r/--repoand--other-repocompleted local directories even when the value already started with a URL scheme:borg repo-create --repo=ssh://<TAB>offeredssh://etc/,ssh://usr/, ... and--repo rclone:<TAB>offeredrclone:bin/, ... (fish completes the part after the:as a path).ssh:// not found.Now, once the value starts with a URL scheme other than
file:(the onesLocationparses as a URL: ssh, sftp, http, https, s3, b2, rclone), there is no completion in any shell. Local paths (andfile://in fish) still complete directories as before._borg_complete_repo_dirshelper: nothing for a URL, else the previous directory completion (fish also handles the attached-rURLform).'c/{--repo=,-r=,--other-repo=,}{ssh,sftp,...}:/n/'completes nothing for a URL; tcsh uses the first matching rule, so it wins over the directory rules. Side effect: any word starting with such a scheme gets no completion in tcsh.Tested interactively in all four shells, plus new regression tests per shell (they fail without the fix).
Not included: completing hostnames from
/etc/hosts/~/.ssh/configforssh://(could be a follow-up).🤖 Generated with Claude Code