osmo-dev/src
Vadim Yanitskiy 2fef4e56e4 osmo-add-gerrit-hooks.sh: do not use ssh host alias 'go'
... because it may not be defined.  Specify the address explicitly.

Change-Id: I55c1501de61fe6b63be12b8e138742bd4b8baf64
2022-04-19 20:30:23 +03:00
..
README replace src/* git scripts with a single src/gits 2018-11-08 11:37:19 +01:00
fetch-gerrit-patch.sh add fetch-gerrit-patch.sh, tweak READMEs 2017-09-04 04:45:00 +02:00
gits gits fu 2020-09-25 05:17:55 +02:00
osmo-add-gerrit-hooks.sh osmo-add-gerrit-hooks.sh: do not use ssh host alias 'go' 2022-04-19 20:30:23 +03:00

README

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.

 fetch-gerrit-patch.sh
	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
../fetch-gerrit-patch.sh 3787
+ git fetch origin refs/changes/87/3787/2
From ssh://go/osmo-msc
 * branch            refs/changes/87/3787/2 -> FETCH_HEAD
+ git checkout -b 3787_2 FETCH_HEAD
Switched to a new branch '3787_2'


# or if you want an earlier patch set
../fetch-gerrit-patch.sh 3787/1
From ssh://go/osmo-msc
 * branch            refs/changes/87/3787/1 -> FETCH_HEAD
+ git checkout -b 3787_1 FETCH_HEAD
Switched to a new branch '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-sccp =====

===== 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-sccp 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-sccp, 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-sccp
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>