From 7c954c8e61e7f0e2302ebd4ed87c326de5b0a1fa Mon Sep 17 00:00:00 2001 From: "Kai Tetzlaff (NSN/LinSEE)" Date: Wed, 25 Sep 2013 11:02:11 +0200 Subject: [PATCH] add support for git clone without checkout to e.g. allow configuring sparse checkouts --- vcs.mk | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/vcs.mk b/vcs.mk index ceedd4a..48e4f64 100644 --- a/vcs.mk +++ b/vcs.mk @@ -14,13 +14,13 @@ all: updaterepos %/initrepos: $(MAKE) -C $* $(@F) -HG := hg -GIT := git -BZR := bzr -SVN := svn -#BZR := $(or $(patsubst %,"%",$(subst /,$(DIRSEP),$(wildcard c:/Program?Files/Bazaar/bzr.exe))),bzr) -CVS := $(or $(patsubst %,"%",$(subst /,$(DIRSEP),$(wildcard c:/Program?Files/CVS?Suite/cvs.exe))),cvs) -#CVS := evs +HG ?= hg +GIT ?= git +BZR ?= bzr +SVN ?= svn +#BZR ?= $(or $(patsubst %,"%",$(subst /,$(DIRSEP),$(wildcard c:/Program?Files/Bazaar/bzr.exe))),bzr) +CVS ?= $(or $(patsubst %,"%",$(subst /,$(DIRSEP),$(wildcard c:/Program?Files/CVS?Suite/cvs.exe))),cvs) +#CVS ?= evs CVSFLAGS := $(shell cvs --lf --version 2>$(NULL) >$(NULL)&&echo --lf) CVSUP_FLAGS := -CPd @@ -126,7 +126,11 @@ define GIT_TMPL @echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ $(RD) $(subst /,$(DIRSEP),$1) $$(pre_init_cmd-$1) - $(GIT) clone $2 $1 + $(GIT) clone --verbose $(if $(GITCLONE_FLAGS-$1),$(GITCLONE_FLAGS-$1)$(sp))$2 $1 + ifneq (,$(filter -n --no-checkout,$(GITCLONE_FLAGS-$1))) + $$(post_clone_cmd-$1) + cd $(subst /,$(DIRSEP),$1) && $(GIT) checkout + endif $$(post_init_cmd-$1) pull-$1: @@ -134,7 +138,7 @@ define GIT_TMPL @echo +++ Updating[git]: $$(patsubst pull-%,%,$$@) $(SHQ)($2$(SHQ)) @echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ $$(pre_up_cmd-$1) - @cd $(subst /,$(DIRSEP),$1) >$(NULL) 2>&1 && $(GIT) pull $(GITPULL_FLAGS) + $(GIT) --work-tree $1 pull $(GITPULL_FLAGS) $$(post_up_cmd-$1) endif