Skip to content
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

Accept github subdirs more than one level deep #399

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alexfmpe
Copy link

No description provided.

@@ -588,8 +589,8 @@ instance FromValue GitHub where
fromValue v = do
input <- fromValue v
case map T.unpack $ T.splitOn "/" input of
[owner, repo, subdir] -> return $ GitHub owner repo (Just subdir)
[owner, repo] -> return $ GitHub owner repo Nothing
(owner: _) | owner `elem` ["http:", "https:"] -> fail $ "expected owner/repo or owner/repo/subdir, but encountered url instead: " ++ show input
Copy link
Author

Choose a reason for hiding this comment

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

Had to add some hacky url detection because otherwise urls were being matched as

owner: "https:"
repo: ""
subdir: "github.com/sol/hpack/issues/365"

Not sure how to handle this robustly

Copy link
Owner

@sol sol left a comment

Choose a reason for hiding this comment

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

@alexfmpe Hey! Thanks for working on Hpack + sorry for the late response!

Instead of trying to shoehorn this into github:, how about we add more complete support for source-repository? At this point, I'm not eager to support everything from Cabal, but we can start with type, location and subdir (and possibly extend it in the future).

source-repository:
  type: git
  location: https://github.com/sol/hpack
  subdir: some/lengthy/path

source-repository: ... should take precedence over github: ..., that is if both github: ... and source-repository: ... are specified, then homepage, bug-reports should be derived from github: ... while the .cabal source-repository head should derived from source-repository: ...

Base automatically changed from master to main January 19, 2021 21:43
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