gruntwork-io / git-xargs

git-xargs is a command-line tool (CLI) for making updates across multiple Github repositories with a single command.
https://blog.gruntwork.io/introducing-git-xargs-an-open-source-tool-to-update-multiple-github-repos-753f9f3675ec
Apache License 2.0
921 stars 63 forks source link

Feature Request: Add option to change clone depth #106

Open xaviergmail opened 1 year ago

xaviergmail commented 1 year ago

Describe the solution you'd like I would like a new --clone-depth CLI flag added, to be passed to cloneLocalRepository's git.CloneOptions.

Describe alternatives you've considered I also considered keeping the repositories cloned in a static non-temporary directory for faster batch operations across several repos which would be faster, but this seems easier to implement.

Additional context This would speed up running git-xargs in our org tremendously. We have ~180 repos, only a few archived but a --dry-run --skip-archived-repos with just echo hi as the script still takes 12 minutes, presumably due to large git histories with non-LFS binary data.

zackproser commented 1 year ago

@xaviergmail this sounds super reasonable. Thanks for the report. It may take us a while to get to this, but anybody is welcome to implement this and put up a PR in the meantime.

lindell commented 8 months ago

This is supported in a similar project I maintain called multi-gitter. You might want to check it out.

By default, it runs with a depth of 1. But any depth can be chosen.