[go: up one dir, main page]

Skip to content

No separator between branch name and file path in GitLab URL

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Problem to solve

I believe GitLab currently doesn't support the reading of file content using a raw URL with cURL or programmatically with private token. So in order to read file content for the specified GitLab URL we need to use GitLab repository-files API. In order to use the repository-files API successfully, we need to pass the projectIdOrPath, filePath and branchName. The way the GitLab URL is formed currently there is a separator between project path and branch name but there is not separator between branch name and file path so it's difficult to derive all three values (projectIdOrPath, filePath and branchName) dynamically by parsing the GitLab URL.

Intended users

Anybody who wants to read GitLab file content using GitLab repository-file API for the specific GitLab file URL.

Proposal

Instead of: https://gitlab.com/some/project/path/-/blob/branchname/some/file/path

Becomes: https://gitlab.com/some/project/path/-/blob/branchname/-/some/file/path

Edited by 🤖 GitLab Bot 🤖