{{warning|This page is yet to be reviewed for changes required by the migration to Git. Information and commands on this page may no longer be valid and should be used with care. Please see the [[Development/Git|KDE Git hub page]] for more details. }}

+

This page is mostly useful for people who want to submit a patch against a git repository, but for any reason don't want to use merge requests.

This page is mostly useful for people who want to submit a patch against a git repository, but for any reason don't want to use merge requests.

Revision as of 14:08, 1 March 2011

Warning

This page is yet to be reviewed for changes required by the migration to Git. Information and commands on this page may no longer be valid and should be used with care. Please see the KDE Git hub page for more details.

This page is mostly useful for people who want to submit a patch against a git repository, but for any reason don't want to use merge requests.

This will download the repository in a directory named "amarok" on your machine.

Getting the work done

We create the FooClass.{cpp,h} files and start modifying them. Once we're satisfied, we're ready to commit the result. Since we have created new files, we need to add them to the repository:

git add FooClass.{cpp,h}

Good to go. Now we can commit the result.

git commit -m "Adding important FooClass for Amarok"

You obviously should change the message to what suits you more. Now, let's suppose that right when you are about to send the patch you find out about a small mistake in the file. Don't panic, just do your modification, and commit again (no need for git add this time)

git commit -am "Updating FooClass"

Don't worry about the 2 commits: git will handle that for you

Creating the patch

Ok, so our work is done and we just need to create the patches. It's really simple; just do

git format-patch origin

This command will create a set of patches out of all the commits you made since you cloned the repository. When running this command, you should be prompted a list of created files, one per commit. They should be named like <number>-commit-message.patch; so in our case git format-patch would create 0001-Adding-important-FooClass-for-Amarok.patch and 0002-Updating-FooClass.patch. Remember to send ALL the patches, and not just the last ones!

These patches contains also your commit information, so your name will appear in the commit log.

Sending the patch

You can now send the patch to ReviewBoard, to a developer, or using git send-email. The latter method will not be covered here since it needs some additional configuration. Please see git help send-email to learn more about it.