Editing Patches

From BRL-CAD

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 14: Line 14:
  
 
<pre>
 
<pre>
svn checkout https://svn.code.sf.net/p/brlcad/code/brlcad/trunk brlcad
+
svn checkout https://brlcad.svn.sourceforge.net/svnroot/brlcad/brlcad/trunk brlcad
 
</pre>
 
</pre>
  
 
If you are in the folder where the "brlcad" folder is and you run
 
If you are in the folder where the "brlcad" folder is and you run
that command, svn will only download updated/modified files.
+
that command, svn will only download updated/modified files.  
  
== How to create a patch ==
 
  
In order to submit a patch it is important to have the latest version of BRL-CAD from a Subversion repository checkout.  Any changes you make to files can be automatically captured in a standard file format called a '''''patch''''' file using 'svn' commands.  Running this command will tell you what files you have modified, added, or removed:
 
<pre>
 
svn status
 
</pre>
 
  
If you added any new files, they will show up as lines starting with '?'.  To include new files in the patch, run:
+
== How to create a patch ==
<pre>
 
svn add myfile.txt
 
</pre>
 
  
If you have removed any files, they will show up as lines starting with '!'. You can include that change in your patch by running:
+
In order to submit a patch it is important to have the latest version of BRL-CAD. After you have done that, you get into the brlcad directory and run
 
<pre>
 
<pre>
svn remove myfile.txt
+
svn diff > ~/first.patch
 
</pre>
 
</pre>
 
+
This will create the patch file in your user's home. The patch is in text format
 
+
and you can read it to make sure it contains what was intended.
After you have added and/or removed files, the next most important step is to generate a patch file (aka a diff file).  Redirecting 'svn diff' output will create this file automatically:
 
<pre>
 
svn diff > mychanges.patch
 
</pre>
 
 
 
The last step is to read the patch file you created to make sure it 1) includes all of the changes you intended and 2) does not include any changes you did not intend. A patch file is a simple text format, so you can review it using any text editor or file viewing tools (e.g., 'more mychanges.patch').  Read it to make sure it contains what was intended and only what was intended.
 
  
 
== How to Submit a patch ==
 
== How to Submit a patch ==
Line 56: Line 42:
 
and, if necessary, what isn't working.
 
and, if necessary, what isn't working.
  
Be sure to check out the extensive [[Documentation]] and [[Main_Page]] for tutorials and [[Deuces]] for ways to get involved!
+
Be sure to check out the extensive [[Documentation]] and [[Main_Page]] for tutorials and [[Contributor Quickies]] for ways to get involved!

Please note that all contributions to BRL-CAD may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see BRL-CAD:Copyrights for details). Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)