From c521cd8fd177ee446848eaad9bba4dde48236fac Mon Sep 17 00:00:00 2001 From: Freddie Akeroyd Date: Tue, 23 Jun 2015 13:05:07 +0100 Subject: [PATCH 1/2] Update for labels, comments and merging Added new instructions for use of labels, merging prior to final push, and comment format --- development_workflow.rst | 66 ++++++++++++++++++++++++++++++++++------ 1 file changed, 56 insertions(+), 10 deletions(-) diff --git a/development_workflow.rst b/development_workflow.rst index d94834913..b8a77667e 100644 --- a/development_workflow.rst +++ b/development_workflow.rst @@ -4,12 +4,16 @@ IBEX GUI Development Workflow Quick overview of workflow: -#. **Create a branch for the ticket via GitHub (developer)** +#. **Create a branch for the ticket (based on master) via GitHub (developer)** * Use the Trac ticket number for the branch name followed by a brief description, e.g. Ticket780_SelectNewTarget #. **Clone the branch locally (developer)** #. **Modify the code (developer)** #. **Push back the changes (developer)** +# * make sure you have merged in any changes to master that have occurred since your ticket was created - makes reviewer's life easier +# * please follow commenting guidelines below #. **Create a pull request (developer)** +# * Assign the correct sprint milestone to the ticket +# * Assign an appropriate label (ticket, bug, enhancement, ...) #. **Review (reviewer)** * Assign the pull request to yourself to indicate you are reviewing it (and, perhaps, add a comment as well) * If it is okay move to the next step, otherwise inform the developer of the problem and add a comment to the pull request @@ -18,13 +22,16 @@ Quick overview of workflow: #. **Delete the branch (reviewer or developer)** #. **Close the ticket in Trac (reviewer or developer)** +Notes: +* You don't have to create branches on GitHub first, often it is more convenient to create them locally first instead (which you meus do if you intend to rebase) +* Deleting a branch on github does not delete it from you local repository clone Getting started with GitHub (first time only) --------------------------------------------- * Register with GitHub to create an account -* Download and install `git client for Windows `_ or `GitHub for Windows `_ -* Add the RAL proxy to C:/Users/YourName/.gitconfig +* Download and install `git client for Windows `_ or `GitHub for Windows `_ or `Tortoise Git `_ +* Configure RAL proxy, either add the RAL proxy to C:/Users/YourName/.gitconfig .. code:: @@ -32,8 +39,31 @@ Getting started with GitHub (first time only) proxy = http://wwwcache.rl.ac.uk:8080 [https] - proxy = http://wwwcache.rl.ac.uk:8080 + proxy = https://wwwcache.rl.ac.uk:8080 + +or type: + +.. code:: + + git config --global http.proxy http://wwwcache.rl.ac.uk:8080 + git config --global https.proxy https://wwwcache.rl.ac.uk:8080 + +* Set you username and email address - TotroiseGit "Setting->Git" and select "global", or via command line: + +.. code:: + + git config --global user.name "YOUR NAME" + git config --global user.email "YOUR EMAIL ADDRESS" + +* Set a default commit editor (not needed for TotroiseGit): +.. code:: + + git config --global core.editor "start notepad++" + +.. code:: + + git config --global core.autocrlf true Cloning the repository (first time only) ---------------------------------------- @@ -192,15 +222,31 @@ The -u flag tells git to stage any modified files that are already in source con Notice that there is no longer a space before the M, this indicates that the file is staged. -* Now we commit the changes locally using the git commit command like so: +* Now we commit the changes locally using the git commit command. The commit will require a comment and the +format for comments should be as per https://robots.thoughtbot.com/5-useful-tips-for-a-better-commit-message i.e. +50 char title, blank line, further details wrapped at 72 characters per line. .. code:: - mjc23@NDW1373 /c/CodeWorkspaces/GitHub/ibex_gui/base (Ticket768) - $ git commit -m "Removed no groups message from UI" - [Ticket768 8b9814f] Removed no groups message from UI - 2 files changed, 3 insertions(+), 3 deletions(-) + faa59@NDW847 /c/development/github/freddie/asyn (HigherCOMPorts) + $ git commit + +* Before we finally push to the server we will merge into our branch any changes that have been pushed to master on github, this +is to make the job easier for a reviewer as we will see potential merge conflicts. We update out local master branch with +changes on GitHub and then merge them into our copy: +.. code:: + faa59@NDW847 /c/development/github/freddie/asyn (HigherCOMPorts) + $ git pull origin master + From https://github.com/FreddieAkeroyd/asyn + * branch master -> FETCH_HEAD + Already up-to-date. + faa59@NDW847 /c/development/github/freddie/asyn (HigherCOMPorts) + $ git merge master + Already up-to-date. + +(Advanced note: if your branch does not yet exist on GitHub, and has not been otherwise shared with another developer, then you may wish to consider doing a rebase rather than a merge) + * Next we push the changes back to GitHub using the git push command like so: .. code:: @@ -374,6 +420,6 @@ Deleting the branch ------------------- Once the branch has been merged into master it can be deleted via the pull request page on GitHub. Don't worry it is not permanently deleted! - +You will also have to delete the branch locally. From 4a7d83cd863c22e535e722bc179ca26052c4fd6a Mon Sep 17 00:00:00 2001 From: Freddie Akeroyd Date: Tue, 23 Jun 2015 13:14:29 +0100 Subject: [PATCH 2/2] Fix typos in formatting Fix typos in formatting --- development_workflow.rst | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/development_workflow.rst b/development_workflow.rst index b8a77667e..0f522ff12 100644 --- a/development_workflow.rst +++ b/development_workflow.rst @@ -9,11 +9,11 @@ Quick overview of workflow: #. **Clone the branch locally (developer)** #. **Modify the code (developer)** #. **Push back the changes (developer)** -# * make sure you have merged in any changes to master that have occurred since your ticket was created - makes reviewer's life easier -# * please follow commenting guidelines below + * make sure you have merged in any changes to master that have occurred since your ticket was created - makes reviewer's life easier + * please follow commenting guidelines below #. **Create a pull request (developer)** -# * Assign the correct sprint milestone to the ticket -# * Assign an appropriate label (ticket, bug, enhancement, ...) + * Assign the correct sprint milestone to the ticket + * Assign an appropriate label (ticket, bug, enhancement, ...) #. **Review (reviewer)** * Assign the pull request to yourself to indicate you are reviewing it (and, perhaps, add a comment as well) * If it is okay move to the next step, otherwise inform the developer of the problem and add a comment to the pull request @@ -23,6 +23,7 @@ Quick overview of workflow: #. **Close the ticket in Trac (reviewer or developer)** Notes: + * You don't have to create branches on GitHub first, often it is more convenient to create them locally first instead (which you meus do if you intend to rebase) * Deleting a branch on github does not delete it from you local repository clone @@ -61,6 +62,8 @@ or type: git config --global core.editor "start notepad++" +* Set linehandling (on Windows): + .. code:: git config --global core.autocrlf true @@ -222,7 +225,9 @@ The -u flag tells git to stage any modified files that are already in source con Notice that there is no longer a space before the M, this indicates that the file is staged. -* Now we commit the changes locally using the git commit command. The commit will require a comment and the +* Now we commit the changes locally using the git commit command. + +The commit will require a comment and the format for comments should be as per https://robots.thoughtbot.com/5-useful-tips-for-a-better-commit-message i.e. 50 char title, blank line, further details wrapped at 72 characters per line. @@ -231,8 +236,10 @@ format for comments should be as per https://robots.thoughtbot.com/5-useful-tips faa59@NDW847 /c/development/github/freddie/asyn (HigherCOMPorts) $ git commit -* Before we finally push to the server we will merge into our branch any changes that have been pushed to master on github, this -is to make the job easier for a reviewer as we will see potential merge conflicts. We update out local master branch with +* Check for upstream commits + +Before we finally push to the server we will merge into our branch any changes that have been pushed to master on github, this +is to make the job easier for a reviewer as we will see potential merge conflicts and handle them ourselves. We update out local master branch with changes on GitHub and then merge them into our copy: .. code:: @@ -245,7 +252,7 @@ changes on GitHub and then merge them into our copy: $ git merge master Already up-to-date. -(Advanced note: if your branch does not yet exist on GitHub, and has not been otherwise shared with another developer, then you may wish to consider doing a rebase rather than a merge) +(Advanced usage note: if your branch does not yet exist on GitHub, and has not been otherwise shared with another developer, then you may wish to consider doing a rebase rather than a merge) * Next we push the changes back to GitHub using the git push command like so: