@@ -5,7 +5,7 @@ Development generally follows the following ideas:
5
5
* New features are merged into to the ` development ` branch using
6
6
Pull Requests (PRs).
7
7
8
- Regression testing is used to ensure that no answers
8
+ Nightly regression testing is used to ensure that no answers
9
9
change (or if they do, that the changes were expected).
10
10
11
11
* Bug fixes, questions and contributions of new features are welcome!
@@ -18,7 +18,7 @@ Development generally follows the following ideas:
18
18
details on how this process works.
19
19
20
20
In general we squash commits upon merge to have a clean history.
21
- * Please ensure that your PR title and first post are descriptive,
21
+ * Please ensure that your PR title and description are descriptive,
22
22
since these will be used for a squashed commit message.*
23
23
24
24
Please note the following:
@@ -29,6 +29,11 @@ Development generally follows the following ideas:
29
29
distribute, and sublicense such enhancements or derivative works
30
30
thereof, in binary and source code form.
31
31
32
+ * On the first workday of each month, we make a tagged release. The merge window into
33
+ ` development ` is closed a few days before the release day. While the merge window is closed,
34
+ only bug fixes should be merged into ` development ` . Once the release is done, the merge window
35
+ reopens.
36
+
32
37
## Git workflow
33
38
34
39
ERF uses [ git] ( https://git-scm.com ) for version control. If you
@@ -46,61 +51,60 @@ your fork.
46
51
` development ` on the main ERF repository.
47
52
48
53
First, let us setup your local git repo. To make your own fork of the main
49
- ( ` upstream ` ) repository, press the fork button on the [ ERF Github page] ( https://github.com/erf-model/ERF ) .
54
+ repository, press the fork button on the [ ERF Github page] ( https://github.com/erf-model/ERF ) .
50
55
51
- Then, clone your fork on your local computer. If you plan on doing a lot of ERF development,
56
+ Then, clone ERF on your local computer. If you plan on doing a lot of ERF development,
52
57
we recommend configuring your clone to use ssh access so you won't have to enter your Github
53
58
password every time, which you can do using these commands:
54
59
55
60
```
56
- git clone --branch development [email protected] :<myGithubUsername>/ERF.git
57
-
58
- # Then, navigate into your repo, add a new remote for the main ERF repo, and fetch it:
61
+ git clone [email protected] :erf-model/ERF.git
59
62
cd ERF
60
- git remote add upstream https://github.com/erf-model/ERF
61
- git remote set-url --push upstream [email protected] :<myGithubUsername>/ERF.git
62
- git fetch upstream
63
63
64
- # We recommend setting your development branch to track the upstream one instead of your fork:
65
- git branch -u upstream/development
64
+ # Add your own fork.
65
+ # Here <Jane> is the name you give to your fork. It does not need to be your github name.
66
+ # <myGithubUsername> is your GitHub name.
67
+ git remote add <Jane> [email protected] :<myGithubUsername>/ERF.git
68
+ git fetch <Jane>
69
+
70
+ # Don't push to the main repo. Instead pushes go to your fork.
71
+ git remote set-url --push origin [email protected] :<myGithubUsername>/ERF.git
66
72
```
67
73
68
- For instructions on setting up SSH access to your Github account on a new machine, see [ here.] ( https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh )
74
+ For instructions on setting up SSH access to your Github account on a new
75
+ machine, see
76
+ [ here.] ( https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh )
69
77
70
78
If you instead prefer to use HTTPS authentication, configure your local clone as follows:
71
79
72
80
```
73
- git clone --branch development https://github.com/<myGithubUsername>/ERF.git
74
-
75
- # Navigate into your repo, add a new remote for the main ERF repo, and fetch it
81
+ git clone https://github.com/erf-model/ERF.git
76
82
cd ERF
77
- git remote add upstream https://github.com/erf-model/ERF
78
- git remote set-url --push upstream https://github.com/<myGithubUsername>/ERF.git
79
- git fetch upstream
80
83
81
- # We recommend setting your development branch to track the upstream one instead of your fork:
82
- git branch -u upstream/development
84
+ # Add your own fork.
85
+ # Here <Jane> is the name you give to your fork. It does not need to be your github name.
86
+ # <myGithubUsername> is your GitHub name.
87
+ git remote add <Jane> https://github.com/<myGithubUsername>/ERF.git
88
+ git fetch <Jane>
89
+
90
+ # Don't push to the main repo. Instead pushes go to your fork.
91
+ git remote set-url --push origin https://github.com/<myGithubUsername>/ERF.git
83
92
```
84
93
85
94
Now you are free to play with your fork (for additional information, you can visit the
86
95
[ Github fork help page] ( https://help.github.com/en/articles/fork-a-repo ) ).
87
96
88
97
> Note: you do not have to re-do the setup above every time.
89
- > Instead, in the future, you need to update the ` development ` branch
90
- > on your fork with
91
- > ```
92
- > git checkout development
93
- > git pull
94
- > ```
95
98
96
99
Make sure you are on the ` development ` branch with
97
100
```
98
101
git checkout development
102
+ git pull
99
103
```
100
104
in the ERF directory.
101
105
102
106
Create a branch ` <branch_name> ` (the branch name should reflect the piece
103
- of code you want to add, like `add_new_physics `) with
107
+ of code you want to add, like ` high_order_interpolation ` ) with
104
108
```
105
109
git checkout -b <branch_name>
106
110
```
@@ -122,14 +126,15 @@ follow the developments and identify bugs.
122
126
For the moment, commits are on your local repo only. You can push them to
123
127
your fork with
124
128
```
125
- git push -u origin <branch_name>
129
+ git push -u <Jane> <branch_name>
126
130
```
127
131
128
132
If you want to synchronize your branch with the ` development ` branch (this is useful
129
133
when ` development ` is being modified while you are working on
130
134
` <branch_name> ` ), you can use
131
135
```
132
- git pull upstream development
136
+ # merge ERF main repo's development into current branch
137
+ git pull origin development
133
138
```
134
139
and fix any conflicts that may occur.
135
140
@@ -174,7 +179,7 @@ git branch -D <branch_name>
174
179
175
180
and you can delete the remote one on your fork with
176
181
```
177
- git push origin --delete <branch_name>
182
+ git push <Jane> --delete <branch_name>
178
183
```
179
184
180
185
Generally speaking, you want to follow the following rules.
@@ -185,50 +190,19 @@ Generally speaking, you want to follow the following rules.
185
190
186
191
* Do not commit in your ` development ` branch that tracks ERF ` development ` branch.
187
192
188
- * Always create a new branch based off `development` branch for each pull request, unless you are
189
- going to use git to fix it later.
193
+ * Always create a new branch based off the latest ` development ` branch for
194
+ each pull request, unless you are going to use git to fix it later.
190
195
191
196
If you have accidentally committed in ` development ` branch, you can fix it as follows,
192
197
```
193
- git checkout -b new_branch
198
+ git checkout -b new_branch # save your changes in a branch
194
199
git checkout development
195
- git reset HEAD ~ 2 # Here 2 is the number of commits you have accidentally committed in development
196
- git checkout .
200
+ git fetch origin
201
+ git reset --hard origin/development
197
202
```
198
203
After this, the local ` development ` should be in sync with ERF ` development ` and your recent
199
204
commits have been saved in ` new_branch ` branch.
200
205
201
- If for some reason your PR branch has diverged from ERF, you can try to fix it as follows. Before
202
- you try it, you should back up your code in case things might go wrong.
203
- ```
204
- git fetch upstream # assuming upstream is the remote name for the official ERF repo
205
- git checkout -b xxx upstream/development # replace xxx with whatever name you like
206
- git branch -D development
207
- git checkout -b development upstream/development
208
- git checkout xxx
209
- git merge yyy # here yyy is your PR branch with unclean history
210
- git rebase -i upstream/development
211
- ```
212
- You will see something like below in your editor,
213
- ```
214
- pick 7451d9d commit message a
215
- pick c4c2459 commit message b
216
- pick 6fj3g90 commit message c
217
- ```
218
- This now requires a bit of knowledge on what those commits are, which commits have been merged,
219
- which commits are actually new. However, you should only see your only commits. So it should be
220
- easy to figure out which commits have already been merged. Assuming the first two commits have been
221
- merged, you can drop them by replace `pick` with `drop`,
222
- ```
223
- drop 7451d9d commit message a
224
- drop c4c2459 commit message b
225
- pick 6fj3g90 commit message c
226
- ```
227
- After saving and then exiting the editor, `git log` should show a clean history based on top of
228
- `development` branch. You can also do `git diff yyy..xxx` to make sure nothing new was dropped. If
229
- all goes well, you can submit a PR using `xxx` branch.
230
- Don't worry, if something goes wrong during the rebase, you an always `git rebase --abort` and start over.
231
-
232
206
## ERF Coding Style Guide
233
207
234
208
### Code Guidelines
@@ -255,9 +229,8 @@ ERF developers should adhere to the following coding guidelines:
255
229
for (int n=0 ; n<10 ; ++n)
256
230
Print () << "Not like this.";
257
231
```
258
- * Add a space after the function name and before the
259
- parenthesis of the parameter list (but
260
- not when simply calling the function). For example:
232
+ * When declaring and defining a function, add a space after the function name and before the
233
+ parenthesis of the parameter list (but not when simply calling the function). For example:
261
234
``` cpp
262
235
void CorrectFunctionDec (int input)
263
236
```
@@ -272,56 +245,3 @@ not when simply calling the function). For example:
272
245
```
273
246
These guidelines should be adhered to in new contributions to ERF, but
274
247
please refrain from making stylistic changes to unrelated sections of code in your PRs.
275
-
276
- ### Fixing Style Issues
277
-
278
- On any pull request, or any new commits to an open pull request that trigger
279
- the ERF CI tests, ERF will run style checks. These checks ensure the developer
280
- is using spaces instead of tabs and has not inserted any whitespace at the end
281
- of source lines.
282
-
283
- We require pull requests to pass these style checks before merging. If failures
284
- arise, there is an easy way to automatically fix style issues like this by
285
- running the following shell commands from the main ERF repository.
286
-
287
- For removing whitespace at the end of lines:
288
-
289
- ```
290
- $ .github/workflows/style/check_trailing_whitespaces.sh
291
- ```
292
-
293
- For replacing tabs with 4 spaces:
294
-
295
- ```
296
- $ .github/workflows/style/check_tabs.sh
297
- ```
298
-
299
- These commands will modify your local source files, so it is best to run these
300
- commands after committing your local changes and then add and commit the style
301
- changes that result.
302
-
303
- These commands will also output a git diff that shows the changes made by the
304
- style scripts.
305
-
306
- ### API Documentation Using Doxygen
307
-
308
- The Doxygen documentation is designed for advanced user-developers. It aims
309
- to maximize the efficiency of a search-and-find style of locating information.
310
- Doxygen style comment blocks should proceed the namespace, class, function, etc.
311
- to be documented where appropriate. For example:
312
- ``` cpp
313
- /* *
314
- * \brief A one line description.
315
- *
316
- * \param[in] variable A short description of the variable.
317
- * \param[inout] data The value of data is read and changed.
318
- *
319
- * A longer description can be included here.
320
- */
321
-
322
- void MyFunction (int variable, MultiFab& data){
323
- ...
324
- ```
325
- Additional information regarding Doxygen comment formatting can be found
326
- in the [Doxygen Manual](https://www.doxygen.nl/manual/).
327
-
0 commit comments