Skip to content
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

[Feature] Support branch checkout for Git remote hook #122

Open
leehuwuj opened this issue Jul 13, 2023 · 0 comments
Open

[Feature] Support branch checkout for Git remote hook #122

leehuwuj opened this issue Jul 13, 2023 · 0 comments

Comments

@leehuwuj
Copy link

Hi guys,
Unlike the S3 or local file which we specify difference of Path corresponding to deployment environments, Git remote split them into difference branches, example, the main branch is stand for production, staging for non-production, etc,...
I think it would be better if the GitRemoteHook support it. After checking the code, i think it can implement easily because the dulwich module has already support it. My idea is allow user specify the branch directly in the project_dir which is equal to the git project url and implement a additional function to extract the base url and the target branch on it.
Example: https://github.com/tomasfarias/airflow-dbt-python/tree/staging
->
project_url=https://github.com/tomasfarias/airflow-dbt-python.git
branch=staging

Then specify the checkout=branch in dulwich's clone method:
ex: client.clone(path, str(destination), mkdir=not destination.exists(), checkout=branch)

I feel free to make a PR for contribution.

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

No branches or pull requests

1 participant