summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2008-08-15 21:53:30 +0200
committerJonas Smedegaard <dr@jones.dk>2008-08-15 21:53:30 +0200
commit180b41916d0dec8119d3c2286ad84df5aa039140 (patch)
tree29205533d480e4a5c4937c242dea8e90a9539a20
parentd33f1d8ec9b00abf0d34d1bfc12839f85f05d64a (diff)
parent9b1f2fb0d98e591fe3731f660841c8cc8f0bec81 (diff)
Merge branch '_scs' into scs
-rw-r--r--make/git.mk19
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