This shows an example of submitting patches to MUSHclient using Git.
First, install git. ;)
Then, get a copy of the MUSHclient source, like this:
If you already have MUSHclient from git, make sure you have the latest version, like this:
Change to the MUSHclient directory, and make a branch for your changes:
Edit the code. In my case I added a line in doc.cpp, line 724, as follows:
See what changes you made:
Compile and test that things are working how you expect.
Then, add and commit the changes:
Make a patch file:
Check out the patch:
The patch can now be emailed to me, or posted in the forum.
If posting in the forum, make sure you "escape forum codes" as well as using the 'code' tag as described in the link above.
If I choose to accept the patch, I can use "git am" to "apply mail message" which would merge the patch into the latest version.
First, install git. ;)
Then, get a copy of the MUSHclient source, like this:
$ git clone git://github.com/nickgammon/mushclient.git
If you already have MUSHclient from git, make sure you have the latest version, like this:
$ git pull # from the mushclient directory
Change to the MUSHclient directory, and make a branch for your changes:
$ cd mushclient
$ git checkout -b my_extra_stuff
Switched to a new branch "my_extra_stuff"
Edit the code. In my case I added a line in doc.cpp, line 724, as follows:
Note (Translate ("MUSHclient - FreeWare MUD client."));
See what changes you made:
$ git status
# On branch my_extra_stuff
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
#
# modified: doc.cpp
#
no changes added to commit (use "git add" and/or "git commit -a")
Compile and test that things are working how you expect.
Then, add and commit the changes:
$ git commit -am "Added extra welcome message"
Created commit d3a7ec4: Added extra welcome message
1 files changed, 1 insertions(+), 0 deletions(-)
Make a patch file:
$ git format-patch master --stdout > my_great_patch.diff
Check out the patch:
$ cat my_great_patch.diff
From d3a7ec4c1888a5f46c77d6eb082de3b1eedab94a Mon Sep 17 00:00:00 2001
From: Nick Gammon <nick@gammon.com.au>
Date: Sat, 23 Jan 2010 13:52:20 +1100
Subject: [PATCH] Added extra welcome message
---
doc.cpp | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/doc.cpp b/doc.cpp
index 2ebe00e..228543d 100644
--- a/doc.cpp
+++ b/doc.cpp
@@ -721,6 +721,7 @@ void CMUSHclientDoc::SetUpOutputWindow (void)
}
Note ("");
+ Note (Translate ("MUSHclient - FreeWare MUD client."));
Note (TFormat ("Welcome to MUSHclient version %s!", MUSHCLIENT_VERSION));
Note (Translate ("Written by Nick Gammon."));
Note ("");
--
1.5.6.3
The patch can now be emailed to me, or posted in the forum.
To make your code more readable please use [code] tags as described here.
If posting in the forum, make sure you "escape forum codes" as well as using the 'code' tag as described in the link above.
If I choose to accept the patch, I can use "git am" to "apply mail message" which would merge the patch into the latest version.