blob: a2fbe8125bdc9522fc3333e4a5f76e8da59b46eb [file] [log] [blame]
Neels Hofmeyr45f3cec2017-08-13 03:25:38 +02001This dir is intended to keep all the git clones.
2
3There are some handy scripts I use for my daily Osmocom development:
4
Neels Hofmeyrf6402d82017-09-04 04:32:21 +02005 osmo-add-gerrit-hooks.sh
6 Look for git repositories in and below the current dir and install the
7 gerrit commit-msg hook in each one. This requires an ~/.ssh/config
8 entry, see top comment in the script.
9
10 fetch-gerrit-patch.sh
11 Pass a patch number seen on gerrit to fetch the latest patch set into
12 your git clone. See top comment in the script.
13
Neels Hofmeyr45f3cec2017-08-13 03:25:38 +020014 ./g run a git command in each source tree
15 ./e run an arbitrary shell command in each source tree
16 ./st show a brief branch and local mods status for each source tree
17 ./s walk through each source tree and use gitk as well as user interaction
18 to quickly fast-forward / reset changes coming in from upstream. (This
19 is potentially dangerous, but safe if you only hit enter every time.)
20
21Examples:
22
Neels Hofmeyrf6402d82017-09-04 04:32:21 +020023
24-----------------------------------------------------------------------------
25
26git clone ssh://go/osmo-msc
27
28./osmo-add-gerrit-hooks.sh
29+ cd /n/s/osmo/src/./osmo-msc/.git
30+ [ ! -f hooks/commit-msg ]
31+ scp go:hooks/commit-msg hooks/
32commit-msg 100% 4688 4.6KB/s 00:00
33
34
35-----------------------------------------------------------------------------
36
37
38cd osmo-msc
39../fetch-gerrit-patch.sh 3787
40+ git fetch origin refs/changes/87/3787/2
41From ssh://go/osmo-msc
42 * branch refs/changes/87/3787/2 -> FETCH_HEAD
43+ git checkout -b 3787_2 FETCH_HEAD
44Switched to a new branch '3787_2'
45
46
47# or if you want an earlier patch set
48../fetch-gerrit-patch.sh 3787/1
49From ssh://go/osmo-msc
50 * branch refs/changes/87/3787/1 -> FETCH_HEAD
51+ git checkout -b 3787_1 FETCH_HEAD
52Switched to a new branch '3787_1'
53
54
Neels Hofmeyr45f3cec2017-08-13 03:25:38 +020055-----------------------------------------------------------------------------
56
57./g fetch # run 'git fetch' in each clone = fetch all from upstream
58
59===== libasn1c =====
60remote: Counting objects: 29, done
61remote: Finding sources: 100% (26/26)
62remote: Total 26 (delta 8), reused 22 (delta 8)
63Unpacking objects: 100% (26/26), done.
64From ssh://go/libasn1c
65 4151e59..aaae8c7 master -> origin/master
66
67===== libosmo-abis =====
68
69===== libosmo-netif =====
70remote: Counting objects: 105, done
71remote: Finding sources: 100% (92/92)
72remote: Total 92 (delta 54), reused 92 (delta 54)
73Unpacking objects: 100% (92/92), done.
74From ssh://go/libosmo-netif
75 6032a35..e786055 master -> origin/master
76 + 058d3b7...89180ef pespin/jitterbuffer -> origin/pespin/jitterbuffer (forced update)
77 * [new branch] pespin/osmux-lostpkt -> origin/pespin/osmux-lostpkt
78
79===== libosmo-sccp =====
80
81===== libosmocore =====
82remote: Counting objects: 36, done
83remote: Finding sources: 100% (24/24)
84remote: Total 24 (delta 18), reused 24 (delta 18)
85Unpacking objects: 100% (24/24), done.
86From ssh://go/libosmocore
87 4a29f34..733810c master -> origin/master
88
89[...]
90
91-----------------------------------------------------------------------------
92
93./st # any modifications / updates? (e.g. useful after './g fetch')
94 # (checks only 'master' and the current checked-out branch)
95
96 libasn1c master
97 libosmo-abis master
98libosmo-netif master
99 libosmo-sccp MODS master[+1|-10]
100 libosmocore master
101 libsmpp34 master
102 openggsn master
103 osmo-bsc pre_release[+43|-43]
104 osmo-hlr master
105 osmo-iuh pre_release[+1]
106 osmo-mgw pre_release
107 osmo-msc pre_release
108 osmo-sgsn pre_release
109
110# This shows me that I have local mods in libosmo-sccp, while my local master
111# branch has one commit that isn't on upstream ("+1"); but at the same time
112# origin/master has moved on by 10 commits ("-10").
113# My osmo-bsc git is on branch 'pre_release', and apparently I have amended the
114# 44th commit before pre_release's HEAD.
115# And on osmo-iuh, I have one un-pushed local commit.
116
117-----------------------------------------------------------------------------
118
119./e rm .version # in each source tree, remove the local .version file
120
121-----------------------------------------------------------------------------
122
123./s # interactively try to fast-forward to upstream and/or save
124 # local modifications.
125 # If you just hit Enter all the time, nothing will be changed.
126
127
128libosmocore
129master
130Your branch is behind 'origin/master' by 2 commits, and can be fast-forwarded.
131Behind. git merge? (empty = no, 'ok' = yes)
132ok # <-- type 'ok' and hit enter
133git merge
134Updating ff932bb..4a29f34
135Fast-forward
136 include/osmocom/gprs/gprs_rlc.h | 25 +++++++++++++++++++
137 include/osmocom/gsm/tlv.h | 21 +++++++++++++++-
138 src/gsm/gprs_rlc.c | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
139 src/gsm/libosmogsm.map | 6 +++++
140 4 files changed, 141 insertions(+), 1 deletion(-)
141
142
143libosmo-netif
144master
145Your branch is up-to-date with 'origin/master'.
146
147
148libosmo-sccp
149master
150Your branch and 'origin/master' have diverged,
151Diverged. git reset --hard origin/master ? (empty = no, 'ok' = yes)
152# a 'gitk' opens; just hit 'enter' to keep local diverged commits.
153# If you type 'ok', local mods are saved to a wip branch first.
154
155Local mods
156 modified: src/osmo_ss7_vty.c
157
158commit to new branch? (enter name, empty = no)
159
160commit to this branch master ? (empty = no, 'ok' = yes)
161
162[...]
163
164-----------------------------------------------------------------------------
165
166
167Enjoy,
168
169~Neels
170<nhofmeyr@sysmocom.de>