summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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
omebase.dk/sys?h=master'>tags/6e/46/20170603100209.4F1491C0F1@jawa.homebase.dk/sys0
-rw-r--r--tags/6e/46/20170603100209.4F1491C0F1@jawa.homebase.dk/unread0
-rw-r--r--tags/6e/46/20180819080254.B8B032BDC@jawa.homebase.dk/hb0
-rw-r--r--tags/6e/46/20180819080254.B8B032BDC@jawa.homebase.dk/sys0
-rw-r--r--tags/6e/46/20180819080254.B8B032BDC@jawa.homebase.dk/unread0
-rw-r--r--tags/6e/46/20180827051218.E79F6300034@coreander.jones.dk/sys0
-rw-r--r--tags/6e/46/20180827051218.E79F6300034@coreander.jones.dk/unread0
-rw-r--r--tags/6e/46/20220719044329.23418278@xayide.jones.dk/jones0
-rw-r--r--tags/6e/46/20220719044329.23418278@xayide.jones.dk/sys0
-rw-r--r--tags/6e/46/20220719044329.23418278@xayide.jones.dk/unread0
-rw-r--r--tags/6e/46/CABwkT9okUQqY8rXnNR5jWHTHXaiHMYrm9PGs86ypFh931VPrcg@mail.gmail.com/debian0
-rw-r--r--tags/6e/46/CABwkT9okUQqY8rXnNR5jWHTHXaiHMYrm9PGs86ypFh931VPrcg@mail.gmail.com/unread0
-rw-r--r--tags/6e/46/E1kVtrr-000AWD-HO@fasolo.debian.org/debian0
-rw-r--r--tags/6e/46/E1kVtrr-000AWD-HO@fasolo.debian.org/inbox0
-rw-r--r--tags/6e/46/E1kVtrr-000AWD-HO@fasolo.debian.org/killed0
-rw-r--r--tags/6e/46/E1kVtrr-000AWD-HO@fasolo.debian.org/unread0
-rw-r--r--tags/6e/46/E1nHTKA-0001ts-2z@usper.debian.org/debian0
-rw-r--r--tags/6e/46/E1nHTKA-0001ts-2z@usper.debian.org/inbox0
-rw-r--r--tags/6e/46/E1nHTKA-0001ts-2z@usper.debian.org/killed0
-rw-r--r--tags/6e/46/E1nHTKA-0001ts-2z@usper.debian.org/unread0
29 files changed, 0 insertions, 0 deletions