iceberg icon indicating copy to clipboard operation
iceberg copied to clipboard

Cannot checkout from branches containing /

Open hernanmd opened this issue 2 years ago • 5 comments

When trying to checkout from a branch with contains "/" character, the following error appears: NotFound: revspec 'feat' not found

How to reproduce:

EpMonitor disableDuring: [ 
        Metacello new   
                baseline: 'PackageFormulas';     
                onWarningLog;
                repository: 'github://hernanmd/package-formulas:feat/test/src';      
                load ].

With the current implementation, the #projectVersion method would obtain only the "feat" substring. Parsing of git path seem to be located in two places:

IceProviderRepositoryType>>projectVersion
MCGitBasedNetworkRepository>>parseProjectVersionField:desc:versionDelim:

The first one could be re-implemented as:

projectVersion

	| subs |
	^ (subs := location substrings: ':') size >= 3
		ifTrue: [ subs last ]
		ifFalse: [ String empty ]

While the second one probably should have another check to see if the last consumed $/ does not belong to a commitish with a slash.

Pharo Version: 11

hernanmd avatar Jan 16 '23 16:01 hernanmd

well, this is not iceberg related but metacello :P

estebanlm avatar Jan 25 '23 12:01 estebanlm

The method projectVersion is implemented in IceProviderRepositoryType, so the fix would be part of Iceberg (Iceberg-Metacello-Integration-RepoTypes).

hernanmd avatar Feb 02 '23 17:02 hernanmd

no, because all the infrastructure is metacello, and metacello is not prepared for that (but I may be wrong, feel free to send a PR that proves the opposite ;) )

On Feb 2 2023, at 6:09 pm, Hernán Morales Durand @.***> wrote:

The method projectVersion is implemented in IceProviderRepositoryType, so the fix would be part of Iceberg (Iceberg-Metacello-Integration-RepoTypes). — Reply to this email directly, view it on GitHub (https://github.com/pharo-vcs/iceberg/issues/1658#issuecomment-1414082471), or unsubscribe (https://github.com/notifications/unsubscribe-auth/AAD5MXRZFJXKZISHJ2K4MTLWVPS6NANCNFSM6AAAAAAT45W6UM). You are receiving this because you commented.

estebanlm avatar Feb 02 '23 17:02 estebanlm

no, because all the infrastructure is metacello, and metacello is not prepared for that (but I may be wrong, feel free to send a PR that proves the opposite ;) )

I don't know really, it is just a method :) Since we checked this with @guillep maybe he could comment here?

hernanmd avatar Feb 07 '23 22:02 hernanmd

There are some parts of it that are in metacello, but some others are part of Iceberg's metacello integration.

  • Metacello already supports to give an alternative host for gitlab/bitbucket urls, we should honor that properly
  • we have found a flaw in metacello's url definition when a project is inside a folder/organisation in gitlab (not iceberg related)
gitlab://rmod/folder/folder/project

metacello will thing that /project is the src folder and that /rmod/folder/folder is the project. But here what should happen is that /rmod/folder/folder/project is the project and the src folder is the root

We have worked that around by explicitly specifying the branch, which desambiguates the case:

gitlab://rmod/folder/folder/project:master

guillep avatar Feb 08 '23 09:02 guillep