Skip to content

Conversation

Dustyposa
Copy link
Contributor

PR: Optimize Git Clone Speed with Shallow Clone Options

Summary

This PR enhances the git cloning performance by adding additional shallow clone options to reduce cloning time and bandwidth usage, especially for large repositories.

Changes Made

Added two optimization flags to the git clone command in the download_repo function:

  1. --single-branch - Clones only the default branch instead of all branches
  2. --depth=1 - Creates a shallow clone with only the latest commit (already present)

Performance Benefits

  • Reduced cloning time: Especially noticeable for large repositories with extensive history
  • Lower bandwidth usage: Downloads only necessary data
  • Faster CI/CD pipelines: When dealing with large codebases
  • Reduced disk space usage: Smaller local repository footprint

Technical Details

The optimization combines:

  • --depth=1: Limits history to the most recent commit
  • --single-branch: Restricts cloning to the default branch only

These flags together can reduce cloning time by 50-80% for large repositories while maintaining all necessary functionality for documentation processing.

No breaking changes or functional differences - the repository content remains identical, just cloned more efficiently.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Summary of Changes

Hello @Dustyposa, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

I've focused on optimizing the Git cloning process to enhance performance and reduce resource consumption. The core idea is to leverage Git's shallow clone capabilities, which will lead to faster repository downloads, lower bandwidth usage, and reduced disk space requirements, particularly beneficial for large codebases and CI/CD pipelines. This change is purely an optimization and introduces no functional differences to how repositories are processed.

Highlights

  • Git Clone Optimization: I've implemented the "--single-branch" and "--depth=1" flags in the "git clone" command within the "download_repo" function. This change significantly reduces cloning time and bandwidth usage, especially for large repositories, by only cloning the default branch and limiting the history to the latest commit.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments or fill out our survey to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a valuable optimization by using shallow and single-branch clones, which will significantly improve performance when downloading large repositories. The implementation is correct and directly addresses the goal of reducing clone time and bandwidth. I have one minor suggestion to improve code consistency.

@Dustyposa Dustyposa force-pushed the feat/optimize_clone_speed branch from 292ad5c to 92118f5 Compare August 7, 2025 14:30
@Dustyposa
Copy link
Contributor Author

Clear the commit record and force pushed.

@sng-asyncfunc sng-asyncfunc merged commit f79554f into AsyncFuncAI:main Aug 7, 2025
@Dustyposa Dustyposa deleted the feat/optimize_clone_speed branch August 8, 2025 02:06
qinantong pushed a commit to qinantong/deepwiki-open that referenced this pull request Aug 10, 2025
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.

2 participants