Commit 2c9b91955928305741ff46a83ea53c66488117fb

Authored by Jürgen Knödlseder
1 parent e5882f93

Adapt Git workflow section to ctools

doc/source/develop/git/git-workflow.png

141 KB | W: | H:

282 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
doc/source/develop/git/gitlab-fork-step1.jpg deleted

56.3 KB

doc/source/develop/git/gitlab-fork-step2.jpg deleted

38.7 KB

doc/source/develop/git/gitlab-fork-step3.jpg deleted

57.2 KB

doc/source/develop/git/gitlab-push.jpg deleted

199 KB

doc/source/develop/git/index.rst
... ... @@ -84,29 +84,14 @@ account on
84 84 `Redmine <https://cta-redmine.irap.omp.eu/projects/ctools>`_ then go
85 85 ahead and create one).
86 86 Select the `ctools <https://cta-gitlab.irap.omp.eu/ctools/ctools>`_
87   -project and click on ``Fork`` (see below).
88   -
89   -.. image:: gitlab-fork-step1.jpg
90   - :width: 600px
91   - :alt: Forking the ctools repository
92   - :align: center
  87 +project and click on ``Fork``.
93 88  
94 89 This brings you to a screen that invites you to fork the project into
95 90 your user space.
96   -Click on your user (see below).
97   -
98   -.. image:: gitlab-fork-step2.jpg
99   - :width: 600px
100   - :alt: Select user
101   - :align: center
  91 +Click on your user.
102 92  
103 93 After a short while a fork will be created that now is under your
104   -ownership (see below).
105   -
106   -.. image:: gitlab-fork-step3.jpg
107   - :width: 600px
108   - :alt: Forked created successfully
109   - :align: center
  94 +ownership.
110 95  
111 96 Now you can clone this fork using
112 97  
... ... @@ -146,43 +131,37 @@ You do this by typing
146 131  
147 132 $ git checkout devel
148 133 $ git pull upstream devel
149   - $ git checkout -b 9101-skymap-smooth-method
  134 + $ git checkout -b 5783-correct-event-selection
150 135  
151 136 which makes sure that you are on your ``devel`` branch, then pulls in changes
152 137 from the ctools repository, and finally creates the
153   -``9101-skymap-smooth-method`` branch.
  138 +``5783-correct-event-selection`` branch.
154 139 New branches should always start with an issue number, followed by
155 140 a meaningful name that indicates what the branch is good for (use hyphens
156 141 to separate words).
157 142 You can find the relevant issue number using the
158 143 `Redmine issue tracker <https://cta-redmine.irap.omp.eu/projects/ctools/issues>`_.
159 144  
160   -Suppose that your goal is to add a ``smooth()`` method to the ``GSkyMap``
161   -class.
162   -You would then add this method to ``GSkyMap`` by editing the
163   -``GSkyMap.hpp``, ``GSkyMap.cpp`` and ``GSkyMap.i`` files.
164   -You should also add unit tests for the new method, and you would do
165   -this by editing the ``test_GSky.hpp`` and ``test_GSky.cpp`` files.
166   -Once you have verified that the new method works you should commit
167   -your changes.
  145 +Suppose that your goal is to correct a bug in the event selection in
  146 +``ctselect``.
  147 +You would then probably modify the ``ctselect.cpp`` file that is found in the
  148 +``src/ctselect`` repository.
  149 +Once you have verified that the bug is correct you should commit your changes.
168 150  
169   -First stage all files you want to commit.
170   -To commit for example only the new class method you should type
  151 +First stage the files you want to commit:
171 152  
172 153 .. code-block:: sh
173 154  
174   - $ git add src/sky/GSkyMap.hpp
175   - $ git add src/sky/GSkyMap.cpp
176   - $ git add src/sky/GSkyMap.i
  155 + $ git add src/ctselect/ctselect.cpp
177 156  
178   -followed by
  157 +and then commit your change:
179 158  
180 159 .. code-block:: sh
181 160  
182   - $ git commit -m "Add GSkyMap::smooth() method (#9101)
  161 + $ git commit -m "Corrected event selection in ctselect (#5783)
183 162 >
184   - > The GSkyMap::smooth() allows the smoothing of sky maps using
185   - > various kernels."
  163 + > The event selection in ctselect was not done correctly in case
  164 + > that no time intervals are specified. This is fixed now."
186 165  
187 166 where the message in quotes should be comprised of a single line subject
188 167 that describes what was changed, and a message body that describes why
... ... @@ -190,8 +169,6 @@ the change was made. Subject line and message body should be separated
190 169 by a blank line (see `How to Write a Git Commit Message
191 170 <http://chris.beams.io/posts/git-commit/>`_).
192 171  
193   -You should then also stage and commit the remaining files.
194   -
195 172 To make the changes available to other users, and specifically to allow
196 173 their merging into the ctools repository, you need to push you local
197 174 changes into your
... ... @@ -201,20 +178,11 @@ You do this by typing
201 178  
202 179 .. code-block:: sh
203 180  
204   - $ git push origin 9101-skymap-smooth-method
  181 + $ git push origin 5783-correct-event-selection
205 182  
206 183 Note that the ``origin`` argument specifies that you want to push your
207 184 changes into the same repository from which you cloned the code.
208 185  
209   -You can now verify on
210   -`GitLab's <https://cta-gitlab.irap.omp.eu/ctools/ctools>`_
211   -that a new branch exists in your project:
212   -
213   -.. image:: gitlab-push.jpg
214   - :width: 600px
215   - :alt: Pushing a new branch
216   - :align: center
217   -
218 186  
219 187 Creating a pull request
220 188 -----------------------
... ...