aboutsummaryrefslogtreecommitdiffstats
path: root/src/README
blob: 2504cc23b2e20b84ad9d3b7ae9764f84acf85e3a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
This dir is intended to keep all the git clones.

There are some handy scripts I use for my daily Osmocom development:

 osmo-add-gerrit-hooks.sh
	Look for git repositories in and below the current dir and install the
	gerrit commit-msg hook in each one. This requires an ~/.ssh/config
	entry, see top comment in the script.

 grd
	Pass a patch number seen on gerrit to fetch the latest patch set into
	your git clone. See top comment in the script.

 gits   Conveniently manage several git clones:
        - run a git or shell command in each source tree
	- show a brief branch and local mods status for each source tree
	- merge / rebase / fast-forward each source tree interactively
	See ./gits help

Examples:


-----------------------------------------------------------------------------

git clone ssh://go/osmo-msc

./osmo-add-gerrit-hooks.sh
+ cd /n/s/osmo/src/./osmo-msc/.git
+ [ ! -f hooks/commit-msg ]
+ scp go:hooks/commit-msg hooks/
commit-msg                                                             100% 4688     4.6KB/s   00:00    


-----------------------------------------------------------------------------


$ cd osmo-msc
$ ../grd 3787
Download https://gerrit.osmocom.org/changes/osmo-msc~3787/detail
+ git fetch https://gerrit.osmocom.org/osmo-msc refs/changes/87/3787/5
From https://gerrit.osmocom.org/osmo-msc
 * branch                refs/changes/87/3787/5 -> FETCH_HEAD
+ git checkout -B gerrit/3787_5 FETCH_HEAD
Switched to a new branch 'gerrit/3787_5'


# or if you want an earlier patch set
$ ../grd 3787 -r1
+ git fetch https://gerrit.osmocom.org/osmo-msc refs/changes/87/3787/1
From https://gerrit.osmocom.org/osmo-msc
 * branch                refs/changes/87/3787/1 -> FETCH_HEAD
+ git checkout -B gerrit/3787_1 FETCH_HEAD
Switched to a new branch 'gerrit/3787_1'

-----------------------------------------------------------------------------

./gits fetch    # run 'git fetch' in each clone = fetch all from upstream

===== libasn1c =====
remote: Counting objects: 29, done
remote: Finding sources: 100% (26/26)
remote: Total 26 (delta 8), reused 22 (delta 8)
Unpacking objects: 100% (26/26), done.
From ssh://go/libasn1c
   4151e59..aaae8c7  master     -> origin/master

===== libosmo-abis =====

===== libosmo-netif =====
remote: Counting objects: 105, done
remote: Finding sources: 100% (92/92)
remote: Total 92 (delta 54), reused 92 (delta 54)
Unpacking objects: 100% (92/92), done.
From ssh://go/libosmo-netif
   6032a35..e786055  master     -> origin/master
 + 058d3b7...89180ef pespin/jitterbuffer -> origin/pespin/jitterbuffer  (forced update)
 * [new branch]      pespin/osmux-lostpkt -> origin/pespin/osmux-lostpkt

===== libosmo-sigtran =====

===== libosmocore =====
remote: Counting objects: 36, done
remote: Finding sources: 100% (24/24)
remote: Total 24 (delta 18), reused 24 (delta 18)
Unpacking objects: 100% (24/24), done.
From ssh://go/libosmocore
   4a29f34..733810c  master     -> origin/master

[...]

-----------------------------------------------------------------------------

./gits st    # any modifications / updates? (e.g. useful after './g fetch')
             # (checks only 'master' and the current checked-out branch)

     libasn1c master
 libosmo-abis master
libosmo-netif master
 libosmo-sigtran MODS master[+1|-10]
  libosmocore master
    libsmpp34 master
     openggsn master
     osmo-bsc pre_release[+43|-43]
     osmo-hlr master
     osmo-iuh pre_release[+1]
     osmo-mgw pre_release
     osmo-msc pre_release
    osmo-sgsn pre_release

# This shows me that I have local mods in libosmo-sigtran, while my local master
# branch has one commit that isn't on upstream ("+1"); but at the same time
# origin/master has moved on by 10 commits ("-10").
# My osmo-bsc git is on branch 'pre_release', and apparently I have amended the
# 44th commit before pre_release's HEAD.
# And on osmo-iuh, I have one un-pushed local commit.

-----------------------------------------------------------------------------

./gits sh rm .version  # in each source tree, remove the local .version file

-----------------------------------------------------------------------------

./gits rebase  # interactively try to fast-forward to upstream and/or save
               # local modifications.
               # If you just hit Enter all the time, nothing dangerous will happen.


libosmocore
master
Your branch is behind 'origin/master' by 2 commits, and can be fast-forwarded.
Behind. git merge?  (empty = no, 'ok' = yes)
ok                   # <-- type 'ok' and hit enter
git merge
Updating ff932bb..4a29f34
Fast-forward
 include/osmocom/gprs/gprs_rlc.h | 25 +++++++++++++++++++
 include/osmocom/gsm/tlv.h       | 21 +++++++++++++++-
 src/gsm/gprs_rlc.c              | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 src/gsm/libosmogsm.map          |  6 +++++
 4 files changed, 141 insertions(+), 1 deletion(-)


libosmo-netif
master
Your branch is up-to-date with 'origin/master'.


libosmo-sigtran
master
Your branch and 'origin/master' have diverged,
Diverged. git reset --hard origin/master ?  (empty = no, 'ok' = yes)
# a 'gitk' opens; just hit 'enter' to keep local diverged commits.
# If you type 'ok', local mods are saved to a wip branch first.

Local mods
  modified:   src/osmo_ss7_vty.c

commit to new branch? (enter name, empty = no)

commit to this branch master ?  (empty = no, 'ok' = yes)

[...]

-----------------------------------------------------------------------------


Enjoy,

~Neels
<nhofmeyr@sysmocom.de>