-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support :owner/:repo
template in repoPaths configuration
#343
Support :owner/:repo
template in repoPaths configuration
#343
Conversation
Fixes a minor typo introduced in d9ef14a
Previously, we supported a "wildcard" mapping like ``` user1/*: /path/to/user1_repos/* ``` to map any repository owned by `user1` to the directory of the same name within `/path/to/user1_repos`. But for folks who store all GitHub repositories under a path that includes the owner's name and the repo's name, this would still require them to enter a wildcard entry for every owner. To avoid that, we're introducing support for an `:owner/:repo` template in the `repoPaths` configuration. Now we can specify a `repoPaths` entry like: ``` :owner/:repo: /path/to/github.com/:owner/:repo ``` which will cover everything. It can still be overridden with individual entries that specify either an exact repository or a specific owner wildcard. In case the configured path includes the :`owner` or `:`repo substitution multiple times, we will replace all occurrences.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Thank you for reviewing and merging! And for creating this cool TUI :) BTW, one thing that I'm thinking about is that we don't really need the support for default_path: ~/code/repos can be achieved using the more general template support introduced in this PR via: :owner/:repo: ~/code/repos/:repo (In contrast, the example in the PR description cannot be achieved using Perhaps we could deprecate |
Another option would be to extend some-owner/some_repo: /path/to/some_repo
another-owner/*: /path/to/another-owner/*
:owner/:repo: /path/to/:owner/:repo Additionally, even changing the behavior of I've opened a PR here for deprecating |
Yeah totally agreed. |
So would you like to go straight to the breaking change and skip the soft deprecation PR? If so, I can close #344 and remove |
Summary
Previously, we supported a "wildcard" mapping like
to map any repository owned by
user1
to the directory of the same name within/path/to/user1_repos/
.But for folks who store all GitHub repositories under a path that includes the owner's name and the repo's name, this would still require them to enter a wildcard entry for every owner. To avoid that, this PR introduces support for an
:owner/:repo
template in therepoPaths
configuration. Now we can specify arepoPaths
entry like:which will cover everything. It can still be overridden with individual entries that specify either an exact repository or a specific owner wildcard.
How did you test this change?
I added more test cases to
ui/common/repopath_test.go
. I also built it locally and ran./gh-dash
using an:owner/:repo
template in myrepoPaths
configuration and confirmed that it was now able to successfully check out a PR using my configured location.