1721ebf05SAngelo Mantellini
2f28308bdSLuca Muscariello# Introduction
3f28308bdSLuca MuscarielloThe git repository structure is described in this file. It can also be derived
4f28308bdSLuca Muscarielloby scanning the repo itself. The master branch is read only and contains this
5f28308bdSLuca MuscarielloREADME.md file only.
6f28308bdSLuca Muscariello
7f28308bdSLuca MuscarielloThe repository is organized in several orphaned branches, each one containing
8f28308bdSLuca Muscarielloa sub-project. The naming convention naming branches is described in this
9f28308bdSLuca Muscariellodocument.
10f28308bdSLuca Muscariello
11f28308bdSLuca Muscariello## Branch naming conventions
12f28308bdSLuca MuscarielloProject cicn contains several sub-projects. Sub-project *subp* has a master
13f28308bdSLuca Muscariellobranch with name  origin/subp/master. All commits associated to sub-project
14f28308bdSLuca Muscariellosubp will belong to the orphaned branch origin/subp. All branches associated
15f28308bdSLuca Muscarielloto subp must be named as subp/branch-name.
16f28308bdSLuca Muscariello
17f28308bdSLuca Muscariello## Sub projects contained in the cicn git repository
18f28308bdSLuca Muscariello
19f28308bdSLuca Muscariello1. cicn-plugin
20f28308bdSLuca Muscariello2. sb-forwarder
21f28308bdSLuca Muscariello3. libicnet
22f28308bdSLuca Muscariello4. cframework
23f28308bdSLuca Muscariello5. ccnxlib
24f28308bdSLuca Muscariello6. http-server
25f28308bdSLuca Muscariello7. viper
26f28308bdSLuca Muscariello8. vicn
27f28308bdSLuca Muscariello9. android-sdk
28f28308bdSLuca Muscariello
29f28308bdSLuca Muscariello## Sub projects description
30f28308bdSLuca Muscariello
31f28308bdSLuca MuscarielloName                | Description             |  Language and style
32f28308bdSLuca Muscariello------------------- | ----------------------- | -------------------
33f28308bdSLuca Muscariello1. cicn-plugin      | VPP forwarder           | C GNU style
34f28308bdSLuca Muscariello2. sb-forwarder     | socket-based forwarder  | C GNU style
35f28308bdSLuca Muscariello3. libicnet         | socket API              | C++11 Google style
36f28308bdSLuca Muscariello4. cframework       | C framework             | C GNU style
37f28308bdSLuca Muscariello5. ccnxlibs         | CCNx libraries          | C GNU style
38f28308bdSLuca Muscariello6. http-server      | HTTP server             | C++11 Google style
39f28308bdSLuca Muscariello7. viper            | Qt/QML video player     | C++/QML Qt style
40f28308bdSLuca Muscariello8. vicn             | vICN framework          | python-3 and bash
41f28308bdSLuca Muscariello9. android-sdk      | Android SDK for ICN     | cmake
42f28308bdSLuca Muscariello
43f28308bdSLuca Muscariello## Example:
44f28308bdSLuca Muscariello
45f28308bdSLuca MuscarielloFor sub-project cicn-plugin, the master branch is cicn-plugin/master
46f28308bdSLuca Muscariellothat can be cloned as follows:
47f28308bdSLuca Muscariello
48342d82abSLuca Muscariello$ git clone -b cicn-plugin/master https://gerrit.fd.io/r/cicn cicn-plugin
49342d82abSLuca Muscariello
50342d82abSLuca Muscariello## How to manage different master branches
51342d82abSLuca Muscariello
52342d82abSLuca MuscarielloIt is suggested to clone each subproject branch in a different workspace to 
53342d82abSLuca Muscarielloavoid error prone operations. The cicn git repo stores several projects which
54342d82abSLuca Muscarielloare independent one to another. While access control and isolation is
55342d82abSLuca Muscarielloguaranteed at a certain level by gerrit, using one single workspace is
56342d82abSLuca Muscariellodiscouraged.
57342d82abSLuca Muscariello
58342d82abSLuca Muscariellogit clone -b cicn-plugin/master  https://gerrit.fd.io/r/cicn cicn-plugin;
59342d82abSLuca Muscariellogit clone -b sb-forwarder/master https://gerrit.fd.io/r/cicn sb-forwarder;
60342d82abSLuca Muscariellogit clone -b libicnet/master     https://gerrit.fd.io/r/cicn libicnet;
61342d82abSLuca Muscariellogit clone -b cframework/master   https://gerrit.fd.io/r/cicn cframework;
62342d82abSLuca Muscariellogit clone -b ccnxlibs/master     https://gerrit.fd.io/r/cicn ccnxlibs;
63342d82abSLuca Muscariellogit clone -b http-server/master  https://gerrit.fd.io/r/cicn http-server;
64342d82abSLuca Muscariellogit clone -b viper/master        https://gerrit.fd.io/r/cicn viper;
65342d82abSLuca Muscariellogit clone -b vicn/master         https://gerrit.fd.io/r/cicn vicn;
66342d82abSLuca Muscariellogit clone -b android-sdk         https://gerrit.fd.io/r/cicn android-sdk;
67fc6a10d4SLuca Muscariello
68fc6a10d4SLuca Muscariello### For committers
69fc6a10d4SLuca Muscariello
70fc6a10d4SLuca MuscarielloBy having multiple sub-projects in the same repo, it is highly recommended
71fc6a10d4SLuca Muscarielloto use the following approach while using branches and pushing patch sets.
72fc6a10d4SLuca Muscariello
73fc6a10d4SLuca Muscariello$ subp = cicm-plugin
74fc6a10d4SLuca Muscariello$ committer = user
75fc6a10d4SLuca Muscariello
76fc6a10d4SLuca Muscariello$ git clone -b cicn-plugin/master ssh://committer@gerrit.fd.io:29418/cicn subp;
77fc6a10d4SLuca Muscariello$ scp -p -P 29418 committer@gerrit.fd.io:hooks/commit-msg subp/.git/hooks/;
78fc6a10d4SLuca Muscariello
79fc6a10d4SLuca MuscarielloIf you use an email alias like user+fdio@email.com that is registered in the
80fc6a10d4SLuca Muscariellogerrit frontend it is recommended to set the following kind of configuration
81fc6a10d4SLuca Muscariello
82fc6a10d4SLuca Muscariello$ git config --local user.email "$committer+fdio@email.com"
83fc6a10d4SLuca Muscariello$ git config --local alias.push-for-review "push origin HEAD:refs/for/$subp/master"
84fc6a10d4SLuca Muscariello
85fc6a10d4SLuca Muscariellothis allows to avoid pushing for review to different sub-project branches
86fc6a10d4SLuca Muscariellousing the command
87fc6a10d4SLuca Muscariello
88fc6a10d4SLuca Muscariello$ git push-for-review