feat(git-integration): optimize full clones by getting a single branch and skipping tags#3482
feat(git-integration): optimize full clones by getting a single branch and skipping tags#3482
Conversation
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
There was a problem hiding this comment.
Pull Request Overview
This pull request optimizes Git repository cloning operations by standardizing clone commands and improving efficiency. The changes ensure both minimal and full clone operations use consistent flags and target directories.
- Updated both minimal and full clone operations to use "." as target directory instead of full path
- Added
--no-tagsand--single-branchflags to full clone operation to match minimal clone behavior and reduce data transfer
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| """Perform full repository clone""" | ||
| self.logger.info(f"Performing full clone for repo {remote}...") | ||
| await run_shell_command(["git", "clone", remote, repo_path], cwd=repo_path) | ||
| await run_shell_command(["git", "clone", "--no-tags", "--single-branch", remote, "."], cwd=repo_path) |
There was a problem hiding this comment.
Adding --single-branch flag to full clone changes the behavior significantly - it will only clone the default branch instead of all branches. This contradicts the purpose of a 'full clone' which should include all branches. Consider removing --single-branch if the intention is to clone all branches, or rename the method to reflect the single-branch behavior.
| await run_shell_command(["git", "clone", "--no-tags", "--single-branch", remote, "."], cwd=repo_path) | |
| await run_shell_command(["git", "clone", "--no-tags", remote, "."], cwd=repo_path) |
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
This pull request updates the way Git repositories are cloned in the
clone_service.pymodule to ensure consistency and improve reliability. The changes primarily affect both minimal and full clone operations by standardizing the use of certain Git flags and target directories.Improvements to Git clone operations:
"."as the target directory instead of the full path, aligning with best practices for running commands inside the destination directory. [1] [2]--no-tagsand--single-branchflags to match the minimal clone behavior, which can help reduce unnecessary data transfer and speed up cloning.