Metacello / metacello

Metacello is a package management system for Smalltalk
MIT License
87 stars 43 forks source link

Unable to reference to git branch name containing slash in baseline/scripting API #544

Open LinqLover opened 3 years ago

LinqLover commented 3 years ago

I have a repository with a branch of the form feat/foo and was trying to reference it from another baseline using the common syntax:

spec repository: 'github://LinqLover/my-repo:feat/foo/packages'.

But this cannot work because this is interpreted as: branch = 'feat' + path = 'foo/packages'.

The relevant logic is in MCGitBasedNetworkRepository class >> #parseLocation:version:. A possible fix could be to support simple escaping in a form such as:

spec repository: 'github://LinqLover/my-repo:feat\/foo/packages'.

Another form of escaping might be an enclosing character for the entire branch name, but since different brackets and quotes are all legal characters for branch names[1], backslash-escaping would probably be the simplest possible way.

@dalehenrich Would you agree with this solution approach? Maybe I could find some time to patch the location parsing soon. :-)

[1] https://stackoverflow.com/a/3651867/13994294

LinqLover commented 3 years ago

Ah, I just discovered #234 ... Apparently this fix only works if the repository path is explicitly specified, which was not the case in my example.