From 32ff47ec045e04c341162d0645cf3fc110c15230 Mon Sep 17 00:00:00 2001 From: EJ Victoria Date: Fri, 24 Nov 2023 12:07:32 +0100 Subject: [PATCH] [android] The getPlugins scripts can now accept the --shallow argument Close https://github.com/JetBrains/intellij-community/pull/2595 GitOrigin-RevId: 54f2d033492babdbb91daba9e0d2e903062b99e0 --- README.md | 5 +++-- getPlugins.bat | 9 ++++++++- getPlugins.sh | 8 +++++++- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8b54391a34fd..3eed8c90091c 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ and build numbers for older releases of IntelliJ IDEA can be found on the page o These Git operations can also be done through the [IntelliJ IDEA user interface](https://www.jetbrains.com/help/idea/using-git-integration.html). -_**Speed Tip:**_ If the complete repository history isn't needed then using a shallow clone (`git clone --depth 1`) will save significant time. +_**Speed Tip:**_ If the complete repository history isn't needed, then using a shallow clone (`git clone --depth 1`) will save significant time. _**On Windows:**_ Two git options are required to check out sources on Windows. Since it's a common source of Git issues on Windows anyway, those options could be set globally (execute those commands before cloning any of intellij-community/android repositories): @@ -22,7 +22,8 @@ _**On Windows:**_ Two git options are required to check out sources on Windows. * `git config --global core.autocrlf input` IntelliJ IDEA Community Edition requires additional Android modules from separate Git repositories. To clone these repositories, -run one of the `getPlugins` scripts located in the `` directory. These scripts clone their respective *master* branches. Make sure you are inside the `` directory when running those scripts, so the modules get cloned inside the `` directory. +run one of the `getPlugins` scripts located in the `` directory. Use the `--shallow` argument if the complete repository history isn't needed. +These scripts clone their respective *master* branches. Make sure you are inside the `` directory when running those scripts, so the modules get cloned inside the `` directory. * `getPlugins.sh` for Linux or macOS. * `getPlugins.bat` for Windows. diff --git a/getPlugins.bat b/getPlugins.bat index a47705efed40..427bccd71b89 100644 --- a/getPlugins.bat +++ b/getPlugins.bat @@ -1 +1,8 @@ -call git clone git://git.jetbrains.org/idea/android.git android \ No newline at end of file +@echo off + +:ParseArgs +if "%~1" == "--shallow" ( + call git clone git://git.jetbrains.org/idea/android.git android --depth 1 +) else ( + call git clone git://git.jetbrains.org/idea/android.git android +) diff --git a/getPlugins.sh b/getPlugins.sh index a28e5a62d9a7..f0ff2229f68f 100755 --- a/getPlugins.sh +++ b/getPlugins.sh @@ -1 +1,7 @@ -git clone git://git.jetbrains.org/idea/android.git android \ No newline at end of file +#!/bin/bash + +if [ "$1" == "--shallow" ]; then + git clone git://git.jetbrains.org/idea/android.git android --depth 1 +else + git clone git://git.jetbrains.org/idea/android.git android +fi