Skip to content

Add shallow option to ecbuild_bundle#146

Open
mcakircali wants to merge 8 commits into
developfrom
feature/shallow-clone
Open

Add shallow option to ecbuild_bundle#146
mcakircali wants to merge 8 commits into
developfrom
feature/shallow-clone

Conversation

@mcakircali
Copy link
Copy Markdown

@mcakircali mcakircali commented May 21, 2026

Description

Adds a SHALLOW flag to ecbuild_git and ecbuild_bundle.

When SHALLOW is specified, initial checkouts use git clone --depth 1. If a specific BRANCH or TAG is combined with SHALLOW, it instructs Git to only clone that specific branch/tag (--branch ).

When combined with the RECURSIVE option, submodules are also initialized and updated using the --depth 1 flag.

NOTE:
Because Git cannot shallow clone a commit ID directly, SHALLOW will cause to throw if the TAG matches the pattern of a Git commit hash (SHA).

TAG <commit_hash> SHALLOW -> this will throw
TAG <tag_name> SHALLOW -> this will work

Contributor Declaration

By opening this pull request, I affirm the following:

  • All authors agree to the Contributor License Agreement.
  • The code follows the project's coding standards.
  • I have performed self-review and added comments where needed.
  • I have added or updated tests to verify that my changes are effective and functional.
  • I have run all existing tests and confirmed they pass.

Copy link
Copy Markdown

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

Adds a SHALLOW option to the bundle/git helper macros to support shallow checkouts (depth 1) and shallow submodule initialisation, reducing clone time and bandwidth for bundled projects.

Changes:

  • Extend ecbuild_git() with a SHALLOW option to add --depth 1 to initial clones and optionally submodule updates.
  • Update ecbuild_git() behaviour to avoid fetch/pull operations when SHALLOW is enabled.
  • Document the new SHALLOW option in ecbuild_git and ecbuild_bundle.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
cmake/ecbuild_git.cmake Implements SHALLOW cloning/submodule depth logic and adjusts fetch/pull behaviour.
cmake/ecbuild_bundle.cmake Documents the new SHALLOW option for bundle users (forwarded to ecbuild_git).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cmake/ecbuild_git.cmake
Comment thread cmake/ecbuild_git.cmake
@mcakircali mcakircali requested a review from simondsmart May 22, 2026 08:09
@marcosbento marcosbento self-requested a review May 26, 2026 15: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.

2 participants