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
39 .PHONY
: push-to-gitlab
41 git branch | grep
'tmp-gitlab' && exit
1 || true
43 for rev in
$$(git sht
--reverse gitlab
/master..master
); do \
46 git log
-1 --format
="$(T_GREEN)%h$(T_RESET) %s" $$rev \
47 && echo git branch tmp-gitlab
$$rev \
48 && git branch tmp-gitlab
$$rev \
49 && echo git branch synced
/tmp-gitlab
$$rev \
50 && git branch synced
/tmp-gitlab
$$rev \
51 && echo git push gitlab \
52 tmp-gitlab
:master synced
/tmp-gitlab
:synced
/master \
54 tmp-gitlab
:master synced
/tmp-gitlab
:synced
/master \
55 && echo git branch
-D tmp-gitlab synced
/tmp-gitlab \
56 && git branch
-D tmp-gitlab synced
/tmp-gitlab \
57 && if git sht gitlab
/master..master | grep
-q ^
; then \
58 printf
'%s sleep 60...' $$(date
+%H
:%M
:%S
); \
70 sunbase sunny@git.sunbase.org
:/home
/sunny
/Git
/utils.git
; true
72 bellmann sunny@bellmann
:/home
/sunny
/repos
/Git
/utils.git
; true
73 git remote add bitbucket git@bitbucket.org
:sunny256
/utils.git
; true
74 git remote add gitlab git@gitlab.com
:sunny256
/utils.git
; true
76 repoorcz ssh
://sunny256@repo.or.cz
/srv
/git
/sunny256-utils.git
; true
80 test ! -e synced.sql.lock
81 # FIXME: synced.sql is modified in Gitlab CI, disable it for now
82 if
test "$(GITLAB_CI)" != "true"; then \
83 test -z
"$$(filesynced --valid-sha 2>&1)"; \
85 test "$$(git log | grep -- -by: | sort -u | wc -l)" = "2"
86 cd tests
&& $(MAKE
) test
87 cd Lib
&& $(MAKE
) test
88 cd src
&& $(MAKE
) test
89 cd Git
&& $(MAKE
) test
94 git status
--porcelain
--ignored | grep ^
&& exit
1 || true
98 cd tests
&& $(MAKE
) testport
99 cd Lib
&& $(MAKE
) testport
100 cd src
&& $(MAKE
) testport
101 cd Git
&& $(MAKE
) testport
105 git log
--graph
--date-order
--format
=fuller
-p
--decorate
=short \
106 $$(git br
-a
--contains firstrev
--no-merged | git nocom
) \
109 .PHONY
: update-synced
111 test ! -e .update-synced_token.tmp
112 test ! -e synced.sql.lock
113 filesynced
--lock
>.update-synced_token.tmp
114 git ls-files | while read f
; do \
115 if
test -f
"$$f" -a
! -h
"$$f" ; then \
116 echo
"INSERT INTO synced (file) VALUES ('$$f');"; \
118 done | sqlite3 synced.sqlite
2>/dev
/null || true
119 echo
"SELECT file FROM synced ORDER BY file;" | \
120 sqlite3 synced.sqlite | while read f
; do \
121 if
test ! -f
"$$f"; then \
122 echo
"DELETE FROM synced WHERE file = '$$f';"; \
123 echo
"DELETE FROM todo WHERE file = '$$f';"; \
125 done | sqlite3 synced.sqlite
126 filesynced
--unlock
$$(cat .update-synced_token.tmp
)
127 rm -f .update-synced_token.tmp
131 cd Git
&& $(MAKE
) valgrind