ITK/Contribute: Difference between revisions

From KitwarePublic
< ITK
Jump to navigationJump to search
(New page that helps describes best practices of how to identify, workon, and commit changes to ITK.)
 
No edit summary
 
(6 intermediate revisions by 5 users not shown)
Line 1: Line 1:
Best practices process for contributing to ITK.
Please see [https://github.com/InsightSoftwareConsortium/ITK/blob/master/CONTRIBUTING.md CONTRIBUTING.md on GitHub ].
 
{{Historical}}
 
Short guide for best practices process for contributing to ITK.
 
== Step by step complete documentation provided at ==
 
How to develop new patches http://www.itk.org/Wiki/ITK/Git/Develop
 
 


== Bugs/Feature enhancements best practices guide ==
== Bugs/Feature enhancements best practices guide ==


# Determine if the contribution is already listed in the bug tracker: http://public.kitware.com/Bug/my_view_page.php
# Determine if the contribution is already listed in the bug tracker: http://issues.itk.org
# Add proposed contribution (if necessary) and assign it to yourself  (NOTE THE BUG ID link i.e. 0011074)
# Add proposed contribution (if necessary) and assign it to yourself  (NOTE THE BUG ID link i.e. ITK-2287)
# Create a new branch called "BUG0011074" from the updated git ITK master branch
# Create a new branch called "ITK-2287" from the updated git ITK master branch
# Make proposed changes on branch "BUG0011074", thoroughly test changes, submit dashboard indicating (NOTE THE DASHBOARD link )
# Make proposed changes on branch "ITK-2287" and thoroughly test the changes
# Merge BUG0011074 branch into master, commit changes with a comment that includes both the BUGID and link to dashboard indicating that the contribution introduces no new errors.
# Commit changes with a comment that includes the BUGID
# Close the Mantis issue, and include the commit hash key as a comment when closing.
# Submit the commit to ITK code review using gerrit-push
# Close the JIRA issue, and include the commit hash key as a comment when closing.


=== Example ===
=== Example ===
Line 14: Line 25:
To update the ITK version number, the follow process could be followed:
To update the ITK version number, the follow process could be followed:


Create a Mantis issue stating what you want to accomplish:  [http://public.kitware.com/Bug/view.php?id=11074]
Create a JIRA issue stating what you want to accomplish.
Assign issue to yourself.
Assign issue to yourself.


<pre>
<pre>
git fetch origin
git status
git checkout master
git checkout master
git branch BUG0011074
git pullall
git checkout BUG0011074
git checkout -b ITK-2287 origin/master
vim CMakeLists.txt  # Edit to change the version number
vim CMakeLists.txt  # Edit to change the version number
git add CMakeLists.txt
git add CMakeLists.txt
git commit
git commit -m"BUG: Issue resolved for bug ITK-2287"
git checkout master
git prepush
git merge BUG0011074
git gerrit-push
git push origin
</pre>
git branch -d BUG0011074
 
Close the JIRA issue with reference to the commit hash key.
 
== Changing commit history ==
 
Git has some powerful tools to refactor the commit history.  For example,
<pre>
git commit --amend
</pre>
can be used to change the content or commit message from the last commit.
 
<pre>
git rebase -i
</pre>
</pre>
can be used to merge incremental commits into logical units.


Close the Mantis issue with reference to the commit hash key.
These can be very convenient functions, but they should only be used on a local repository ''before'' the changes have been published to a public location.

Latest revision as of 17:28, 2 January 2019

Please see CONTRIBUTING.md on GitHub .

Short guide for best practices process for contributing to ITK.

Step by step complete documentation provided at

How to develop new patches http://www.itk.org/Wiki/ITK/Git/Develop


Bugs/Feature enhancements best practices guide

  1. Determine if the contribution is already listed in the bug tracker: http://issues.itk.org
  2. Add proposed contribution (if necessary) and assign it to yourself (NOTE THE BUG ID link i.e. ITK-2287)
  3. Create a new branch called "ITK-2287" from the updated git ITK master branch
  4. Make proposed changes on branch "ITK-2287" and thoroughly test the changes
  5. Commit changes with a comment that includes the BUGID
  6. Submit the commit to ITK code review using gerrit-push
  7. Close the JIRA issue, and include the commit hash key as a comment when closing.

Example

To update the ITK version number, the follow process could be followed:

Create a JIRA issue stating what you want to accomplish. Assign issue to yourself.

git status
git checkout master
git pullall
git checkout -b ITK-2287 origin/master
vim CMakeLists.txt   # Edit to change the version number
git add CMakeLists.txt
git commit -m"BUG: Issue resolved for bug ITK-2287"
git prepush
git gerrit-push

Close the JIRA issue with reference to the commit hash key.

Changing commit history

Git has some powerful tools to refactor the commit history. For example,

git commit --amend

can be used to change the content or commit message from the last commit.

git rebase -i

can be used to merge incremental commits into logical units.

These can be very convenient functions, but they should only be used on a local repository before the changes have been published to a public location.