Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH git-r3 05/10] Introduce EGIT_CLONE_TYPE for future use.
Date: Wed, 26 Feb 2014 12:02:03
Message-Id: 1393415954-19313-5-git-send-email-mgorny@gentoo.org
In Reply to: [gentoo-dev] [PATCHES git-r3] Clean up and different clone type support by "Michał Górny"
1 In this commit, it's just 'mirror' explained :).
2 ---
3 eclass/git-r3.eclass | 21 +++++++++++++++++++++
4 1 file changed, 21 insertions(+)
5
6 diff --git a/eclass/git-r3.eclass b/eclass/git-r3.eclass
7 index 8462fba..9c8508a 100644
8 --- a/eclass/git-r3.eclass
9 +++ b/eclass/git-r3.eclass
10 @@ -32,6 +32,19 @@ if [[ ! ${_INHERITED_BY_GIT_2} ]]; then
11 DEPEND="dev-vcs/git"
12 fi
13
14 +# @ECLASS-VARIABLE: EGIT_CLONE_TYPE
15 +# @DESCRIPTION:
16 +# Type of clone that should be used against the remote repository.
17 +# This can be either of: 'mirror'.
18 +#
19 +# The 'mirror' type clones all remote branches and tags with complete
20 +# history and all notes. EGIT_COMMIT can specify any commit hash.
21 +# Upstream-removed branches and tags are purged from the local clone
22 +# while fetching. This mode is suitable for cloning the local copy
23 +# for development or hosting a local git mirror. However, clones
24 +# of repositories with large diverged branches may quickly grow large.
25 +: ${EGIT_CLONE_TYPE:=mirror}
26 +
27 # @ECLASS-VARIABLE: EGIT3_STORE_DIR
28 # @DESCRIPTION:
29 # Storage directory for git sources.
30 @@ -107,6 +120,14 @@ fi
31 _git-r3_env_setup() {
32 debug-print-function ${FUNCNAME} "$@"
33
34 + # check the clone type
35 + case "${EGIT_CLONE_TYPE}" in
36 + mirror)
37 + ;;
38 + *)
39 + die "Invalid EGIT_CLONE_TYPE=${EGIT_CLONE_TYPE}"
40 + esac
41 +
42 local esc_pn livevar
43 esc_pn=${PN//[-+]/_}
44
45 --
46 1.8.3.2