From 84d7ec94513943eb534f44555e5f7c3e700b0a01 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Sat, 14 Jun 2008 13:25:45 +0200 Subject: Let git init target do init (we don't use it anyway currently). --- make/git.mk | 10 +++------- make/rules.mk | 3 +-- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/make/git.mk b/make/git.mk index 068e7f3..0059448 100644 --- a/make/git.mk +++ b/make/git.mk @@ -17,13 +17,9 @@ update: $(if $(noncurrentbranches),$(foreach branch,$(noncurrentbranches),git branch -f "$(branch)" "$(origin)/$(branch)" && git checkout "$(branch)" && git merge --no-commit "$(origin)" &&) git checkout "$(master)") init: -# Assume that initial cloning is done already when invoking this target -# git init -# git remote add -f -t "$(master)" -m "$(master)" origin "$(origin)" -# git merge origin + git init + git remote add -f -m "$(master)" origin "$(origin)" + git merge origin # git config remote.origin.push +"refs/heads/$(master)":"refs/heads/$(master)" - $(if $(filter $(currentbranch),$(master)),,git branch -f "$(master)" "$(origin)/$(master)") - $(if $(noncurrentbranches),$(foreach branch,$(noncurrentbranches),git branch -f "$(branch)" "$(origin)/$(branch)" &&) true) - $(if $(filter $(currentbranch),$(master)),,git checkout -f "$(master)") .PHONY: update init diff --git a/make/rules.mk b/make/rules.mk index 2dcfc96..973af61 100644 --- a/make/rules.mk +++ b/make/rules.mk @@ -21,14 +21,13 @@ ifneq ($(2),) $(1): $$(subst module,$(3),$$(masterdir)) endif -$(1): action = $$(if $(wildcard $(1)/.git),update,init) $(1): origin = $$(if $(2),$(3),$$(subst MODULE,$(3),$$($(4)_ORIGIN))) $(1): master = $$(subst -LOCALE,$(2:%=-$(2)),$$($(4)_BRANCH)) $(1): branches = $$(if $(2),,$$(filter-out $$(master),$$($(3)_BRANCHES))) $(1): @[ -d "$$(dir $$@)" ] || ( echo mkdir -p "$$(dir $$@)" && mkdir -p "$$(dir $$@)" ) @[ -d "$$@" ] || ( echo git clone "$$(origin)" "$$@" && git clone -o "$(4)" "$$(origin)" "$$@" ) - @$(MAKE) -f "$$(CURDIR)/make/git.mk" -C "$$@" master="$$(master)" branches="$$(branches)" origin="$(4)" "$$(action)" + @$(MAKE) -f "$$(CURDIR)/make/git.mk" -C "$$@" master="$$(master)" branches="$$(branches)" origin="$(4)" update # WARNING: this may wipe unrelated files too! ultraclean:: -- cgit v1.2.3