Project

General

Profile

Dev » History » Version 6

Jules Waldhart, 2015-09-10 18:57

1 1 Jules Waldhart
h1. Instructions for developers
2
3 3 Jules Waldhart
4
 
5
> See for [[CodingRules|Coding Rules]], here is for setting up your workspace.
6
7
8
9 1 Jules Waldhart
The new main repo for move3d is here now (at least for us). Project admins are in charge of keeping it up to date with the official move3d repos (on trac.laas.fr). We will work with a pull request system, and try to involve everyone in the reviews, to ensure the best possible quality for each part and aspect of move3d.
10
11
So, where to start? You will have to setup your workspace to use these repos instead of the trac.laas.fr ones, and use the workflow required for this project management system.
12
13
h2. Workspace set-up
14
15 6 Jules Waldhart
h3. Change or add remote
16 1 Jules Waldhart
17 6 Jules Waldhart
h4. Change @origin@ url
18
19 1 Jules Waldhart
Short version: in git, a remote is a server.
20
You will change trac.laas.fr to this repo on your local copy using git commands. So, cd to your move3d(planner/hri/studio) local copy and do the following:
21
<pre>
22
git remote set-url origin ssh://git@redmine.laas.fr/laas/users/jwaldart/move3d/[planners, hri, libmove3d, studio].git
23
</pre>
24
25
26
@origin@ is the default name usually given to remotes, esp. when using @git clone@. Yours is maybe different, use @git remote show@ to check the list of remotes and @git remote show <name>@ to see details.
27 6 Jules Waldhart
28
h4. Add a remote
29 1 Jules Waldhart
30
You may want to add a remote instead of changing origin, use the @git remote add@ command instead:
31
<pre>
32
git remote add redmine ssh://git@redmine.laas.fr/laas/users/jwaldart/move3d/...
33
</pre>
34
35
h3. Add remote for pushing
36
37
You first need to create your own remote repo, where you will push your changes, and from which project maintainers will pull when you requet it. You then add it to the remotes:
38
<pre>
39
git remote add perso <url>
40
</pre>
41
42
You will push to it using @git push perso <branch>@ where @<branch>@ is the branch you want to push *to* (usually master).
43
44
You will pull form the main repo: @git pull origin <branch>@
45
46
47
*TODO*: how to set default pull/push destinations.
48 2 Jules Waldhart
49
h2. Workflow
50
51
h3. Pull-request
52
53
Once you modifications are done and you are ready to publish your work, first do some checks, be sure it successfully builds, and push it to your personal repository.
54
Then go to the redmine page of the main project and click the "new issue" tab ("Nouvelle demande" (fr)). Create a new pull-request and fill the form. Do not forget to specify the url of your personal repo (either hosted by redmine or on any machine at LAAS for instance) and the branch you want the maintainer to pull from.
55
56
Specify the assignee, and add any person you think can be interested by your work.
57
58
h3. Review
59 4 Jules Waldhart
60 5 Jules Waldhart
*this is a proposal*
61
62
h4. if you have uncommitted work, stash it first:
63
64
<pre>
65
git stash
66
</pre>
67
(don't forget to unstash it at the end with @git stash pop@)
68
69
h4. Create a new branch to put the work of the developer for the review:
70
71
<pre>
72
git checkout -b review <redmine-remote>/<main-branch>
73
</pre>
74
(_e.g._ @git checkout -b review origin/master@ or @git checkout -b review redmine/master@ according to your configuration)
75
76
You are now in the branch @review@:
77
<pre>
78
$ git branch
79
  master
80
* review
81
</pre>
82
The state is the one from the repo, in the branch you indicated. (use @git log@ to confirm that) Your latter modifications aren't present.
83
84
85
h4. Pull the work of the developer into this branch:
86
87
<pre>
88
git pull <url> <branch>
89
</pre>
90
91
@<url>@ and @<branch>@ are the one indicated by the developer, they point to its own repository and the branch he wants you to pull _from_
92
93
h4. Review
94
95
You have the state to be reviewed. Read, compile, test, give your opinion clicking on "edit" in the pull request. In the text field that appears you can put your comments. You change the status to "feedback" for instance to indicate that you have reviewed the code.
96
97
h4. Accepting the pull-request
98
99
If enough positive advices are collected in the pull-request, it can be pulled into the main repository (here). To do so, push the branch @review@  into the desired branch on the redmine remote:
100
101
<pre>
102
git push <remdine-remote>/<branch>
103
</pre>
104
_e.g._ @git push origin/master@
105
106
h4. Go back to your own work
107
108
<pre>
109
git checkout master
110
[ git stash pop ] #only if you stashed something before changing to the branch @review@
111
</pre>
112
Will put you back into the state you were before the starting the review.
113
114
<pre>
115
git branch -d review
116
</pre>
117
Will delete the branch @review@. git should refuse, invoking an excuse like "the branch review is not merged in master". Here you have the choice to
118
force the deletion by asking louder: @git branch -D review@ or to actually do what git suggest, _i.e._ merging the branch into master:
119
<pre>
120
git merge review
121
</pre>
122
123
This will pull the work you reviewed in your master branch.
124
As would @git pull origin master@ if the pull-request has been accepted and pushed into the main remote.
125 4 Jules Waldhart
126
127
128
---