diff --git a/docs/docsite/rst/dev_guide/developing_modules_general.rst b/docs/docsite/rst/dev_guide/developing_modules_general.rst index 0fcedbb..d72b5cd 100644 --- a/docs/docsite/rst/dev_guide/developing_modules_general.rst +++ b/docs/docsite/rst/dev_guide/developing_modules_general.rst @@ -35,7 +35,7 @@ Due to dependencies (for example ansible -> paramiko -> pynacl -> libffi): Common Environment setup ```````````````````````` 1. Clone the Ansible repository: - ``$ git clone https://github.com/ansible/ansible.git`` + ``$ git clone --depth 1 https://github.com/ansible/ansible.git`` 2. Change directory into the repository root dir: ``$ cd ansible`` 3. Create a virtual environment: ``$ python3 -m venv venv`` (or for Python 2 ``$ virtualenv venv``. Note, this requires you to install diff --git a/docs/docsite/rst/dev_guide/developing_modules_general_OLD._rst b/docs/docsite/rst/dev_guide/developing_modules_general_OLD._rst index 4e046af..d7bf052 100644 --- a/docs/docsite/rst/dev_guide/developing_modules_general_OLD._rst +++ b/docs/docsite/rst/dev_guide/developing_modules_general_OLD._rst @@ -44,7 +44,7 @@ Environment setup ================= 1. Clone the Ansible repository: - ``$ git clone https://github.com/ansible/ansible.git`` + ``$ git clone --depth 1 https://github.com/ansible/ansible.git`` 2. Change directory into the repository root dir: ``$ cd ansible`` 3. Create a virtual environment: ``$ python3 -m venv venv`` (or for Python 2 ``$ virtualenv venv``. Note, this requires you to install @@ -357,7 +357,7 @@ Environment setup ================= 1. Clone the Ansible repository: - ``$ git clone https://github.com/ansible/ansible.git`` + ``$ git clone --depth 1 https://github.com/ansible/ansible.git`` 2. Change directory into the repository root dir: ``$ cd ansible`` 3. Create a virtual environment: ``$ python3 -m venv venv`` (or for Python 2 ``$ virtualenv venv``. Note, this requires you to install @@ -670,7 +670,7 @@ Environment setup ================= 1. Clone the Ansible repository: - ``$ git clone https://github.com/ansible/ansible.git`` + ``$ git clone --depth 1 https://github.com/ansible/ansible.git`` 2. Change directory into the repository root dir: ``$ cd ansible`` 3. Create a virtual environment: ``$ python3 -m venv venv`` (or for Python 2 ``$ virtualenv venv``. Note, this requires you to install @@ -983,7 +983,7 @@ Environment setup ================= 1. Clone the Ansible repository: - ``$ git clone https://github.com/ansible/ansible.git`` + ``$ git clone --depth 1 https://github.com/ansible/ansible.git`` 2. Change directory into the repository root dir: ``$ cd ansible`` 3. Create a virtual environment: ``$ python3 -m venv venv`` (or for Python 2 ``$ virtualenv venv``. Note, this requires you to install @@ -1296,7 +1296,7 @@ Environment setup ================= 1. Clone the Ansible repository: - ``$ git clone https://github.com/ansible/ansible.git`` + ``$ git clone --depth 1 https://github.com/ansible/ansible.git`` 2. Change directory into the repository root dir: ``$ cd ansible`` 3. Create a virtual environment: ``$ python3 -m venv venv`` (or for Python 2 ``$ virtualenv venv``. Note, this requires you to install diff --git a/docs/docsite/rst/dev_guide/developing_modules_general_windows.rst b/docs/docsite/rst/dev_guide/developing_modules_general_windows.rst index 562ca2e..8f5bd1f 100644 --- a/docs/docsite/rst/dev_guide/developing_modules_general_windows.rst +++ b/docs/docsite/rst/dev_guide/developing_modules_general_windows.rst @@ -128,7 +128,7 @@ To provision the environment as is, run the following: .. code-block:: shell - git clone https://github.com/jborean93/ansible-windows.git + git clone --depth 1 https://github.com/jborean93/ansible-windows.git cd vagrant vagrant up diff --git a/docs/docsite/rst/dev_guide/testing.rst b/docs/docsite/rst/dev_guide/testing.rst index 899f851..7b3dd66 100644 --- a/docs/docsite/rst/dev_guide/testing.rst +++ b/docs/docsite/rst/dev_guide/testing.rst @@ -122,7 +122,7 @@ Here's how: Create a fresh area to work:: - git clone https://github.com/ansible/ansible.git ansible-pr-testing + git clone --depth 1 https://github.com/ansible/ansible.git ansible-pr-testing cd ansible-pr-testing Next, find the pull request you'd like to test and make note of the line at the top which describes the source diff --git a/docs/docsite/rst/installation_guide/intro_installation.rst b/docs/docsite/rst/installation_guide/intro_installation.rst index 17575dc..68a15d7 100644 --- a/docs/docsite/rst/installation_guide/intro_installation.rst +++ b/docs/docsite/rst/installation_guide/intro_installation.rst @@ -129,7 +129,7 @@ You can also build an RPM yourself. From the root of a checkout or tarball, use .. code-block:: bash - $ git clone https://github.com/ansible/ansible.git + $ git clone --depth 1 https://github.com/ansible/ansible.git $ cd ./ansible $ make rpm $ sudo rpm -Uvh ./rpm-build/ansible-*.noarch.rpm @@ -312,7 +312,7 @@ To install from source, clone the Ansible git repository: .. code-block:: bash - $ git clone https://github.com/ansible/ansible.git --recursive + $ git clone --depth 1 https://github.com/ansible/ansible.git --recursive $ cd ./ansible Once git has cloned the Ansible repository, setup the Ansible environment: diff --git a/docs/docsite/rst/user_guide/windows_faq.rst b/docs/docsite/rst/user_guide/windows_faq.rst index b9a343a..bd3c494 100644 --- a/docs/docsite/rst/user_guide/windows_faq.rst +++ b/docs/docsite/rst/user_guide/windows_faq.rst @@ -54,7 +54,7 @@ installed version and then clone the git repo. .. code-block:: shell pip uninstall ansible -y - git clone https://github.com/ansible/ansible.git + git clone --depth 1 https://github.com/ansible/ansible.git source ansible/hacking/env-setup # to enable Ansible on login, run the following diff --git a/lib/ansible/modules/source_control/git.py b/lib/ansible/modules/source_control/git.py index c90a68a..96055b2 100644 --- a/lib/ansible/modules/source_control/git.py +++ b/lib/ansible/modules/source_control/git.py @@ -60,7 +60,7 @@ version_added: "1.5" reference: description: - - Reference repository (see "git clone --reference ...") + - Reference repository (see "git clone --depth 1 --reference ...") version_added: "1.4" remote: description: @@ -832,7 +832,7 @@ def switch_version(git_path, module, dest, remote, version, verify_commit, depth # FIXME check for local_branch first, should have been fetched already if is_remote_branch(git_path, module, dest, remote, version): if depth and not is_local_branch(git_path, module, dest, version): - # git clone --depth implies --single-branch, which makes + # git clone --depth 1 --depth implies --single-branch, which makes # the checkout fail if the version changes # fetch the remote branch, to be able to check it out next set_remote_branch(git_path, module, dest, remote, version, depth) diff --git a/packaging/debian/README.md b/packaging/debian/README.md index 7eaa472..182748f 100644 --- a/packaging/debian/README.md +++ b/packaging/debian/README.md @@ -7,7 +7,7 @@ __Note__: You must run this target as root or set `PBUILDER_BIN='sudo pbuilder'` ``` apt-get install python-docutils cdbs debootstrap devscripts make pbuilder python-setuptools -git clone https://github.com/ansible/ansible.git +git clone --depth 1 https://github.com/ansible/ansible.git cd ansible DEB_DIST='xenial trusty precise' make deb ``` @@ -15,7 +15,7 @@ DEB_DIST='xenial trusty precise' make deb Building in Docker: ``` -git clone https://github.com/ansible/ansible.git +git clone --depth 1 https://github.com/ansible/ansible.git cd ansible docker build -t ansible-deb-builder -f packaging/debian/Dockerfile . docker run --privileged -e DEB_DIST='trusty' -v $(pwd):/ansible ansible-deb-builder diff --git a/test/integration/targets/ansible-galaxy/runme.sh b/test/integration/targets/ansible-galaxy/runme.sh index 58f9a0a..ea84841 100755 --- a/test/integration/targets/ansible-galaxy/runme.sh +++ b/test/integration/targets/ansible-galaxy/runme.sh @@ -81,7 +81,7 @@ f_ansible_galaxy_status \ galaxy_testdir=$(mktemp -d) pushd "${galaxy_testdir}" - git clone "${galaxy_local_test_role_git_repo}" "${galaxy_local_test_role}" + git clone --depth 1 "${galaxy_local_test_role_git_repo}" "${galaxy_local_test_role}" ansible-galaxy init roles-path-bug pushd roles-path-bug cat < ansible.cfg diff --git a/test/integration/targets/git/tasks/separate-git-dir.yml b/test/integration/targets/git/tasks/separate-git-dir.yml index 56ff6ef..5edd621 100644 --- a/test/integration/targets/git/tasks/separate-git-dir.yml +++ b/test/integration/targets/git/tasks/separate-git-dir.yml @@ -12,7 +12,7 @@ register: tempdir - name: SEPARATE-GIT-DIR | clone with a separate git dir - command: git clone {{ repo_format1 }} {{ checkout_dir }} --separate-git-dir={{ tempdir.stdout }} + command: git clone --depth 1 {{ repo_format1 }} {{ checkout_dir }} --separate-git-dir={{ tempdir.stdout }} - name: SEPARATE-GIT-DIR | update repo the usual way git: