3.8 KiB
Contributing
We love pull requests from everyone. Push to your fork and submit a pull request.
Wait for us. We try to review your pull requests as fast as possible. If we find issues with your pull request, we may suggest some changes and improvements.
Table of Contents
- Build instructions
- Pull upstream changes into your fork regularly
- How to get your pull request accepted
Build instructions
Pull upstream changes into your fork regularly
Telegram Desktop is advancing quickly. It is therefore critical that you pull upstream changes into your fork on a regular basis. Nothing is worse than putting in a days of hard work into a pull request only to have it rejected because it has diverged too far from upstram.
To pull in upstream changes:
git remote add upstream https://github.com/telegramdesktop/tdesktop.git
git fetch upstream master
Check the log to be sure that you actually want the changes, before merging:
git log upstream/master
Then merge the changes that you fetched:
git merge upstream/master
For more info, see GitHub Help.
How to get your pull request accepted
We want your submission. But we also want to provide a stable experience for our users and the community. Follow these rules and you should succeed without a problem!
Keep your pull requests limited to a single issue
Pull requests should be as small/atomic as possible. Large, wide-sweeping changes in a pull request will be rejected, with comments to isolate the specific code in your pull request. Some examples:
- If you are making spelling corrections in the docs, don't modify other files.
- If you are adding new functions don't 'cleanup' unrelated functions. That cleanup belongs in another pull request.
Don't mix code changes with whitespace cleanup
If you change two lines of code and correct 200 lines of whitespace issues in a file the diff on that pull request is functionally unreadable and will be rejected. Whitespace cleanups need to be in their own pull request.
Keep your code simple!
Please keep your code as clean and straightforward as possible.
When we see more than one or two functions/methods starting with _my_special_function
or things like __builtins__.object = str
we start to get worried.
Rather than try and figure out your brilliant work we'll just reject it and send along a request for simplification.
Furthermore, the pixel shortage is over. We want to see:
package
instead ofpkg
grid
instead ofg
my_function_that_does_things
instead ofmftdt
Test your changes!
Before you submit a pull request, please test your changes. Verify that Telegram Desktop still works and your changes don't cause other issue or crashes.
Write a good commit message
Explain why you make the changes. More infos about a good commit message. Maybe reference also the related issue in your commit message.