Skip to content

Commit f0adc08

Browse files
committed
differences for PR #8
1 parent 6701878 commit f0adc08

4 files changed

Lines changed: 155 additions & 157 deletions

File tree

41-code-review.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,27 @@ This tells the author you are happy for them to merge the pull request.
567567
![](fig/github-merge-pull-request.png){alt='Merging a pull request in GitHub' .image-with-shadow width="800px"}
568568
2. Delete the merged branch to reduce the clutter in the repository.
569569

570+
::: callout
571+
572+
### Merge via command line
573+
574+
The `git merge` command provides a way to directly merge branches on your local. In general, when adding changes to the `main` branch, this is not a good practice since it bypasses the code review process. It is a common practice for an open-source project to set its `main` branch protected, meaning pushing directly to `main` branch will fail. Therefore, even you can merge to `main` locally, you will not be able to push the changes to the remote repository.
575+
576+
On the other hand, the `git merge` command can be very useful for keeping your feature branch up to date with the `main` branch. For example, if you are working on a branch `my-feature` and the `main` branch has received new commits (e.g. someone else has merged their pull request), you can do the following to include changes from `main` into your feature branch:
577+
578+
```bash
579+
# First update your local main branch
580+
$ git checkout main
581+
$ git pull main
582+
# Then switch back to your feature branch and merge the latest main into it
583+
$ git checkout my-feature
584+
$ git merge main
585+
```
586+
587+
In this way, you can keep your feature branch up to date. You may need to resolve conflicts that arise during this process.
588+
589+
:::
590+
570591
## Writing Easy-To-Review Code
571592

572593
There are a few things you can do to make it

42-software-reuse.md

Lines changed: 0 additions & 154 deletions
Original file line numberDiff line numberDiff line change
@@ -344,160 +344,6 @@ Ensure you prioritise and work on the most pressing issues first!
344344

345345
::::::::::::::::::::::::::::::::::::::::::::::::::
346346

