Neels Hofmeyr | 45f3cec | 2017-08-13 03:25:38 +0200 | [diff] [blame] | 1 | This dir is intended to keep all the git clones. |
| 2 | |
| 3 | There are some handy scripts I use for my daily Osmocom development: |
| 4 | |
Neels Hofmeyr | f6402d8 | 2017-09-04 04:32:21 +0200 | [diff] [blame] | 5 | 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 Hofmeyr | b459b6c | 2018-10-31 21:35:36 +0100 | [diff] [blame] | 14 | 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 Hofmeyr | 45f3cec | 2017-08-13 03:25:38 +0200 | [diff] [blame] | 19 | |
| 20 | Examples: |
| 21 | |
Neels Hofmeyr | f6402d8 | 2017-09-04 04:32:21 +0200 | [diff] [blame] | 22 | |
| 23 | ----------------------------------------------------------------------------- |
| 24 | |
| 25 | git 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/ |
| 31 | commit-msg 100% 4688 4.6KB/s 00:00 |
| 32 | |
| 33 | |
| 34 | ----------------------------------------------------------------------------- |
| 35 | |
| 36 | |
| 37 | cd osmo-msc |
| 38 | ../fetch-gerrit-patch.sh 3787 |
| 39 | + git fetch origin refs/changes/87/3787/2 |
| 40 | From ssh://go/osmo-msc |
| 41 | * branch refs/changes/87/3787/2 -> FETCH_HEAD |
| 42 | + git checkout -b 3787_2 FETCH_HEAD |
| 43 | Switched to a new branch '3787_2' |
| 44 | |
| 45 | |
| 46 | # or if you want an earlier patch set |
| 47 | ../fetch-gerrit-patch.sh 3787/1 |
| 48 | From ssh://go/osmo-msc |
| 49 | * branch refs/changes/87/3787/1 -> FETCH_HEAD |
| 50 | + git checkout -b 3787_1 FETCH_HEAD |
| 51 | Switched to a new branch '3787_1' |
| 52 | |
| 53 | |
Neels Hofmeyr | 45f3cec | 2017-08-13 03:25:38 +0200 | [diff] [blame] | 54 | ----------------------------------------------------------------------------- |
| 55 | |
Neels Hofmeyr | b459b6c | 2018-10-31 21:35:36 +0100 | [diff] [blame] | 56 | ./gits fetch # run 'git fetch' in each clone = fetch all from upstream |
Neels Hofmeyr | 45f3cec | 2017-08-13 03:25:38 +0200 | [diff] [blame] | 57 | |
| 58 | ===== libasn1c ===== |
| 59 | remote: Counting objects: 29, done |
| 60 | remote: Finding sources: 100% (26/26) |
| 61 | remote: Total 26 (delta 8), reused 22 (delta 8) |
| 62 | Unpacking objects: 100% (26/26), done. |
| 63 | From ssh://go/libasn1c |
| 64 | 4151e59..aaae8c7 master -> origin/master |
| 65 | |
| 66 | ===== libosmo-abis ===== |
| 67 | |
| 68 | ===== libosmo-netif ===== |
| 69 | remote: Counting objects: 105, done |
| 70 | remote: Finding sources: 100% (92/92) |
| 71 | remote: Total 92 (delta 54), reused 92 (delta 54) |
| 72 | Unpacking objects: 100% (92/92), done. |
| 73 | From 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 ===== |
| 81 | remote: Counting objects: 36, done |
| 82 | remote: Finding sources: 100% (24/24) |
| 83 | remote: Total 24 (delta 18), reused 24 (delta 18) |
| 84 | Unpacking objects: 100% (24/24), done. |
| 85 | From ssh://go/libosmocore |
| 86 | 4a29f34..733810c master -> origin/master |
| 87 | |
| 88 | [...] |
| 89 | |
| 90 | ----------------------------------------------------------------------------- |
| 91 | |
Neels Hofmeyr | b459b6c | 2018-10-31 21:35:36 +0100 | [diff] [blame] | 92 | ./gits st # any modifications / updates? (e.g. useful after './g fetch') |
Neels Hofmeyr | 45f3cec | 2017-08-13 03:25:38 +0200 | [diff] [blame] | 93 | # (checks only 'master' and the current checked-out branch) |
| 94 | |
| 95 | libasn1c master |
| 96 | libosmo-abis master |
| 97 | libosmo-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 Hofmeyr | b459b6c | 2018-10-31 21:35:36 +0100 | [diff] [blame] | 118 | ./gits sh rm .version # in each source tree, remove the local .version file |
Neels Hofmeyr | 45f3cec | 2017-08-13 03:25:38 +0200 | [diff] [blame] | 119 | |
| 120 | ----------------------------------------------------------------------------- |
| 121 | |
Neels Hofmeyr | b459b6c | 2018-10-31 21:35:36 +0100 | [diff] [blame] | 122 | ./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 Hofmeyr | 45f3cec | 2017-08-13 03:25:38 +0200 | [diff] [blame] | 125 | |
| 126 | |
| 127 | libosmocore |
| 128 | master |
| 129 | Your branch is behind 'origin/master' by 2 commits, and can be fast-forwarded. |
| 130 | Behind. git merge? (empty = no, 'ok' = yes) |
| 131 | ok # <-- type 'ok' and hit enter |
| 132 | git merge |
| 133 | Updating ff932bb..4a29f34 |
| 134 | Fast-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 | |
| 142 | libosmo-netif |
| 143 | master |
| 144 | Your branch is up-to-date with 'origin/master'. |
| 145 | |
| 146 | |
| 147 | libosmo-sccp |
| 148 | master |
| 149 | Your branch and 'origin/master' have diverged, |
| 150 | Diverged. 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 | |
| 154 | Local mods |
| 155 | modified: src/osmo_ss7_vty.c |
| 156 | |
| 157 | commit to new branch? (enter name, empty = no) |
| 158 | |
| 159 | commit to this branch master ? (empty = no, 'ok' = yes) |
| 160 | |
| 161 | [...] |
| 162 | |
| 163 | ----------------------------------------------------------------------------- |
| 164 | |
| 165 | |
| 166 | Enjoy, |
| 167 | |
| 168 | ~Neels |
| 169 | <nhofmeyr@sysmocom.de> |