1
0
mirror of https://github.com/git/git.git synced 2024-09-28 11:11:18 +02:00
Commit Graph

7 Commits

Author SHA1 Message Date
Johan Herland
e7fed18a89 git clone: Add --recursive to automatically checkout (nested) submodules
Many projects using submodules expect all submodules to be checked out
in order to build/work correctly. A common command sequence for
developers on such projects is:

	git clone url/to/project
	cd project
	git submodule update --init (--recursive)

This patch introduces the --recursive option to git-clone. The new
option causes git-clone to recursively clone and checkout all
submodules of the cloned project. Hence, the above command sequence
can be reduced to:

	git clone --recursive url/to/project

--recursive is ignored if no checkout is done by the git-clone.

The patch also includes documentation and a selftest.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-20 16:59:50 -07:00
Johan Herland
e3ae4a8613 t7407: Use 'rev-parse --short' rather than bash's substring expansion notation
The substring expansion notation is a bashism that we have not so far
adopted.  Use 'git rev-parse --short' instead, as this also handles
the case where the unique abbreviation is longer than 7 characters.

Also fix the typo; the object name for submodule #2 was copied from
submodule #1's by mistake.

Suggested-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-20 16:59:45 -07:00
Johan Herland
64b19ffedd git submodule status: Add --recursive to recurse into nested submodules
In very large and hierarchically structured projects, one may encounter
nested submodules. In these situations, it is valuable to not only show
status for all the submodules in the current repo (which is what is
currently done by 'git submodule status'), but also to show status for
all submodules at all levels (i.e. recursing into nested submodules as
well).

This patch teaches the new --recursive option to the 'git submodule status'
command. The patch also includes documentation and selftests.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-18 22:59:58 -07:00
Johan Herland
b13fd5c1a2 git submodule update: Introduce --recursive to update nested submodules
In very large and hierarchically structured projects, one may encounter
nested submodules. In these situations, it is valuable to not only update
the submodules in the current repo (which is what is currently done by
'git submodule update'), but also to operate on all submodules at all
levels (i.e. recursing into nested submodules as well).

This patch teaches the new --recursive option to the 'git submodule update'
command. The patch also includes documentation and selftests.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-18 22:59:12 -07:00
Johan Herland
15fc56a853 git submodule foreach: Add --recursive to recurse into nested submodules
In very large and hierarchically structured projects, one may encounter
nested submodules. In these situations, it is valuable to not only operate
on all the submodules in the current repo (which is what is currently done
by 'git submodule foreach'), but also to operate on all submodules at all
levels (i.e. recursing into nested submodules as well).

This patch teaches the new --recursive option to the 'git submodule foreach'
command. The patch also includes documentation and selftests.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-18 22:57:37 -07:00
Johan Herland
9aec7e0ba6 git submodule foreach: test access to submodule name as '$name'
Add verification of the behaviour of '$name' to the git submodule
foreach selftest.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-18 22:51:31 -07:00
Johan Herland
d69ecf6f0e Add selftest for 'git submodule foreach'
The selftest verifies that:
- only checked out submodules are visited by 'git submodule foreach'
- the $path, and $sha1 variables are set correctly for each submodule

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-18 22:50:40 -07:00