Skip to content

CLI: option to auto-detect GITLAB and project-id arguments from current git repo #3081

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

Open
aelmahmoudy opened this issue Jan 11, 2025 · 1 comment
Labels

Comments

@aelmahmoudy
Copy link

aelmahmoudy commented Jan 11, 2025

Please add a CLI option to auto-detect GITLAB (for -g argument) and project ID from the current git repo the gitlab command is run from. I implemented a shell wrapper around gitlab that basically would do the following:

  • git remote get-url $(git remote)
  • match the host of the above URL with entries in ~/.python-gitlab.cfg to get the GITLAB name
  • Use the last part of the remote URL as project ID

There might be a case of multiple remotes on the git repo., I would suggest adding --git-remote REMOTE argument for such case

@nejch nejch added the cli label Jan 21, 2025
@nejch
Copy link
Member

nejch commented Jan 21, 2025

Hey @aelmahmoudy, thanks for the request. I'm not sure about this as we're more of an API client and CLI, rather than a git workflow tool, and this would require reading git config.

I wouldn't prioritize this, but if you provide a PR that doesn't add any dependencies (especially as this would require calling git) I'm open to reviewing it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants