diff options
author | Jonas Smedegaard <dr@jones.dk> | 2008-08-15 21:53:29 +0200 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2008-08-15 21:53:29 +0200 |
commit | d968524c1f95f3b9e7982478a24786f3e96d0db5 (patch) | |
tree | 5bfc49bb5b3f889c3f761ba1570d4a765e62c307 | |
parent | accbb4cb78b50f3d26fbbca5beb664ac5d41bceb (diff) | |
parent | f680214fd0302dfe1328b69ab356d3665a18975d (diff) |
Merge branch 'master' into allinone-nb
-rw-r--r-- | make/git.mk | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/make/git.mk b/make/git.mk index 072617e..5595057 100644 --- a/make/git.mk +++ b/make/git.mk @@ -7,14 +7,23 @@ branches = $(master) # local name of origin origin = origin -currentbranch = $(shell git branch | grep ^\* | awk '{ print $2 }') -noncurrentbranches = $(filter-out $(currentbranch),$(branches)) +currentbranch := $(shell git branch | grep ^\* | awk '{ print $2 }') +noncurrentbranches := $(filter-out $(currentbranch),$(branches)) + +#originbranches := $(shell git branch -r | perl -ne 'm,^.\s+'"$$origin"'/([a-z_]\S+)$, && print "$$1\n"' ) +localbranches := $(shell git branch | perl -ne 'm,^.\s+([a-z_]\S+)$$, && print "$$1\n"' ) update: git fetch $(origin) - $(if $(filter $(currentbranch),$(master)),,git branch -f "$(master)" "$(origin)/$(master)" && git checkout "$(master)") - git pull "$(origin)" - $(if $(noncurrentbranches),$(foreach branch,$(noncurrentbranches),git branch -f "$(branch)" "$(origin)/$(branch)" && git checkout "$(branch)" && git pull "$(origin)" &&) git checkout "$(master)") + for branch in $(filter-out $(localbranches),$(branches)); do \ + git branch $$branch $(origin)/$(branch); \ + done + git checkout $(master) + git pull $(origin) + for branch in $(noncurrentbranches); do \ + git checkout $(branch); \ + git pull $(origin); \ + done init: git init |