mgorny 14/04/17 20:28:37 Modified: ChangeLog git-r3.eclass Log: Automatically switch to EGIT_CLONE_TYPE=single+tags for Google Code.
Revision Changes Path 1.1212 eclass/ChangeLog file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1212&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1212&content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.1211&r2=1.1212 Index: ChangeLog =================================================================== RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v retrieving revision 1.1211 retrieving revision 1.1212 diff -u -r1.1211 -r1.1212 --- ChangeLog 17 Apr 2014 18:16:54 -0000 1.1211 +++ ChangeLog 17 Apr 2014 20:28:37 -0000 1.1212 @@ -1,6 +1,9 @@ # ChangeLog for eclass directory # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1211 2014/04/17 18:16:54 kensington Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1212 2014/04/17 20:28:37 mgorny Exp $ + + 17 Apr 2014; Michał Górny <mgo...@gentoo.org> git-r3.eclass: + Automatically switch to EGIT_CLONE_TYPE=single+tags for Google Code. 17 Apr 2014; Michael Palimaka <kensing...@gentoo.org> kde4-meta.eclass: Sync with overlay. Remove unused inherit. Switch to git-r3 eclass. Fix file 1.41 eclass/git-r3.eclass file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/git-r3.eclass?rev=1.41&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/git-r3.eclass?rev=1.41&content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/git-r3.eclass?r1=1.40&r2=1.41 Index: git-r3.eclass =================================================================== RCS file: /var/cvsroot/gentoo-x86/eclass/git-r3.eclass,v retrieving revision 1.40 retrieving revision 1.41 diff -u -r1.40 -r1.41 --- git-r3.eclass 24 Mar 2014 21:32:31 -0000 1.40 +++ git-r3.eclass 17 Apr 2014 20:28:37 -0000 1.41 @@ -1,6 +1,6 @@ # Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/git-r3.eclass,v 1.40 2014/03/24 21:32:31 mgorny Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/git-r3.eclass,v 1.41 2014/04/17 20:28:37 mgorny Exp $ # @ECLASS: git-r3.eclass # @MAINTAINER: @@ -468,8 +468,25 @@ einfo "Fetching ${r} ..." local fetch_command=( git fetch "${r}" ) + local clone_type=${EGIT_CLONE_TYPE} - if [[ ${EGIT_CLONE_TYPE} == mirror ]]; then + if [[ ${r} == https://code.google.com/* ]]; then + # Google Code has special magic on top of git that: + # 1) can't handle shallow clones at all, + # 2) fetches duplicately when tags are pulled in with branch + # so automatically switch to single+tags mode. + if [[ ${clone_type} == shallow ]]; then + einfo " Google Code does not support shallow clones" + einfo " using EGIT_CLONE_TYPE=single+tags" + clone_type=single+tags + elif [[ ${clone_type} == single ]]; then + einfo " git-r3: Google Code does not send tags properly in 'single' mode" + einfo " using EGIT_CLONE_TYPE=single+tags" + clone_type=single+tags + fi + fi + + if [[ ${clone_type} == mirror ]]; then fetch_command+=( --prune # mirror the remote branches as local branches @@ -510,8 +527,8 @@ fi # fetching by commit in shallow mode? can't do. - if [[ ${EGIT_CLONE_TYPE} == shallow ]]; then - local EGIT_CLONE_TYPE=single + if [[ ${clone_type} == shallow ]]; then + clone_type=single fi fi fi @@ -526,7 +543,7 @@ "+${fetch_l}:${fetch_r}" ) - if [[ ${EGIT_CLONE_TYPE} == single+tags ]]; then + if [[ ${clone_type} == single+tags ]]; then fetch_command+=( # pull tags explicitly as requested "+refs/tags/*:refs/tags/*" @@ -534,11 +551,11 @@ fi fi - if [[ ${EGIT_CLONE_TYPE} == shallow ]]; then + if [[ ${clone_type} == shallow ]]; then if _git-r3_is_local_repo; then # '--depth 1' causes sandbox violations with local repos # bug #491260 - local EGIT_CLONE_TYPE=single + clone_type=single elif [[ ! $(git rev-parse --quiet --verify "${fetch_r}") ]] then # use '--depth 1' when fetching a new branch @@ -553,7 +570,7 @@ set -- "${fetch_command[@]}" echo "${@}" >&2 if "${@}"; then - if [[ ${EGIT_CLONE_TYPE} == mirror ]]; then + if [[ ${clone_type} == mirror ]]; then # find remote HEAD and update our HEAD properly git symbolic-ref HEAD \ "$(_git-r3_find_head refs/git-r3/HEAD \