Patch Submission Format

Discussion of all aspects of the game engine, including development of new and existing features.

Moderator: Forum Moderators

Locked
rogue
Code Contributor
Posts: 73
Joined: February 15th, 2005, 1:36 am
Location: Michigan, USA
Contact:

Patch Submission Format

Post by rogue »

Are there specific guidelines anywhere on how to submit a patch? More specifically, on the format of the patch itself?

I've only submitted one patch, and it was about a year ago. I noticed that people were submitting patches as .diff files, so I read up on how to create .diff files and submitted my patch in that format. However, the process felt awkward and inelegant, and I don't think I did it quite right.

As such, I think it would be great if there was a sticky post in this forum detailing how to get a patch into the format the developers would prefer for submission.

Thanks in advance to anybody who can post this information.
<rcarello>
Boucman
Inactive Developer
Posts: 2119
Joined: March 31st, 2004, 1:04 pm

Post by Boucman »

good point, I'll post a couple of guidelines for patch submission, and make that topic sticky while I'm at it....

All patches should be submitted at patches.wesnoth.org
You can post them here too for discussion, but we need to track what is their status and p.w.o helps a lot

patch should be generated using "svn diff
SVN provides a cool command to generate diff, just run "svn diff >mypatch.patch" to create the patch, and its all nice and ready

it even records precisely the commit against which it was generated, it makes things really easy for us...

Dont forget to add an entry to the Changelog
Add yourself in about.cfg
including your name and/or nick it makes it easier for us.
new contributors should go in the contributor section of the about file

when changing WML, please add a pointer in the wiki to where it should be updated when commited

be patient, sometime we are not very responsive
don't be suprised if we discuss the patch a lot
thus, you should leave us a way to contact you, either a forum nick, an email adress, or submit with a registered gna account.

we try as much as possible to apply patch "as is" which means that we will usually ask you to change a patch rather than changing it ourselves...

The patch should generate no warnings
wesnoth has a large number of warnings enabled, all of them are usefull, if your code spits warning, please have a look, and ask yourself why you are doing what causes the warning.

When adding a file, don't forget src/Makefile.am, src/SConscript, src/CMakeLists.txt, projectfiles/VC9/wesnoth.vcproj
it makes things simpler for us, and is often forgotten

sometime patches are rejected, don't be suprised if it happens

that's all for the moment, we'll probably add some more later[/b]
Last edited by Crab on September 12th, 2009, 10:42 pm, edited 1 time in total.
Reason: added note about projectfiles/VC9/wesnoth.vcproj
Fight key loggers: write some perl using vim
freecraft
Posts: 94
Joined: April 28th, 2005, 12:49 am
Location: Serbia
Contact:

Post by freecraft »

Boucman wrote:When adding a file, don't forget Makefile.am
Sorry I don't understand this. Can you clarify that? What and when should I do with Makefile.am? I think I could fix some bugs ...
Soliton
Site Administrator
Posts: 1680
Joined: April 5th, 2005, 3:25 pm
Location: #wesnoth-mp

Post by Soliton »

freecraft wrote:
Boucman wrote:When adding a file, don't forget Makefile.am
Sorry I don't understand this. Can you clarify that? What and when should I do with Makefile.am? I think I could fix some bugs ...
If you fix bugs you'll probably not add files but if you do you need to list the file(s) in src/Makefile.am for the build process to work.
"If gameplay requires it, they can be made to live on Venus." -- scott
freecraft
Posts: 94
Joined: April 28th, 2005, 12:49 am
Location: Serbia
Contact:

Post by freecraft »

Ah now I understand. Thank you soliton :)
User avatar
TheScribe
Posts: 465
Joined: June 17th, 2012, 8:17 pm
Location: You won't know till it's too late

Re:

Post by TheScribe »

Boucman wrote:patch should be generated using "svn diff
SVN provides a cool command to generate diff, just run "svn diff >mypatch.patch" to create the patch, and its all nice and ready
I have no idea what this means. Could somebody clarify it?
Sorta on a break from the forums ATM, have been for a while. If I was doing something for/with you and I haven't recently, that's why, I will be back soon hopefully.
Boucman
Inactive Developer
Posts: 2119
Joined: March 31st, 2004, 1:04 pm

Re: Patch Submission Format

Post by Boucman »

did you use svn do do your checkout ? (get the source)

if yes, you should have a command line tool called "svn"

go into your terminal, run "svn diff" and redirect the output to a text file. that text file is what you should submit for inclusion
Fight key loggers: write some perl using vim
User avatar
TheScribe
Posts: 465
Joined: June 17th, 2012, 8:17 pm
Location: You won't know till it's too late

Re: Patch Submission Format

Post by TheScribe »

Boucman wrote:did you use svn do do your checkout ? (get the source)

if yes, you should have a command line tool called "svn"

go into your terminal, run "svn diff" and redirect the output to a text file. that text file is what you should submit for inclusion
I don't know if I used svn. How do I tell? For that matter, what is svn?

And also, what do you mean by a command line tool?
Sorta on a break from the forums ATM, have been for a while. If I was doing something for/with you and I haven't recently, that's why, I will be back soon hopefully.
Boucman
Inactive Developer
Posts: 2119
Joined: March 31st, 2004, 1:04 pm

Re: Patch Submission Format

Post by Boucman »

ok, all this stuff is for developers and code contributors... do you have modifications you want to contribute back (i.e code change in C++)

if no, you shouldn't concern yourself with patches...
Fight key loggers: write some perl using vim
User avatar
TheScribe
Posts: 465
Joined: June 17th, 2012, 8:17 pm
Location: You won't know till it's too late

Re: Patch Submission Format

Post by TheScribe »

I was gonna do something with LUA. It's not finished yet though.
Sorta on a break from the forums ATM, have been for a while. If I was doing something for/with you and I haven't recently, that's why, I will be back soon hopefully.
yieldthought
Posts: 6
Joined: February 15th, 2013, 10:03 pm

Re: Patch Submission Format

Post by yieldthought »

Are patches still preferred in this format, or should we be submitting pull requests via GitHub now?
fabi
Inactive Developer
Posts: 1260
Joined: March 21st, 2004, 2:42 pm
Location: Germany

Re: Patch Submission Format

Post by fabi »

GitHub pull requests are the preferred method now,
still you can submit patches at gna.
Locked