This is a guide for those who wish to hack on the MPD source code. MPD is an open project, and we are always happy about contributions. So far, more than 150 people have contributed patches. This document is work in progress. Most of it may be incomplete yet. Please help!
This is a guide for those who wish to hack on the MPD source code. MPD is an open project, and we are always happy about contributions. So far, more than 150 people have contributed patches. This document is work in progress. Most of it may be incomplete yet. Please help!
----------
Code Style
Code Style
----------
==========
* indent with tabs (width 8)
* indent with tabs (width 8)
* don't write CPP when you can write C++: use inline functions and constexpr instead of macros
* don't write CPP when you can write C++: use inline functions and constexpr instead of macros
...
@@ -20,9 +18,8 @@ Code Style
...
@@ -20,9 +18,8 @@ Code Style
* all code must be exception-safe
* all code must be exception-safe
* classes and functions names use CamelCase; variables are lower-case with words separated by underscore
* classes and functions names use CamelCase; variables are lower-case with words separated by underscore
@@ -60,9 +57,9 @@ Configure with the options :option:`--enable-debug --enable-werror`. Enable as
...
@@ -60,9 +57,9 @@ Configure with the options :option:`--enable-debug --enable-werror`. Enable as
Don't mix several changes in one single patch. Create a separate patch for every change. Tools like :program:`stgit` help you with that. This way, we can review your patches more easily, and we can pick the patches we like most first.
Don't mix several changes in one single patch. Create a separate patch for every change. Tools like :program:`stgit` help you with that. This way, we can review your patches more easily, and we can pick the patches we like most first.
-----------------
Basic stgit usage
Basic stgit usage
-----------------
-----------------
stgit allows you to create a set of patches and refine all of them: you can go back to any patch at any time, and re-edit it (both the code and the commit message). You can reorder patches and insert new patches at any position. It encourages creating separate patches for tiny changes.
stgit allows you to create a set of patches and refine all of them: you can go back to any patch at any time, and re-edit it (both the code and the commit message). You can reorder patches and insert new patches at any position. It encourages creating separate patches for tiny changes.
stgit needs to be initialized on a git repository:
stgit needs to be initialized on a git repository:
...
@@ -95,22 +92,19 @@ When the whole patch series is finished, convert stgit patches to git commits:
...
@@ -95,22 +92,19 @@ When the whole patch series is finished, convert stgit patches to git commits:
stg commit
stg commit
------------------
Submitting Patches
Submitting Patches
------------------
==================
Send your patches to the mailing list:
Send your patches to the mailing list:
Email: `mpd-devel <mpd-devel@musicpd.org>`_
Email: `mpd-devel <mpd-devel@musicpd.org>`_
:program:`git pull` requests are preferred.
:program:`git pull` requests are preferred.
-----------------
Development Tools
Development Tools
-----------------
=================
*********************
Clang Static Analyzer
Clang Static Analyzer
*********************
---------------------
The `static analyzer <http://clang-analyzer.llvm.org/>`_ is a tool that helps find bugs. To run it on the MPD code base, install LLVM and clang. configure MPD to use clang:
The `static analyzer <http://clang-analyzer.llvm.org/>`_ is a tool that helps find bugs. To run it on the MPD code base, install LLVM and clang. configure MPD to use clang: