Open Source Comes to Campus/Resources: Difference between revisions
imported>Shauna |
imported>Shauna |
||
Line 33: | Line 33: | ||
I have [a To Do List]! But maybe it needs editing. First, I'll make a copy to edit: |
I have [a To Do List]! But maybe it needs editing. First, I'll make a copy to edit: |
||
+ | |||
<pre>cp ToDoList new_ToDoList</pre> |
<pre>cp ToDoList new_ToDoList</pre> |
||
Line 41: | Line 42: | ||
<pre>diff -u ToDoList new_ToDoList</pre> |
<pre>diff -u ToDoList new_ToDoList</pre> |
||
− | + | That's just printed to the command line, though. How do I store it in a file? |
|
<pre>diff -u ToDoList new_ToDoList > changes.diff</pre> |
<pre>diff -u ToDoList new_ToDoList > changes.diff</pre> |
||
+ | |||
+ | I open up the file and see it contains the same stuff as was printed out before. Okay, now how do I apply these changes to the original list? |
||
+ | |||
+ | <pre>patch -p0 ToDoList < changes.diff</pre> |
||
+ | |||
+ | Note that the argument given to the patch is the file I want to modify, not the file that already has the changes. |
||
+ | |||
+ | People often ask - what does the argument "-u" given to diff mean, or the argument -p0 given to "patch"? |
||
+ | |||
+ | Well, -u tells diff to output in unified diff format. Two other formats are [http://en.wikipedia.org/wiki/Diff#Edit_script Edit script] (specified with -e) and [http://en.wikipedia.org/wiki/Diff#Context_format Context format] (specified with -c). |
||
+ | |||
+ | -p[x] is an argument which allows the user to specify how much of the given file's path needs to be matched. -p0 gives the entire file name unmodified. [http://www.gnu.org/software/diffutils/manual/html_node/patch-Directories.html#patch-Directories The documentation] has a bit more info. |
||
=== Issue Tracker Demo === |
=== Issue Tracker Demo === |
Revision as of 05:42, 17 April 2013
What to expect as a staffer
Laptop Setup
Open Source Communication Tools
The slides I use for this talk can be found [asdad | here]. These are modified from a version graciously provided by Jessica McKellar. There are substantial notes in the ODP file which can be viewed by going to the "Notes" tab.
- Slides 1-7 (#7 is titled 'Version Control')
- Version Control Demo
- Slide 8 (#8 is titled 'Sharing changes: diff and patch')
- Diff and Patch Demo
- Slide 9-10 (#10 is titled 'Issue Trackers')
- Issue Tracker Demo
- Slide 11 (#11 is titled 'IRC')
- IRC Demo
- Slide 12-18
Version Control Demo
Go to the Wikipedia page for the host institution, e.g. http://en.wikipedia.org/wiki/Wellesley_College and http://en.wikipedia.org/w/index.php?title=Wellesley_College&action=history. The presenter of this talk will explore the page more thoroughly later.
I also suggest, while you are out of the ODP presentation, showing the German law Git repository as an example of version control for things other than code.
Diff and Patch Demo
This demo uses the files in [this repository].
I have [a To Do List]! But maybe it needs editing. First, I'll make a copy to edit:
cp ToDoList new_ToDoList
Then I'll open it up and make changes to it. (Side note: make sure to explain which editor you're using and give options for those following along - emacs, vim, nano, or a GUI.)
How do I view the differences between the two?
diff -u ToDoList new_ToDoList
That's just printed to the command line, though. How do I store it in a file?
diff -u ToDoList new_ToDoList > changes.diff
I open up the file and see it contains the same stuff as was printed out before. Okay, now how do I apply these changes to the original list?
patch -p0 ToDoList < changes.diff
Note that the argument given to the patch is the file I want to modify, not the file that already has the changes.
People often ask - what does the argument "-u" given to diff mean, or the argument -p0 given to "patch"?
Well, -u tells diff to output in unified diff format. Two other formats are Edit script (specified with -e) and Context format (specified with -c).
-p[x] is an argument which allows the user to specify how much of the given file's path needs to be matched. -p0 gives the entire file name unmodified. The documentation has a bit more info.
Issue Tracker Demo
IRC Demo
Introduction to the Command Line
--link to website?--
Introduction to Version Control
--get text of previous talk--
Github Demo
--Paul--
Ethics and History of Free Software
--Asheesh--
Staying Involved
- Join our general mailing list.
- Join the alumni mailing list.
- Hang out with us on IRC.
- Training missions?
- Bug list?
- Meetups?
- Programs like GSoC and GNOME outreach.