1 # sunny256/utils.git/Makefile
2 # File ID: 455af534-fd45-11dd-a4b7-000475e441b9
3 # Author: Øyvind A. Holm <sunny@sunbase.org>
5 T_GREEN
=$$(tput setaf
2)
16 rm -f synced.sqlite.
*.bck
*.pyc
17 cd tests
&& $(MAKE
) clean
18 cd Lib
&& $(MAKE
) clean
19 cd src
&& $(MAKE
) clean
20 cd Git
&& $(MAKE
) clean
21 find .
-name .testadd.tmp
-type d
-print0 | xargs
-0r
rm -rf
26 cd src
&& $(MAKE
) fullclean
27 cd Git
&& $(MAKE
) fullclean
31 git lg
--date-order
$$(git branch
-a | cut
-c3- | \
32 grep
-Ee
'remotes/(Spread|bitbucket|repoorcz|sunbase)/' | \
33 grep
-v
'HEAD -> ') $$(git branch | cut
-c3-
)
37 git delrembr
$$(cat Div
/obsolete-refs.txt
); true
41 $(MAKE
) push-to-gitlab
44 .PHONY
: push-to-gitlab
46 git branch | grep
'tmp-gitlab' && exit
1 || true
48 for rev in
$$(git sht
--reverse gitlab
/master..master
); do \
51 git log
-1 --format
="$(T_GREEN)%h$(T_RESET) %s" $$rev \
52 && echo git branch tmp-gitlab
$$rev \
53 && git branch tmp-gitlab
$$rev \
54 && echo git branch synced
/tmp-gitlab
$$rev \
55 && git branch synced
/tmp-gitlab
$$rev \
56 && echo git push gitlab \
57 tmp-gitlab
:master synced
/tmp-gitlab
:synced
/master \
59 tmp-gitlab
:master synced
/tmp-gitlab
:synced
/master \
60 && echo git branch
-D tmp-gitlab synced
/tmp-gitlab \
61 && git branch
-D tmp-gitlab synced
/tmp-gitlab \
62 && if git sht gitlab
/master..master | grep
-q ^
; then \
63 printf
'%s sleep 60...' $$(date
+%H
:%M
:%S
); \
75 sunbase sunny@git.sunbase.org
:/home
/sunny
/Git
/utils.git
; true
77 bellmann sunny@bellmann
:/home
/sunny
/repos
/Git
/utils.git
; true
78 git remote add bitbucket git@bitbucket.org
:sunny256
/utils.git
; true
79 git remote add gitlab git@gitlab.com
:sunny256
/utils.git
; true
81 repoorcz ssh
://sunny256@repo.or.cz
/srv
/git
/sunny256-utils.git
; true
85 test ! -e synced.sql.lock
86 # FIXME: synced.sql is modified in Gitlab CI, disable it for now
87 if
test "$(GITLAB_CI)" != "true"; then \
88 test -z
"$$(filesynced --valid-sha 2>&1)"; \
90 test "$$(git log | grep -- -by: | sort -u | wc -l)" = "2"
91 cd tests
&& $(MAKE
) test
92 cd Lib
&& $(MAKE
) test
93 cd src
&& $(MAKE
) test
94 cd Git
&& $(MAKE
) test
99 git status
--porcelain
--ignored | grep ^
&& exit
1 || true
103 cd tests
&& $(MAKE
) testport
104 cd Lib
&& $(MAKE
) testport
105 cd src
&& $(MAKE
) testport
106 cd Git
&& $(MAKE
) testport
110 git log
--graph
--date-order
--format
=fuller
-p
--decorate
=short \
111 $$(git br
-a
--contains firstrev
--no-merged | git nocom
) \
114 .PHONY
: update-synced
116 test ! -e .update-synced_token.tmp
117 test ! -e synced.sql.lock
118 filesynced
--lock
>.update-synced_token.tmp
119 git ls-files | while read f
; do \
120 if
test -f
"$$f" -a
! -h
"$$f" ; then \
121 echo
"INSERT INTO synced (file) VALUES ('$$f');"; \
123 done | sqlite3 synced.sqlite
2>/dev
/null || true
124 echo
"SELECT file FROM synced ORDER BY file;" | \
125 sqlite3 synced.sqlite | while read f
; do \
126 if
test ! -f
"$$f"; then \
127 echo
"DELETE FROM synced WHERE file = '$$f';"; \
128 echo
"DELETE FROM todo WHERE file = '$$f';"; \
130 done | sqlite3 synced.sqlite
131 filesynced
--unlock
$$(cat .update-synced_token.tmp
)
132 rm -f .update-synced_token.tmp
136 cd Git
&& $(MAKE
) valgrind