-
Open an Issue:
-
Clone the repository:
$ git clone git@github.com:ACCESS-NRI/spack-packages.git
$ cd spack-packages
- If you have an old clone of the repository, make sure the main branch is up-to-date:
$ git checkout main
Already on 'main'
Your branch is behind 'origin/main' by 1 commit, and can be fast-forwarded.
(use "git pull" to update your local branch)
$ git pull
Updating 81a820e..7b6a3c3
Fast-forward
packages/mom5/package.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
- Create a new branch for the changes:
$ git branch 145-access-om2-use-maintainer-function
$ git checkout 145-access-om2-use-maintainer-function
Switched to branch '145-access-om2-use-maintainer-function'
Or, in a single command:
$ git checkout -b 145-access-om2-use-maintainer-function
- Modify the relevant files and check what has been changed:
$ git diff
diff --git a/packages/access-om2/package.py b/packages/access-om2/package.py
index 9627413..6eb1ad0 100644
--- a/packages/access-om2/package.py
+++ b/packages/access-om2/package.py
@@ -14,7 +14,7 @@ class AccessOm2(BundlePackage):
git = "https://github.com/ACCESS-NRI/ACCESS-OM2.git"
- maintainers = ["harshula"]
+ maintainers("harshula")
version("latest")
- Commit the changes to the local repository:
$ git commit -m "access-om2: use the maintainer function" access-om2/package.py
[145-access-om2-use-maintainer-function 2093a57] access-om2: use the maintainer function
1 file changed, 1 insertion(+), 1 deletion(-)
- Push the new commit(s) to the remote remote repository:
$ git push
fatal: The current branch 145-access-om2-use-maintainer-function has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin 145-access-om2-use-maintainer-function
To have this happen automatically for branches without a tracking
upstream, see 'push.autoSetupRemote' in 'git help config'.
$ git push --set-upstream origin 145-access-om2-use-maintainer-function
Enumerating objects: 9, done.
Counting objects: 100% (9/9), done.
Delta compression using up to 16 threads
Compressing objects: 100% (4/4), done.
Writing objects: 100% (5/5), 1.08 KiB | 1.08 MiB/s, done.
Total 5 (delta 3), reused 0 (delta 0), pack-reused 0 (from 0)
remote: Resolving deltas: 100% (3/3), completed with 3 local objects.
remote:
remote: Create a pull request for '145-access-om2-use-maintainer-function' on GitHub by visiting:
remote: https://github.com/ACCESS-NRI/spack-packages/pull/new/145-access-om2-use-maintainer-function
remote:
To github.com:ACCESS-NRI/spack-packages.git
* [new branch] 145-access-om2-use-maintainer-function -> 145-access-om2-use-maintainer-function
branch '145-access-om2-use-maintainer-function' set up to track 'origin/145-access-om2-use-maintainer-function'.
-
Open the Pull Request on Github:
Please read, About pull request merges. It explains the options available and the implications. In this example,Squash and merge
was chosen because there is one commit to merge and it is helpful to have thePull Request
number in the commit message:
-
Check that the Issue is closed:
-
After merging, some admin is recommended:
$ git checkout main
Switched to branch 'main'
Your branch is up to date with 'origin/main'.
$ git fetch --all -Pp
From github.com:ACCESS-NRI/spack-packages
- [deleted] (none) -> origin/145-access-om2-use-maintainer-function
remote: Enumerating objects: 1, done.
remote: Counting objects: 100% (1/1), done.
remote: Total 1 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0)
Unpacking objects: 100% (1/1), 867 bytes | 867.00 KiB/s, done.
7b6a3c3..03cbd36 main -> origin/main
$ git pull
Updating 7b6a3c3..03cbd36
Fast-forward
packages/access-om2/package.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
- Check that the merged commit is in the local repository’s main branch:
$ git show
commit 03cbd361481d33b010d48de024efd8d26bb35b9c (HEAD -> main, origin/main, origin/HEAD)
Author: Harshula Jayasuriya <harshula.jayasuriya@anu.edu.au>
Date: Fri Aug 30 11:07:05 2024 +1000
access-om2: use the maintainer function (#146)
diff --git a/packages/access-om2/package.py b/packages/access-om2/package.py
index 9627413..6eb1ad0 100644
--- a/packages/access-om2/package.py
+++ b/packages/access-om2/package.py
@@ -14,7 +14,7 @@ class AccessOm2(BundlePackage):
git = "https://github.com/ACCESS-NRI/ACCESS-OM2.git"
- maintainers = ["harshula"]
+ maintainers("harshula")
version("latest")
- The feature branch can be deleted since it is identical to
main
:
$ git diff 145-access-om2-use-maintainer-function
$ git branch -D 145-access-om2-use-maintainer-function
Deleted branch 145-access-om2-use-maintainer-function (was 2093a57).
- IMPORTANT: Ensure other local branches are rebased with the latest
main
:
$ git checkout development
Switched to branch 'development'
Your branch is up to date with 'origin/development'.
$ git rebase main
Successfully rebased and updated refs/heads/development.