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