Skip to content

feat: add --project option to specify repository URL#28

Merged
dinncer merged 3 commits into
mainfrom
add-project-argv
Sep 19, 2025
Merged

feat: add --project option to specify repository URL#28
dinncer merged 3 commits into
mainfrom
add-project-argv

Conversation

@semiherdogan
Copy link
Copy Markdown
Member

This pull request improves the getRepoPath utility function to support more flexible repository identification. The main enhancement is the ability to parse the repository path from a project URL provided via the --project CLI argument, supporting both owner/repo format and various Bitbucket URL formats.

Repository parsing improvements:

  • Added logic to check for a global $bb_cli_project_url and extract the owner/repo from either a simple owner/repo string or several Bitbucket URL formats using regular expressions.
  • Throws a clear exception if the provided project URL does not match expected formats, improving error handling for invalid input.

Default behavior fallback:

  • Retains the original behavior of extracting the repository path from the local git configuration if no project URL is provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the getRepoPath utility function to support specifying a repository URL via a --project CLI option. The enhancement allows parsing repository paths from various formats while maintaining backward compatibility with existing git configuration-based behavior.

  • Added support for parsing repository paths from a global $bb_cli_project_url variable
  • Implemented pattern matching for multiple Bitbucket URL formats and simple owner/repo strings
  • Added error handling for invalid repository format inputs

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/utils/helpers.php Outdated
Comment thread src/utils/helpers.php Outdated
@dinncer dinncer merged commit 7e46b90 into main Sep 19, 2025
@dinncer dinncer deleted the add-project-argv branch September 19, 2025 09:21
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.

3 participants