Difference between revisions of "Information for OPL maintainers"

From WeBWorK_wiki
Jump to navigation Jump to search
m (→‎Fixing a Bug: code-tag)
 
(15 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Here is information for OPL maintainers.
+
Here is information for OPL maintainers for fixing bugs.
  +
Note, the svn version of the NPL/OPL is closed. All changes should take place in the git repository.
   
  +
See also [[Information for OPL Editors]].
   
==Initial Setup==
+
==Fixing a Bug==
The OPL is kept as a git repository at [http://github.com github]. There is a little work to do to get set up, but then committing your bug fixes back to the main repository is fairly easy. Steps in this section only need to be done once.
 
   
# Go to [http://github.com github] and create an account (if you do not have one already). It is free.
 
  +
# <code>cd</code> to your copy of the OPL git repository
# Step 2
 
  +
# <code>git pull</code> -- this brings in any changes made to OPL problems
 
  +
# Fix the bug (admittedly, most of the time is spent here)
==When Fixing a Bug==
 
  +
# <code>git commit -a</code>, and give a useful commit message. In particular, if this is a bug from bugzilla, mention that you fixed the bug with the bug number. Note, this will commit changes to '''every''' file you have modified. If you see that more files are going to be committed which you did not intend, leave the commit message blank; it will abort the commit.
 
  +
# Alternatively, if you want to only commit a change to a particular file, first give <code>git add path/to/file</code>, and then <code>git commit</code>
# `cd` to your copy of the OPL git repository
 
  +
# <code>git push</code> -- this sends your changes back to github
# `git pull` -- this brings in any changes made to OPL problems
 
  +
# Mark the bug as fixed in bugzilla with a brief note about the fix
# fix a bug
 
# `git commit -a`, and give a useful commit message. Note, this will commit changes to *every* file you have modified. If you see that more files are going to be committed which you did not intend, leave the commit message blank; it will abort the commit.
 
# `git add path/to/file`
 
   
 
==Auxilliary Commands==
 
==Auxilliary Commands==
Line 19: Line 17:
 
On your home machine, cd to the OPL git repository. From there you can
 
On your home machine, cd to the OPL git repository. From there you can
   
* `git status` -- shows a list of problems which have been modified on your machine
+
* <code>git status</code> -- shows a list of problems which have been modified on your machine
  +
* <code>git diff</code> -- shows diffs for all problems which have been modified on your machine
  +
  +
==Initial Setup==
  +
This is the longest part, but it only has to be done once. The OPL is kept as a git repository at [http://github.com github]. There is a little work to do to get set up, but then committing your bug fixes back to the main repository is fairly easy. Steps in this section only need to be done once.
  +
<ol>
  +
<li> Go to [http://github.com github] and create an account (if you do not have one already). It is free.
  +
<li> Contact one of principal OPL maintainers with your github login to have them add you the list of committers
  +
<li> If you do not have an ssh key (if you have a file ending in ".pub" in your <code>~/.ssh</code> directory, you can skip this step), create one with the command <code>ssh-keygen -t rsa</code>. It will ask you for a passphrase (twice): just hit enter each time.
  +
<li> We make it so you can communicate with github from the command line without passwords. Login to your github account, and
  +
<ul>
  +
<ol style="list-style-type:lower-roman">
  +
<li> click on the settings icon (looks like tools near the upper right corner of the page)
  +
<li> Click "SSH Keys" in the left sidebar
  +
<li> Click "Add SSH key"
  +
<li> Click "Add key"
  +
<li> Give your key a title and paste the contents of your .pub file in the box for the key
  +
<li> Save, you will need to give your github password
  +
</ol>
  +
</ul>
  +
<li> On your home machine, we now tell git who you are. Give the following two commands
  +
<ul>
  +
<ol style="list-style-type:lower-roman">
  +
<li> <code>git config --global user.name "Firstname Lastname"</code> (where you use your real name)
  +
<li> <code>git config --global user.email "me@here.com"</code> (where you use the e-mail address you used at github)
  +
</ol>
  +
</ul>
  +
<li> Now we get a copy of the OPL. <code>cd</code> to the directory where you want to put the OPL. Then <code>git clone git@github.com:openwebwork/webwork-open-problem-library.git</code>
  +
<li> If you have a recent version of git, it may complain that push.default is unset. This has to do with repositories with multiple branches (which the OPL does not have), so any value is ok. If you have other repositories, pick what is best for them. If in doubt, <code>git config --global push.default simple</code> is a reasonable choice.
  +
</ol>
  +
  +
  +
  +
[[Category:Developers]] [[Category:Authors]] [[Category:Open_Problem_Library]]

Latest revision as of 08:56, 20 August 2021

Here is information for OPL maintainers for fixing bugs. Note, the svn version of the NPL/OPL is closed. All changes should take place in the git repository.

See also Information for OPL Editors.

Fixing a Bug

  1. cd to your copy of the OPL git repository
  2. git pull -- this brings in any changes made to OPL problems
  3. Fix the bug (admittedly, most of the time is spent here)
  4. git commit -a, and give a useful commit message. In particular, if this is a bug from bugzilla, mention that you fixed the bug with the bug number. Note, this will commit changes to every file you have modified. If you see that more files are going to be committed which you did not intend, leave the commit message blank; it will abort the commit.
  5. Alternatively, if you want to only commit a change to a particular file, first give git add path/to/file, and then git commit
  6. git push -- this sends your changes back to github
  7. Mark the bug as fixed in bugzilla with a brief note about the fix

Auxilliary Commands

On your home machine, cd to the OPL git repository. From there you can

  • git status -- shows a list of problems which have been modified on your machine
  • git diff -- shows diffs for all problems which have been modified on your machine

Initial Setup

This is the longest part, but it only has to be done once. The OPL is kept as a git repository at github. There is a little work to do to get set up, but then committing your bug fixes back to the main repository is fairly easy. Steps in this section only need to be done once.

  1. Go to github and create an account (if you do not have one already). It is free.
  2. Contact one of principal OPL maintainers with your github login to have them add you the list of committers
  3. If you do not have an ssh key (if you have a file ending in ".pub" in your ~/.ssh directory, you can skip this step), create one with the command ssh-keygen -t rsa. It will ask you for a passphrase (twice): just hit enter each time.
  4. We make it so you can communicate with github from the command line without passwords. Login to your github account, and
      1. click on the settings icon (looks like tools near the upper right corner of the page)
      2. Click "SSH Keys" in the left sidebar
      3. Click "Add SSH key"
      4. Click "Add key"
      5. Give your key a title and paste the contents of your .pub file in the box for the key
      6. Save, you will need to give your github password
  5. On your home machine, we now tell git who you are. Give the following two commands
      1. git config --global user.name "Firstname Lastname" (where you use your real name)
      2. git config --global user.email "me@here.com" (where you use the e-mail address you used at github)
  6. Now we get a copy of the OPL. cd to the directory where you want to put the OPL. Then git clone git@github.com:openwebwork/webwork-open-problem-library.git
  7. If you have a recent version of git, it may complain that push.default is unset. This has to do with repositories with multiple branches (which the OPL does not have), so any value is ok. If you have other repositories, pick what is best for them. If in doubt, git config --global push.default simple is a reasonable choice.