Git
From Music Player Daemon Community Wiki
We've migrated mpd, libmpdclient, and mpc development over to git
Information about our repository is here:
Information about git is here:
Contents |
[edit] Cloning and rebasing
Clone the git repository (similar to "svn checkout"):
git clone git://git.musicpd.org/master/mpd.git
If you already have a clone, update it:
git pull --rebase
You can do without "--rebase", but we recommend that you rebase your repository on the "master" repository all the time.
[edit] Basic git usage
Now edit the sources. The commands git status and git diff are helpful here. When you're done with one patch, commit it:
git commit -a
git asks you for a commit message. Describe your patch here. First line is the subject line (which will appear in "shortlogs"), followed by a blank line, then a longer description. Example.
To review your patch, type git show.
Please create separate patches (i.e. commits) for each small change you're doing. This way, we can review your patches more easily, and we can pick the patches we like most first.
[edit] 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 needs to be initialized on a git repository: stg init
Before you edit the code, create a patch: stg new my-patch-name (stgit now asks you for the commit message).
Now edit the code. Once you're finished, you have to "refresh" the patch, i.e. your edits are incorporated into the patch you have created: stg refresh
You may now continue editing the same patch, and refresh it as often as you like. Create more patches, edit and refresh them.
To view the list of patches, type stg series. To go back to a specific patch, type stg goto my-patch-name; now you can re-edit it (don't forget stg refresh when you're finished with that patch).
When the whole patch series is finished, convert stgit patches to git commits: stg commit
[edit] Submitting patches
When all patches are finished, publish your patches. You could email them to the mailing list, but we recommend to push them to a public git repository. Either request an account on git.musicpd.org or get a free repository on repo.or.cz. To public your changes, type:
git push ssh://gitosis@git.musicpd.org/public/myname/mpd.git
Then, write an email to the mailing list, telling us to pull: "Please pull git://git.musicpd.org/myname/mpd.git master". This allows us to merge your patches with one single command.