347-
## Merging into `main`
348-
349-
Once you have done these updates,
350-
commit your changes,
351-
and if you are doing this work on a feature branch also ensure you merge it into `develop`,
352-
e.g.:
353-
354-
```bash
355-
$ git switch develop
356-
$ git merge my-feature-branch
357-
```
358-
359-
Finally, once we have fully tested our software
360-
and are confident it works as expected on `develop`,
361-
we can merge our `develop` branch into `main`:
362-
363-
```bash
364-
$ git switch main
365-
$ git merge develop
366-
$ git push origin main
367-
```
368-
369-
The software on your `main` branch is now ready for release.
370-
371-
## Tagging a Release in GitHub
372-
373-
There are many ways in which Git and GitHub can help us make a software release from our code.
374-
One of these is via **tagging**,
375-
where we attach a human-readable label to a specific commit.
376-
Let us see what tags we currently have in our repository:
377-
378-
```bash
379-
$ git tag
380-
```
381-
382-
Since we have not tagged any commits yet, there is unsurprisingly no output.
383-
We can create a new tag on the last commit in our `main` branch by doing:
384-
385-
```bash
386-
$ git tag -a v1.0.0 -m "Version 1.0.0"
387-
```
388-
389-
So we can now do:
390-
391-
```bash
392-
$ git tag
393-
```
394-
395-
```output
396-
v.1.0.0
397-
```
398-
399-
And also, for more information:
400-
401-
```bash
402-
$ git show v1.0.0
403-
```
404-
405-
You should see something like this:
406-
407-
```output
408-
tag v1.0.0
409-
Tagger: <Name> <email>
410-
Date: Fri Dec 10 10:22:36 2021 +0000
411-
412-
Version 1.0.0
413-
414-
commit 2df4bfcbfc1429c12f92cecba751fb2d7c1a4e28 (HEAD -> main, tag: v1.0.0, origin/main, origin/develop, origin/HEAD, develop)
415-
Author: <Name> <email>
416-
Date: Fri Dec 10 10:21:24 2021 +0000
417-
418-
Finalising README.
419-
420-
diff --git a/README.md b/README.md
421-
index 4818abb..5b8e7fd 100644
422-
--- a/README.md
423-
+++ b/README.md
424-
@@ -22,4 +22,33 @@ Flimflam requires the following Python packages:
425-
The following optional packages are required to run Flimflam's unit tests:
426-
427-
- [pytest](https://docs.pytest.org/en/stable/) - Flimflam's unit tests are written using pytest
428-
-- [pytest-cov](https://pypi.org/project/pytest-cov/) - Adds test coverage stats to unit testing
429-
\ No newline at end of file
430-
+- [pytest-cov](https://pypi.org/project/pytest-cov/) - Adds test coverage stats to unit testing
431-
+
432-
+## Installation
433-
+- Clone the repo ``git clone repo``
434-
+- Check everything runs by running ``python -m pytest`` in the root directory
435-
+- Hurray
436-
+
437-
+## Contributing
438-
+- Create an issue [here](https://github.com/Onoddil/python-intermediate-inflammation/issues)
439-
+ - What works, what does not? You tell me
440-
+- Randomly edit some code and see if it improves things, then submit a [pull request](https://github.com/Onoddil/python-intermediate-inflammation/pulls)
441-
+- Just yell at me while I edit the code, pair programmer style!
442-
+
443-
+## Getting Help
444-
+- Nice try
445-
+
446-
+## Credits
447-
+- Directed by Michael Bay
448-
+
449-
+## Citation
450-
+Please cite [J. F. W. Herschel, 1829, MmRAS, 3, 177](https://ui.adsabs.harvard.edu/abs/1829MmRAS...3..177H/abstract) if you used this work in your day-to-day life.
451-
+Please cite [C. Herschel, 1787, RSPT, 77, 1](https://ui.adsabs.harvard.edu/abs/1787RSPT...77....1H/abstract) if you actually use this for scientific work.
452-
+
453-
+## License
454-
+This source code is protected under international copyright law. All rights
455-
+reserved and protected by the copyright holders.
456-
+This file is confidential and only available to authorized individuals with the
457-
+permission of the copyright holders. If you encounter this file and do not have
458-
+permission, please contact the copyright holders and delete this file.
459-
\ No newline at end of file
460-
```
461-
462-
So now we have added a tag, we need this reflected in our Github repository.
463-
You can push this tag to your remote by doing:
464-
465-
```bash
466-
$ git push origin v1.0.0
467-
```
468-
469-
::::::::::::::::::::::::::::::::::::::::: callout
470-
471-
## What is a Version Number Anyway?
472-
473-
Software version numbers are everywhere,
474-
and there are many different ways to do it.
475-
A popular one to consider is [**Semantic Versioning**](https://semver.org/),
476-
where a given version number uses the format MAJOR.MINOR.PATCH.
477-
You increment the:
478-
479-
- MAJOR version when you make incompatible API changes
480-
- MINOR version when you add functionality in a backwards compatible manner
481-
- PATCH version when you make backwards compatible bug fixes
482-
483-
You can also add a hyphen followed by characters to denote a pre-release version,
484-
e.g. 1.0.0-alpha1 (first alpha release) or 1.2.3-beta4 (fourth beta release)
485-
486-
487-
::::::::::::::::::::::::::::::::::::::::::::::::::
488-
489-
We can now use the more memorable tag to refer to this specific commit.
490-
Plus, once we have pushed this back up to GitHub,
491-
it appears as a specific release within our code repository
492-
which can be downloaded in compressed `.zip` or `.tar.gz` formats.
493-
Note that these downloads just contain the state of the repository at that commit,
494-
and not its entire history.
495-
496-
Using features like tagging allows us to highlight commits that are particularly important,
497-
which is very useful for *reproducibility* purposes.
498-
We can (and should) refer to specific commits for software in
499-
academic papers that make use of results from software,
500-
but tagging with a specific version number makes that just a little bit easier for humans.
501347

502348
## Conforming to Data Policy and Regulation
503349

43-software-release.md

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,137 @@ exercises: 20
1919

2020
::::::::::::::::::::::::::::::::::::::::::::::::::
2121

22+
## Tagging a Release in GitHub
23+
24+
There are many ways in which Git and GitHub can help us make a software release from our code.
25+
One of these is via **tagging**,
26+
where we attach a human-readable label to a specific commit.
27+
Let us see what tags we currently have in our repository:
28+
29+
```bash
30+
$ git tag
31+
```
32+
33+
Since we have not tagged any commits yet, there is unsurprisingly no output.
34+
We can create a new tag on the last commit in our `main` branch by doing:
35+
36+
```bash
37+
$ git tag -a v1.0.0 -m "Version 1.0.0"
38+
```
39+
40+
So we can now do:
41+
42+
```bash
43+
$ git tag
44+
```
45+
46+
```output
47+
v.1.0.0
48+
```
49+
50+
And also, for more information:
51+
52+
```bash
53+
$ git show v1.0.0
54+
```
55+
56+
You should see something like this:
57+
58+
```output
59+
tag v1.0.0
60+
Tagger: <Name> <email>
61+
Date: Fri Dec 10 10:22:36 2021 +0000
62+
63+
Version 1.0.0
64+
65+
commit 2df4bfcbfc1429c12f92cecba751fb2d7c1a4e28 (HEAD -> main, tag: v1.0.0, origin/main, origin/develop, origin/HEAD, develop)
66+
Author: <Name> <email>
67+
Date: Fri Dec 10 10:21:24 2021 +0000
68+
69+
Finalising README.
70+
71+
diff --git a/README.md b/README.md
72+
index 4818abb..5b8e7fd 100644
73+
--- a/README.md
74+
+++ b/README.md
75+
@@ -22,4 +22,33 @@ Flimflam requires the following Python packages:
76+
The following optional packages are required to run Flimflam's unit tests:
77+
78+
- [pytest](https://docs.pytest.org/en/stable/) - Flimflam's unit tests are written using pytest
79+
-- [pytest-cov](https://pypi.org/project/pytest-cov/) - Adds test coverage stats to unit testing
80+
\ No newline at end of file
81+
+- [pytest-cov](https://pypi.org/project/pytest-cov/) - Adds test coverage stats to unit testing
82+
+
83+
+## Installation
84+
+- Clone the repo ``git clone repo``
85+
+- Check everything runs by running ``python -m pytest`` in the root directory
86+
+- Hurray
87+
+
88+
+## Contributing
89+
+- Create an issue [here](https://github.com/Onoddil/python-intermediate-inflammation/issues)
90+
+ - What works, what does not? You tell me
91+
+- Randomly edit some code and see if it improves things, then submit a [pull request](https://github.com/Onoddil/python-intermediate-inflammation/pulls)
92+
+- Just yell at me while I edit the code, pair programmer style!
93+
+
94+
+## Getting Help
95+
+- Nice try
96+
+
97+
+## Credits
98+
+- Directed by Michael Bay
99+
+
100+
+## Citation
101+
+Please cite [J. F. W. Herschel, 1829, MmRAS, 3, 177](https://ui.adsabs.harvard.edu/abs/1829MmRAS...3..177H/abstract) if you used this work in your day-to-day life.
102+
+Please cite [C. Herschel, 1787, RSPT, 77, 1](https://ui.adsabs.harvard.edu/abs/1787RSPT...77....1H/abstract) if you actually use this for scientific work.
103+
+
104+
+## License
105+
+This source code is protected under international copyright law. All rights
106+
+reserved and protected by the copyright holders.
107+
+This file is confidential and only available to authorized individuals with the
108+
+permission of the copyright holders. If you encounter this file and do not have
109+
+permission, please contact the copyright holders and delete this file.
110+
\ No newline at end of file
111+
```
112+
113+
So now we have added a tag, we need this reflected in our Github repository.
114+
You can push this tag to your remote by doing:
115+
116+
```bash
117+
$ git push origin v1.0.0
118+
```
119+
120+
::::::::::::::::::::::::::::::::::::::::: callout
121+
122+
## What is a Version Number Anyway?
123+
124+
Software version numbers are everywhere,
125+
and there are many different ways to do it.
126+
A popular one to consider is [**Semantic Versioning**](https://semver.org/),
127+
where a given version number uses the format MAJOR.MINOR.PATCH.
128+
You increment the:
129+
130+
- MAJOR version when you make incompatible API changes
131+
- MINOR version when you add functionality in a backwards compatible manner
132+
- PATCH version when you make backwards compatible bug fixes
133+
134+
You can also add a hyphen followed by characters to denote a pre-release version,
135+
e.g. 1.0.0-alpha1 (first alpha release) or 1.2.3-beta4 (fourth beta release)
136+
137+
138+
::::::::::::::::::::::::::::::::::::::::::::::::::
139+
140+
We can now use the more memorable tag to refer to this specific commit.
141+
Plus, once we have pushed this back up to GitHub,
142+
it appears as a specific release within our code repository
143+
which can be downloaded in compressed `.zip` or `.tar.gz` formats.
144+
Note that these downloads just contain the state of the repository at that commit,
145+
and not its entire history.
146+
147+
Using features like tagging allows us to highlight commits that are particularly important,
148+
which is very useful for *reproducibility* purposes.
149+
We can (and should) refer to specific commits for software in
150+
academic papers that make use of results from software,
151+
but tagging with a specific version number makes that just a little bit easier for humans.
152+
22153
## Why Package our Software?
23154

24155
We have now got our software ready to release -

md5sum.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
"episodes/34-code-refactoring.md" "ecfc3e80e4e9a453a0a10069d0d4e894" "site/built/34-code-refactoring.md" "2025-06-19"
3131
"episodes/35-software-architecture-revisited.md" "8f92fb912d61d3aded15f51020699a14" "site/built/35-software-architecture-revisited.md" "2025-06-19"
3232
"episodes/40-section4-intro.md" "d8aa3c327409db1b14826b7619287c45" "site/built/40-section4-intro.md" "2025-06-19"
33-
"episodes/41-code-review.md" "e86600e42548b6d652fb9b43450222fc" "site/built/41-code-review.md" "2025-06-25"
34-
"episodes/42-software-reuse.md" "d97b8a23401a52bfb6dc5e564981fcf2" "site/built/42-software-reuse.md" "2025-06-19"
35-
"episodes/43-software-release.md" "25bfda77cec4fea12479541c71317dc1" "site/built/43-software-release.md" "2025-10-24"
33+
"episodes/41-code-review.md" "7d2da980b93fb9e5f21a090174528e7a" "site/built/41-code-review.md" "2025-11-12"
34+
"episodes/42-software-reuse.md" "9465c27f2e2d41abae70b52764034edf" "site/built/42-software-reuse.md" "2025-11-12"
35+
"episodes/43-software-release.md" "52e6254f19a85faadd235bde7844e47b" "site/built/43-software-release.md" "2025-11-12"
3636
"episodes/50-section5-intro.md" "85de74adcd13ba9e8a6df600a17b9ddc" "site/built/50-section5-intro.md" "2025-06-19"
3737
"episodes/51-managing-software.md" "666be3cf81dab6bb120f649c65bd64c1" "site/built/51-managing-software.md" "2025-06-19"
3838
"episodes/52-assessing-software-suitability-improvement.md" "f13f4136753468a43d3c2364fa6aabd4" "site/built/52-assessing-software-suitability-improvement.md" "2025-10-20"

0 commit comments

Comments
 (0)